Skip to content

Files

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Latest commit

b52958d · Feb 18, 2022

History

History
52 lines (36 loc) · 1.62 KB

prefer-import-from-vue.md

File metadata and controls

52 lines (36 loc) · 1.62 KB
pageClass sidebarDepth title description
rule-details
0
vue/prefer-import-from-vue
enforce import from 'vue' instead of import from '@vue/*'

vue/prefer-import-from-vue

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

  • This rule has not been released yet.
  • 🔧 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
/* ✓ GOOD */
import { createApp, ref, Component } from 'vue'
/* ✗ BAD */
import { createApp } from '@vue/runtime-dom'
import { Component } from '@vue/runtime-core'
import { ref } from '@vue/reactivity'

🔧 Options

Nothing.

🔍 Implementation