eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

Component must be imported with defineAsyncComponent

Open dmitryuk opened this issue 1 year ago • 0 comments

Some declared components separated to a custom webpack chunk and must be used with defineAsyncComponent and dynamic import:

// GOOD
const Tooltip = defineAsyncComponent({
    loader: () => import('../../components/Tooltip/Tooltip.vue'),
    hydrate: hydrateOnVisible(),
});

How to make a rule to prevent direct import? Because it will include the component to main chunk

// BAD
 import Tooltip from '../../components/Tooltip/Tooltip.vue';

dmitryuk avatar Nov 05 '24 09:11 dmitryuk