Skip to content

vue/prefer-import-from-vue

enforce import from 'vue' instead of import from '@vue/*'

  • ⚙️ This rule is included in the following preset configs:
    • *.configs["flat/essential"]
    • *.configs["flat/strongly-recommended"]
    • *.configs["flat/recommended"]
    • "plugin:vue/essential"
    • "plugin:vue/strongly-recommended"
    • "plugin:vue/recommended"
  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule aims to use imports from 'vue' instead of imports from '@vue/*'.

Imports from the following modules are almost always wrong. You should import from vue instead.

  • @vue/runtime-dom
  • @vue/runtime-core
  • @vue/reactivity
  • @vue/shared
Now loading...
Now loading...

🔧 Options

Nothing.

🚀 Version

This rule was introduced in eslint-plugin-vue v8.5.0

🔍 Implementation