Skip to content

可用规则

¥Available rules

图例

🔧表示该规则是可修复的,并且在 命令行 上使用 --fix 选项可以自动修复一些报告的问题。

¥🔧 Indicates that the rule is fixable, and using --fix option on the command line can automatically fix some of the reported problems.

💡表示规则报告的某些问题可以由编辑器 suggestions 手动修复。

¥💡 Indicates that some problems reported by the rule are manually fixable by editor suggestions.

表示规则类型的标记:

¥Mark indicating rule type:

  • ⚠️ 可能的问题:这些规则与代码中可能出现的逻辑错误有关。

    ¥⚠️ Possible Problems: These rules relate to possible logic errors in code.

  • 🔨建议:这些规则建议采用其他方式。

    ¥🔨 Suggestions: These rules suggest alternate ways of doing things.

  • 💄布局和格式:这些规则关心的是代码的外观,而不是代码的执行方式。

    ¥💄 Layout & Formatting: These rules care about how the code looks rather than how it executes.

基本规则(启用正确的 ESLint 解析)

¥Base Rules (Enabling Correct ESLint Parsing)

此类别中的规则适用于 eslint-plugin-vue 提供的所有预设。

¥Rules in this category are enabled for all presets provided by eslint-plugin-vue.

规则 ID描述
vue/comment-directive支持 <template> 中的注释指令⚠️
vue/jsx-uses-vars防止在 JSX 中使用的变量被标记为未使用⚠️

优先级 A:必备(错误预防)

¥Priority A: Essential (Error Prevention)

  • 3️⃣表示该规则适用于 Vue 3,并包含在所有 "plugin:vue/essential"*.configs["flat/essential"]"plugin:vue/strongly-recommended"*.configs["flat/strongly-recommended"]"plugin:vue/recommended"*.configs["flat/recommended"] 预设中。

    ¥3️⃣ Indicates that the rule is for Vue 3 and is included in all of "plugin:vue/essential", *.configs["flat/essential"], "plugin:vue/strongly-recommended", *.configs["flat/strongly-recommended"], "plugin:vue/recommended" and *.configs["flat/recommended"] presets.

  • 2️⃣表示该规则适用于 Vue 2,并包含在所有 "plugin:vue/vue2-essential"*.configs["flat/vue2-essential"]"plugin:vue/vue2-strongly-recommended"*.configs["flat/vue2-strongly-recommended"]"plugin:vue/vue2-recommended"*.configs["flat/vue2-recommended"] 预设中。

    ¥2️⃣ Indicates that the rule is for Vue 2 and is included in all of "plugin:vue/vue2-essential",*.configs["flat/vue2-essential"], "plugin:vue/vue2-strongly-recommended",*.configs["flat/vue2-strongly-recommended"] and "plugin:vue/vue2-recommended",*.configs["flat/vue2-recommended"] presets.

规则 ID描述
vue/multi-word-component-names要求组件名称始终为多字3️⃣2️⃣🔨
vue/no-arrow-functions-in-watch禁止使用箭头函数定义观察者3️⃣2️⃣⚠️
vue/no-async-in-computed-properties禁止在计算属性中执行异步操作3️⃣2️⃣⚠️
vue/no-child-content禁止元素的子内容被 v-htmlv-text 等指令覆盖💡3️⃣2️⃣⚠️
vue/no-computed-properties-in-data禁止访问 data 中的计算属性3️⃣2️⃣⚠️
vue/no-custom-modifiers-on-v-model禁止在组件上使用 v-model 的自定义修饰符2️⃣⚠️
vue/no-deprecated-data-object-declaration禁止在数据上使用已弃用的对象声明(在 Vue.js 3.0.0+ 中)🔧3️⃣⚠️
vue/no-deprecated-delete-set禁止使用已弃用的 $delete$set(在 Vue.js 3.0.0+ 中)3️⃣⚠️
vue/no-deprecated-destroyed-lifecycle禁止使用已弃用的 destroyedbeforeDestroy 生命周期钩子(在 Vue.js 3.0.0+ 中)🔧3️⃣⚠️
vue/no-deprecated-dollar-listeners-api禁止使用已弃用的 $listeners(在 Vue.js 3.0.0+ 中)3️⃣⚠️
vue/no-deprecated-dollar-scopedslots-api禁止使用已弃用的 $scopedSlots(在 Vue.js 3.0.0+ 中)🔧3️⃣⚠️
vue/no-deprecated-events-api禁止使用已弃用的事件 api(在 Vue.js 3.0.0+ 中)3️⃣⚠️
vue/no-deprecated-filter禁止使用已弃用的过滤器语法(在 Vue.js 3.0.0+ 中)3️⃣⚠️
vue/no-deprecated-functional-template禁止使用弃用 functional 模板(在 Vue.js 3.0.0+ 中)3️⃣⚠️
vue/no-deprecated-html-element-is禁止在 HTML 元素上使用已弃用的 is 属性(在 Vue.js 3.0.0+ 中)3️⃣⚠️
vue/no-deprecated-inline-template禁止使用已弃用的 inline-template 属性(在 Vue.js 中 3.0.0+)3️⃣⚠️
vue/no-deprecated-model-definition禁止弃用的 model 定义(在 Vue.js 3.0.0+ 中)💡3️⃣⚠️
vue/no-deprecated-props-default-this禁止在 props 默认函数中访问弃用的 this(在 Vue.js 3.0.0+ 中)3️⃣⚠️
vue/no-deprecated-router-link-tag-prop禁止在 RouterLink 上使用已弃用的 tag 属性(在 Vue.js 3.0.0+ 中)3️⃣⚠️
vue/no-deprecated-scope-attribute禁止弃用的 scope 属性(在 Vue.js 2.5.0+ 中)🔧3️⃣🔨
vue/no-deprecated-slot-attribute禁止弃用的 slot 属性(在 Vue.js 2.6.0+ 中)🔧3️⃣🔨
vue/no-deprecated-slot-scope-attribute禁止弃用的 slot-scope 属性(在 Vue.js 2.6.0+ 中)🔧3️⃣🔨
vue/no-deprecated-v-bind-sync禁止在 v-bind 指令上使用已弃用的 .sync 修饰符(在 Vue.js 3.0.0+ 中)🔧3️⃣⚠️
vue/no-deprecated-v-is禁止弃用的 v-is 指令(在 Vue.js 3.1.0+ 中)3️⃣🔨
vue/no-deprecated-v-on-native-modifier禁止使用已弃用的 .native 修饰符(在 Vue.js 3.0.0+ 中)3️⃣⚠️
vue/no-deprecated-v-on-number-modifiers禁止使用已弃用的数字(键码)修饰符(在 Vue.js 3.0.0+ 中)🔧3️⃣⚠️
vue/no-deprecated-vue-config-keycodes禁止使用已弃用的 Vue.config.keyCodes(在 Vue.js 3.0.0+ 中)3️⃣⚠️
vue/no-dupe-keys禁止字段名称重复3️⃣2️⃣⚠️
vue/no-dupe-v-else-if禁止在 v-if / v-else-if 链中出现重复条件3️⃣2️⃣⚠️
vue/no-duplicate-attributes禁止属性重复3️⃣2️⃣⚠️
vue/no-export-in-script-setup禁止 <script setup> 中的 export3️⃣2️⃣⚠️
vue/no-expose-after-await禁止异步注册的 expose3️⃣⚠️
vue/no-lifecycle-after-await禁止异步注册生命周期钩子3️⃣🔨
vue/no-multiple-template-root禁止向模板添加多个根节点2️⃣⚠️
vue/no-mutating-props禁止组件 props 的修改3️⃣2️⃣🔨
vue/no-parsing-error禁止在 <template> 中解析错误3️⃣2️⃣⚠️
vue/no-ref-as-operand禁止使用 ref()(Composition API)封装的值作为操作数🔧3️⃣2️⃣🔨
vue/no-reserved-component-names禁止组件定义中保留名称的使用3️⃣2️⃣🔨
vue/no-reserved-keys禁止覆盖保留键3️⃣2️⃣🔨
vue/no-reserved-props禁止在 props 中保留名称3️⃣2️⃣⚠️
vue/no-shared-component-data强制组件的数据属性为函数🔧3️⃣2️⃣⚠️
vue/no-side-effects-in-computed-properties禁止计算属性中的副作用3️⃣2️⃣⚠️
vue/no-template-key禁止在 <template> 上使用 key 属性3️⃣2️⃣⚠️
vue/no-textarea-mustache禁止 <textarea> 中的胡须3️⃣2️⃣⚠️
vue/no-unused-components禁止注册模板中未使用的组件3️⃣2️⃣🔨
vue/no-unused-vars禁止未使用的 v-for 指令或范围属性变量定义💡3️⃣2️⃣🔨
vue/no-use-computed-property-like-method禁止使用方法等计算属性3️⃣2️⃣⚠️
vue/no-use-v-if-with-v-for禁止在与 v-for 相同的元素上使用 v-if3️⃣2️⃣🔨
vue/no-useless-template-attributes禁止在 <template> 上使用无用属性3️⃣2️⃣⚠️
vue/no-v-for-template-key-on-child禁止将 <template v-for> 的键放在子元素上3️⃣⚠️
vue/no-v-for-template-key禁止在 <template v-for> 上使用 key 属性:no_entry_sign:2️⃣⚠️
vue/no-v-model-argument禁止向自定义组件中使用的 v-model 添加参数:no_entry_sign:2️⃣⚠️
vue/no-v-text-v-html-on-component禁止组件上的 v-text / v-html3️⃣2️⃣⚠️
vue/no-watch-after-await禁止异步注册的 watch3️⃣🔨
vue/prefer-import-from-vue强制从 'vue' 导入,而不是从 '@vue/*' 导入🔧3️⃣🔨
vue/require-component-is要求 <component> 元素中的 v-bind:is3️⃣2️⃣⚠️
vue/require-prop-type-constructor要求 prop 类型为构造函数🔧3️⃣2️⃣🔨
vue/require-render-return强制渲染函数始终返回值3️⃣2️⃣⚠️
vue/require-slots-as-functions强制 $slots 的属性用作函数3️⃣⚠️
vue/require-toggle-inside-transition要求控制 <transition> 内内容的显示3️⃣⚠️
vue/require-v-for-key要求 v-bind:key 带有 v-for 指令3️⃣2️⃣⚠️
vue/require-valid-default-prop强制 props 默认值有效3️⃣2️⃣🔨
vue/return-in-computed-property强制在计算属性中存在 return 语句3️⃣2️⃣⚠️
vue/return-in-emits-validator强制在 emits 验证器中存在 return 语句3️⃣2️⃣⚠️
vue/use-v-on-exact强制在 v-on 上使用 exact 修饰符3️⃣2️⃣🔨
vue/valid-attribute-name要求有效的属性名称3️⃣2️⃣⚠️
vue/valid-define-emits强制使用有效的 defineEmits 编译器宏3️⃣2️⃣⚠️
vue/valid-define-options强制使用有效的 defineOptions 编译器宏3️⃣⚠️
vue/valid-define-props强制使用有效的 defineProps 编译器宏3️⃣2️⃣⚠️
vue/valid-model-definition要求模型选项中有有效键:no_entry_sign:2️⃣⚠️
vue/valid-next-tick强制使用有效的 nextTick 函数调用🔧💡3️⃣2️⃣⚠️
vue/valid-template-root强制有效的模板根3️⃣2️⃣⚠️
vue/valid-v-bind-syncv-bind 指令上强制使用有效的 .sync 修饰符:no_entry_sign:2️⃣⚠️
vue/valid-v-bind强制有效的 v-bind 指令3️⃣2️⃣⚠️
vue/valid-v-cloak强制有效的 v-cloak 指令3️⃣2️⃣⚠️
vue/valid-v-else-if强制有效的 v-else-if 指令3️⃣2️⃣⚠️
vue/valid-v-else强制有效的 v-else 指令3️⃣2️⃣⚠️
vue/valid-v-for强制有效的 v-for 指令3️⃣2️⃣⚠️
vue/valid-v-html强制有效的 v-html 指令3️⃣2️⃣⚠️
vue/valid-v-if强制有效的 v-if 指令3️⃣2️⃣⚠️
vue/valid-v-is强制有效的 v-is 指令3️⃣⚠️
vue/valid-v-memo强制有效的 v-memo 指令3️⃣⚠️
vue/valid-v-model强制有效的 v-model 指令3️⃣2️⃣⚠️
vue/valid-v-on强制有效的 v-on 指令3️⃣2️⃣⚠️
vue/valid-v-once强制有效的 v-once 指令3️⃣2️⃣⚠️
vue/valid-v-pre强制有效的 v-pre 指令3️⃣2️⃣⚠️
vue/valid-v-show强制有效的 v-show 指令3️⃣2️⃣⚠️
vue/valid-v-slot强制有效的 v-slot 指令3️⃣2️⃣⚠️
vue/valid-v-text强制有效的 v-text 指令3️⃣2️⃣⚠️

优先级 B:强烈推荐(提高可读性)

¥Priority B: Strongly Recommended (Improving Readability)

  • 3️⃣表示该规则适用于 Vue 3,并包含在所有 "plugin:vue/strongly-recommended"*.configs["flat/strongly-recommended"]"plugin:vue/recommended"*.configs["flat/recommended"] 预设中。

    ¥3️⃣ Indicates that the rule is for Vue 3 and is included in all of "plugin:vue/strongly-recommended", *.configs["flat/strongly-recommended"], "plugin:vue/recommended" and *.configs["flat/recommended"] presets.

  • 2️⃣表示该规则适用于 Vue 2,并包含在 "plugin:vue/vue2-strongly-recommended"*.configs["flat/vue2-strongly-recommended"]"plugin:vue/vue2-recommended"*.configs["flat/vue2-recommended"] 预设中。

    ¥2️⃣ Indicates that the rule is for Vue 2 and is included in "plugin:vue/vue2-strongly-recommended",*.configs["flat/vue2-strongly-recommended"] and "plugin:vue/vue2-recommended",*.configs["flat/vue2-recommended"] presets.

规则 ID描述
vue/attribute-hyphenation强制模板中自定义组件的属性命名样式🔧3️⃣2️⃣🔨
vue/component-definition-name-casing强制组件定义名称使用特定大小写🔧3️⃣2️⃣🔨
vue/first-attribute-linebreak强制第一个属性的位置🔧3️⃣2️⃣💄
vue/html-closing-bracket-newline要求或不允许在标签的右括号前换行🔧3️⃣2️⃣💄
vue/html-closing-bracket-spacing要求或不允许在标签的右括号前有空格括号🔧3️⃣2️⃣💄
vue/html-end-tags强制结束标记样式🔧3️⃣2️⃣🔨
vue/html-indent强制 <template> 中的一致缩进🔧3️⃣2️⃣💄
vue/html-quotes强制使用 HTML 属性的引号样式🔧3️⃣2️⃣💄
vue/html-self-closing强制自闭样式🔧3️⃣2️⃣💄
vue/max-attributes-per-line强制每行的最大属性数🔧3️⃣2️⃣💄
vue/multiline-html-element-content-newline要求多行元素内容前后有换行符🔧3️⃣2️⃣💄
vue/mustache-interpolation-spacing在胡须插值中强制统一间距🔧3️⃣2️⃣💄
vue/no-multi-spaces禁止多个空格🔧3️⃣2️⃣💄
vue/no-spaces-around-equal-signs-in-attribute禁止属性中等号周围有空格🔧3️⃣2️⃣💄
vue/no-template-shadow禁止变量声明覆盖外部作用域中声明的变量3️⃣2️⃣🔨
vue/one-component-per-file强制每个组件都应位于其自己的文件中3️⃣2️⃣🔨
vue/prop-name-casing强制 Vue 组件中 Prop 名称使用特定大小写3️⃣2️⃣🔨
vue/require-default-prop要求 props 有默认值3️⃣2️⃣🔨
vue/require-explicit-emits要求 emits 选项带有名称由 $emit() 触发💡3️⃣🔨
vue/require-prop-types要求 props 中有类型定义3️⃣2️⃣🔨
vue/singleline-html-element-content-newline要求单行元素内容前后有换行符🔧3️⃣2️⃣💄
vue/v-bind-style强制 v-bind 指令样式🔧3️⃣2️⃣🔨
vue/v-on-event-hyphenation在模板中的自定义组件上强制使用 v-on 事件命名样式🔧3️⃣🔨
vue/v-on-style强制 v-on 指令样式🔧3️⃣2️⃣🔨
vue/v-slot-style强制 v-slot 指令样式🔧3️⃣2️⃣🔨

优先级 C:推荐(潜在危险模式)

¥Priority C: Recommended (Potentially Dangerous Patterns)

  • 3️⃣表示该规则适用于 Vue 3,并包含在 "plugin:vue/recommended"*.configs["flat/recommended"] 预设中。

    ¥3️⃣ Indicates that the rule is for Vue 3 and is included in "plugin:vue/recommended" and *.configs["flat/recommended"] presets.

  • 2️⃣表示该规则适用于 Vue 2,并包含在 "plugin:vue/vue2-recommended"*.configs["flat/vue2-recommended"] 预设中。

    ¥2️⃣ Indicates that the rule is for Vue 2 and is included in "plugin:vue/vue2-recommended",*.configs["flat/vue2-recommended"] preset.

规则 ID描述
vue/attributes-order强制属性顺序🔧3️⃣2️⃣🔨
vue/block-order强制组件顶层元素的顺序🔧3️⃣2️⃣🔨
vue/no-lone-template禁止不必要的 <template>3️⃣2️⃣⚠️
vue/no-multiple-slot-args禁止将多个参数传递给作用域插槽3️⃣2️⃣⚠️
vue/no-required-prop-with-default强制使用默认值的 props 为可选🔧💡3️⃣2️⃣⚠️
vue/no-v-html禁止使用 v-html 来防止 XSS 攻击3️⃣2️⃣🔨
vue/order-in-components强制组件中属性的顺序🔧💡3️⃣2️⃣🔨
vue/this-in-template禁止在模板中使用 this🔧3️⃣2️⃣🔨

未分类

¥Uncategorized

没有预设启用此类别中的规则。如果你愿意,请启用每条规则。

¥No preset enables the rules in this category. Please enable each rule if you want.

例如:

¥For example:

json
{
  "rules": {
    "vue/block-lang": "error"
  }
}
规则 ID描述
vue/block-lang禁止使用除可用 lang 之外的其他操作🔨
vue/block-tag-newline强制在打开块级标签后和关闭块级标签前换行🔧💄
vue/component-api-style强制组件 API 样式🔨
vue/component-name-in-template-casing强制模板中组件命名样式使用特定大小写🔧🔨
vue/component-options-name-casing强制 components 选项中的组件名称的大小写🔧💡🔨
vue/custom-event-name-casing强制自定义事件名称使用特定大小写🔨
vue/define-emits-declaration强制声明样式 defineEmits🔨
vue/define-macros-order强制编译器宏的顺序(definePropsdefineEmits 等)🔧💡💄
vue/define-props-declaration强制声明样式 defineProps🔨
vue/enforce-style-attribute强制或禁止在 SFC 顶层样式标签中使用 scopedmodule 属性🔨
vue/html-button-has-type禁止使用没有明确类型属性的按钮🔨
vue/html-comment-content-newline强制 HTML 注释中的统一换行符🔧💄
vue/html-comment-content-spacing强制 HTML 注释中的统一间距🔧💄
vue/html-comment-indent强制 HTML 注释中的一致缩进🔧💄
vue/match-component-file-name要求组件 name 属性与其文件名匹配💡🔨
vue/match-component-import-name要求注册的组件名称与导入的组件名称匹配⚠️
vue/max-lines-per-block强制 Vue SFC 块中的最大行数⚠️
vue/max-props强制 Vue 组件中的最大 props 数量⚠️
vue/max-template-depth强制模板的最大深度⚠️
vue/new-line-between-multi-line-property强制 Vue 组件中多行属性之间的换行🔧💄
vue/next-tick-stylenextTick 中强制使用 Promise 或回调样式🔧🔨
vue/no-bare-strings-in-template禁止在 <template> 中使用裸字符串🔨
vue/no-boolean-default禁止布尔默认值🔨
vue/no-duplicate-attr-inheritance在使用 v-bind="$attrs" 时强制将 inheritAttrs 设置为 false🔨
vue/no-empty-component-block禁止 <template> <script> <style> 块为空🔧🔨
vue/no-import-compiler-macros禁止导入 Vue 编译器宏🔧⚠️
vue/no-multiple-objects-in-class禁止将数组中的多个对象传递给类🔨
vue/no-potential-component-option-typo禁止在组件属性中出现潜在的拼写错误💡🔨
vue/no-ref-object-reactivity-loss禁止使用可能导致失去反应性的 ref 对象⚠️
vue/no-restricted-block禁止特定块🔨
vue/no-restricted-call-after-await禁止异步调用受限方法🔨
vue/no-restricted-class禁止 Vue 组件中的特定类⚠️
vue/no-restricted-component-names禁止特定组件名称💡🔨
vue/no-restricted-component-options禁止特定组件选项🔨
vue/no-restricted-custom-event禁止特定自定义事件💡🔨
vue/no-restricted-html-elements禁止特定 HTML 元素🔨
vue/no-restricted-props禁止特定 props💡🔨
vue/no-restricted-static-attribute禁止特定属性🔨
vue/no-restricted-v-bind禁止在 v-bind 中禁止特定参数🔨
vue/no-restricted-v-on禁止在 v-on 中禁止特定参数🔨
vue/no-root-v-if禁止在根元素上使用 v-if 指令🔨
vue/no-setup-props-reactivity-loss禁止将失去 props 反应性的用法传递给 setup🔨
vue/no-static-inline-styles禁止静态内联 style 属性🔨
vue/no-template-target-blank禁止 target="_blank" 属性而不允许 rel="noopener noreferrer"💡⚠️
vue/no-this-in-before-route-enter禁止在 beforeRouteEnter 方法中使用 this⚠️
vue/no-undef-components禁止在 <template> 中使用未定义的组件🔨
vue/no-undef-properties禁止未定义的属性🔨
vue/no-unsupported-features禁止在指定版本上使用不支持的 Vue.js 语法🔧🔨
vue/no-unused-emit-declarations禁止未使用的 emit 声明🔨
vue/no-unused-properties禁止未使用的属性🔨
vue/no-unused-refs禁止未使用的引用🔨
vue/no-use-v-else-with-v-for禁止在与 v-for 相同的元素上使用 v-else-if/v-else🔨
vue/no-useless-mustaches禁止不必要的胡须插值🔧🔨
vue/no-useless-v-bind禁止不必要的 v-bind 指令🔧🔨
vue/no-v-text禁止使用 v-text🔨
vue/padding-line-between-blocks要求或禁止块之间的填充行🔧💄
vue/padding-line-between-tags要求或禁止模板中兄弟标签之间的换行符🔧💄
vue/padding-lines-in-component-definition要求或禁止组件定义中的填充行🔧💄
vue/prefer-define-options强制使用 defineOptions 而不是默认导出🔧🔨
vue/prefer-prop-type-boolean-first强制 Boolean 在组件 prop 类型中排在第一位💡⚠️
vue/prefer-separate-static-class要求模板中的静态类名位于单独的 class 属性中🔧🔨
vue/prefer-true-attribute-shorthandv-bind 值为 true 时,要求简写形式属性💡🔨
vue/prefer-use-template-ref要求模板引用使用 useTemplateRef 而不是 ref/shallowRef🔨
vue/require-default-export要求组件为默认导出⚠️
vue/require-direct-export要求直接导出组件🔨
vue/require-emit-validator要求 emits 中有类型定义💡🔨
vue/require-explicit-slots要求明确定义插槽⚠️
vue/require-expose要求使用 expose 声明公共属性💡🔨
vue/require-macro-variable-name要求某个宏变量名称💡🔨
vue/require-name-property要求 Vue 组件中有 name 属性💡🔨
vue/require-prop-comment要求 props 有注释🔨
vue/require-typed-object-prop强制将类型声明添加到对象 props💡🔨
vue/require-typed-ref要求 refshallowRef 函数为强类型🔨
vue/restricted-component-names强制仅使用特定组件名称⚠️
vue/script-indent强制 <script> 中的一致缩进🔧💄
vue/slot-name-casing强制插槽名称使用特定大小写🔨
vue/sort-keys以与组件顺序兼容的方式强制排序键🔨
vue/static-class-names-order强制静态类名称顺序🔧🔨
vue/v-for-delimiter-style强制 v-for 指令的分隔符样式🔧💄
vue/v-if-else-key要求有条件渲染的重复组件有 key 属性🔧⚠️
vue/v-on-handler-style强制 v-on 指令中处理程序的编写样式🔧🔨

扩展规则

¥Extension Rules

以下规则扩展了 ESLint 本身提供的规则,并将其应用于 <template> 中的表达式。

¥The following rules extend the rules provided by ESLint itself and apply them to the expressions in the <template>.

规则 ID描述
vue/array-bracket-newline<template> 中强制在数组括号打开后和关闭前换行🔧💄
vue/array-bracket-spacing<template> 中强制使用数组括号内的一致间距🔧💄
vue/array-element-newline<template> 中强制每个数组元素后换行🔧💄
vue/arrow-spacing<template> 中强制使用箭头函数中箭头前后的一致间距🔧💄
vue/block-spacing<template> 中禁止或强制在打开块之后和关闭块之前在块内使用空格🔧💄
vue/brace-style<template> 中强制使用块的一致括号样式🔧💄
vue/camelcase在 中强制使用驼峰命名约定 <template>🔨
vue/comma-dangle<template> 中要求或禁止使用尾随逗号🔧💄
vue/comma-spacing<template> 中强制使用逗号前后的一致间距🔧💄
vue/comma-style<template> 中强制使用逗号样式🔧💄
vue/dot-location<template> 中强制使用点前后的一致换行符🔧💄
vue/dot-notation<template> 中尽可能强制使用点符号🔧🔨
vue/eqeqeq要求在 <template> 中使用 ===!==🔧🔨
vue/func-call-spacing<template> 中要求或禁止在函数标识符及其调用之间留有空格🔧💄
vue/key-spacing<template> 中强制使用类型和接口中属性名称和类型注释之间的一致间距🔧💄
vue/keyword-spacing<template> 中强制使用关键字前后的一致间距🔧💄
vue/max-len强制 .vue 文件中的最大行长度💄
vue/multiline-ternary<template> 中强制在三元表达式的操作数之间使用换行符🔧💄
vue/no-console<template> 中禁止使用 console💡🔨
vue/no-constant-condition<template> 中禁止条件中的常量表达式⚠️
vue/no-empty-pattern<template> 中禁止空解构模式⚠️
vue/no-extra-parens<template> 中禁止不必要的括号🔧💄
vue/no-implicit-coercion<template> 中禁止简写类型转换🔧🔨
vue/no-irregular-whitespace禁止在 .vue 中出现不规则空格文件⚠️
vue/no-loss-of-precision<template> 中禁止丢失精度的字面量数字⚠️
vue/no-restricted-syntax<template> 中禁止指定语法🔨
vue/no-sparse-arrays<template> 中禁止稀疏数组⚠️
vue/no-useless-concat<template> 中禁止不必要的字面量或模板字面量连接🔨
vue/object-curly-newline<template> 中强制使用开括号后和闭括号前的一致换行符🔧💄
vue/object-curly-spacing<template>🔧💄
vue/object-property-newline<template> 中强制将对象属性放在单独的行上🔧💄
vue/object-shorthand<template> 中要求或禁止对象字面量的方法和属性简写语法🔧🔨
vue/operator-linebreak<template> 中强制使用运算符的一致换行符样式🔧💄
vue/prefer-template要求在 <template> 中使用模板字面量而不是字符串连接🔧🔨
vue/quote-props<template> 中要求在对象字面量、类型字面量、接口和枚举属性名称周围使用引号 <template>🔧💄
vue/space-in-parens<template> 中强制括号内间距一致🔧💄
vue/space-infix-ops要求在 <template> 中在中缀运算符周围留有空格🔧💄
vue/space-unary-ops<template> 中强制使用一元运算符前后的一致间距🔧💄
vue/template-curly-spacing<template> 中要求或禁止在模板字符串的嵌入表达式周围留有空格🔧💄

已弃用

¥Deprecated

  • 🚫我们将在下一个主要版本中删除弃用的规则。请迁移到后继/新规则。

    ¥🚫 We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.

  • 😇由于资源不足,我们不会修复弃用规则中的错误。

    ¥😇 We don't fix bugs which are in deprecated rules since we don't have enough resources.

规则 ID替换为
vue/no-v-for-template-key(无替换)
vue/no-v-model-argument(无替换)
vue/valid-model-definition(无替换)
vue/valid-v-bind-sync(无替换)

已删除

¥Removed

  • ⛔这些规则在弃用一段时间后,已在之前的主要版本中删除。

    ¥⛔ These rules have been removed in a previous major release, after they have been deprecated for a while.

规则 ID替换为版本中已弃用在版本中删除
vue/component-tags-ordervue/block-order[v9.16.0][v10.0.0]
vue/experimental-script-setup-vars(无替换)[v7.13.0][v9.0.0]
vue/name-property-casingvue/component-definition-name-casing[v7.0.0][v9.0.0]
vue/no-confusing-v-for-v-ifvue/no-use-v-if-with-v-for[v5.0.0][v9.0.0]
vue/no-invalid-model-keysvue/valid-model-definition[v9.0.0][v10.0.0]
vue/no-ref-object-destructurevue/no-ref-object-reactivity-loss[v9.17.0][v10.0.0]
vue/no-setup-props-destructurevue/no-setup-props-reactivity-loss[v9.17.0][v10.0.0]
vue/no-unregistered-componentsvue/no-undef-components[v8.4.0][v9.0.0]
vue/script-setup-uses-vars(无替换)[v9.0.0][v10.0.0]
vue/v-on-function-callvue/v-on-handler-style[v9.7.0][v10.0.0]

eslint-plugin-vue v10.0 中文网 - 粤ICP备13048890号