script/no-internal-imports
Disallow importing from Vue internal modules
Default severity: error
Presets: essential, happy-path, ecosystem, nuxt, opinionated
Automatic fix: None; review the suggested change
Applies to: JS/TS scripts in Vue SFCs; examples show the relevant Options API or script setup form
Options: No rule-specific options. Severity and preset selection are configurable.
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({
lint: {
vize: {
"preset": "incremental",
"rules": {
"script/no-internal-imports": "error"
}
},
},
});
vp run lint
Bad
Both imports address internal dist files rather than Vue’s public package entry point, coupling the component to build-file paths.
<script setup lang="ts">
import { foo } from '@vue/runtime-core/dist/runtime-core.esm-bundler'
import { bar } from 'vue/dist/vue.esm-bundler'
</script>
Good
Importing the required helpers from vue removes the dependency on internal distribution file locations.
<script setup lang="ts">
import { ref, computed } from 'vue'
</script>
Good avoids this rule's finding under the configuration above; other rules may still report diagnostics.