全部规则
本页由配置自动生成,列出每一层启用的全部规则。具体规则的 ❌/✅ 示例见各规则层页面。
- 配置方式:控制该规则的
lintspec()选项;基线层规则只能通过overrides调整。 - 修复 / 建议:✅ 修复 = 可通过
eslint --fix自动修复;✅ 建议 = 在编辑器中提供修复建议。 - 级别:错误 报错并阻断;警告 仅提示。
基线层(109)
| 规则名称 | 规则 | 配置方式 | 级别 | 修复 | 建议 |
|---|---|---|---|---|---|
| Enforce getter and setter pairs in objects and classes | accessor-pairs | overrides | 错误 | — | — |
| 数组回调需返回值 | array-callback-return | overrides | 错误 | — | ✅ |
| Enforce camelcase naming convention | camelcase | overrides | 错误 | — | — |
| 构造函数须调用 super() | constructor-super | overrides | 错误 | — | — |
| Enforce consistent brace style for all control statements | curly | overrides | 错误 | ✅ | — |
| default 置于最后 | default-case-last | overrides | 错误 | — | — |
| 严格相等 | eqeqeq | overrides | 错误 | ✅ | ✅ |
| for 计数方向正确 | for-direction | overrides | 错误 | — | — |
| getter 须返回值 | getter-return | overrides | 错误 | — | — |
| 文件最大行数 | max-lines | maxLines | 警告 | — | — |
| Require constructor names to begin with a capital letter | new-cap | overrides | 错误 | — | — |
Disallow Array constructors | no-array-constructor | overrides | 错误 | ✅ | ✅ |
| 禁止 async Promise executor | no-async-promise-executor | overrides | 错误 | — | — |
Disallow the use of arguments.caller or arguments.callee | no-caller | overrides | 错误 | — | — |
| 禁止 case 内声明 | no-case-declarations | overrides | 错误 | — | ✅ |
| 禁止重写类 | no-class-assign | overrides | 错误 | — | — |
| 禁止与 -0 比较 | no-compare-neg-zero | overrides | 错误 | — | — |
| 禁止条件中赋值 | no-cond-assign | overrides | 错误 | — | — |
| 禁止重写 const | no-const-assign | overrides | 错误 | — | — |
| 禁止无效的常量运算 | no-constant-binary-expression | overrides | 错误 | — | — |
| 禁止常量条件 | no-constant-condition | overrides | 错误 | — | — |
| 禁止构造函数返回值 | no-constructor-return | overrides | 错误 | — | — |
| Disallow control characters in regular expressions | no-control-regex | overrides | 错误 | — | — |
| 禁用 debugger | no-debugger | overrides | 错误 | — | — |
| 禁止 delete 变量 | no-delete-var | overrides | 错误 | — | — |
| 禁止重复函数参数 | no-dupe-args | overrides | 错误 | — | — |
| 禁止重复类成员 | no-dupe-class-members | overrides | 错误 | — | — |
| 禁止重复的 else-if 条件 | no-dupe-else-if | overrides | 错误 | — | — |
| 禁止重复对象键 | no-dupe-keys | overrides | 错误 | — | — |
| 禁止重复 case | no-duplicate-case | overrides | 错误 | — | — |
| 禁止空代码块 | no-empty | overrides | 错误 | — | ✅ |
| 禁止空字符类 | no-empty-character-class | overrides | 错误 | — | — |
| 禁止空解构 | no-empty-pattern | overrides | 错误 | — | — |
| 禁止空静态块 | no-empty-static-block | overrides | 错误 | — | ✅ |
| 禁用 eval | no-eval | overrides | 错误 | — | — |
| 禁止重写异常参数 | no-ex-assign | overrides | 错误 | — | — |
| 禁止扩展原生类型 | no-extend-native | overrides | 错误 | — | — |
| 禁止多余的 bind | no-extra-bind | overrides | 错误 | ✅ | — |
| Disallow unnecessary boolean casts | no-extra-boolean-cast | overrides | 错误 | ✅ | — |
| 禁止 case 穿透 | no-fallthrough | overrides | 错误 | — | — |
| 禁止重写函数声明 | no-func-assign | overrides | 错误 | — | — |
| 禁止改写全局对象 | no-global-assign | overrides | 错误 | — | — |
| 禁止隐式 eval | no-implied-eval | overrides | 错误 | — | — |
| 禁止给导入赋值 | no-import-assign | overrides | 错误 | — | — |
Disallow invalid regular expression strings in RegExp constructors | no-invalid-regexp | overrides | 错误 | — | — |
| 禁止异常空白字符 | no-irregular-whitespace | overrides | 错误 | — | — |
Disallow the use of the __iterator__ property | no-iterator | overrides | 错误 | — | — |
| Disallow labeled statements | no-labels | overrides | 错误 | — | — |
| Disallow unnecessary nested blocks | no-lone-blocks | overrides | 错误 | — | — |
| 禁止精度丢失的数字 | no-loss-of-precision | overrides | 错误 | — | — |
| 禁止误导性字符类 | no-misleading-character-class | overrides | 错误 | — | ✅ |
| Disallow multiline strings | no-multi-str | overrides | 错误 | — | — |
Disallow new operators outside of assignments or comparisons | no-new | overrides | 错误 | — | — |
| 禁止 Function 构造函数 | no-new-func | overrides | 错误 | — | — |
| 禁止 new 非构造函数 | no-new-native-nonconstructor | overrides | 错误 | — | — |
Disallow new operators with the String, Number, and Boolean objects | no-new-wrappers | overrides | 错误 | — | — |
| 禁止把全局对象当函数调用 | no-obj-calls | overrides | 错误 | — | — |
Disallow calls to the Object constructor without an argument | no-object-constructor | overrides | 错误 | — | ✅ |
| Disallow octal literals | no-octal | overrides | 错误 | — | — |
| Disallow octal escape sequences in string literals | no-octal-escape | overrides | 错误 | — | — |
| 禁止 Promise executor 返回值 | no-promise-executor-return | overrides | 错误 | — | ✅ |
Disallow the use of the __proto__ property | no-proto | overrides | 错误 | — | — |
| 禁止直接调用 Object.prototype 方法 | no-prototype-builtins | overrides | 错误 | — | ✅ |
| 禁止重复声明 | no-redeclare | overrides | 错误 | — | — |
| 禁止正则中多个空格 | no-regex-spaces | overrides | 错误 | ✅ | — |
Disallow assignment operators in return statements | no-return-assign | overrides | 错误 | — | — |
| 禁止自我赋值 | no-self-assign | overrides | 错误 | — | — |
| 禁止自我比较 | no-self-compare | overrides | 错误 | — | — |
| Disallow comma operators | no-sequences | overrides | 错误 | — | — |
| 禁止 setter 返回值 | no-setter-return | overrides | 错误 | — | — |
| Disallow identifiers from shadowing restricted names | no-shadow-restricted-names | overrides | 错误 | — | — |
| 禁止稀疏数组 | no-sparse-arrays | overrides | 错误 | — | — |
| 禁止普通字符串中的模板占位符 | no-template-curly-in-string | overrides | 错误 | — | — |
| 禁止 super() 前用 this | no-this-before-super | overrides | 错误 | — | — |
| 禁止抛出字面量 | no-throw-literal | overrides | 错误 | — | — |
| 禁止未声明变量 | no-undef | overrides | 错误 | — | — |
Disallow initializing variables to undefined | no-undef-init | overrides | 错误 | ✅ | — |
| 禁止易混淆的多行表达式 | no-unexpected-multiline | overrides | 错误 | — | — |
| 禁止未修改的循环条件 | no-unmodified-loop-condition | overrides | 错误 | — | — |
| 禁止不可达代码 | no-unreachable | overrides | 错误 | — | — |
| 禁止只执行一次的循环 | no-unreachable-loop | overrides | 错误 | — | — |
| 禁止 finally 中的控制流 | no-unsafe-finally | overrides | 错误 | — | — |
| 禁止关系运算符左侧取反 | no-unsafe-negation | overrides | 错误 | — | ✅ |
| 禁止不安全的可选链 | no-unsafe-optional-chaining | overrides | 错误 | — | — |
| Disallow unused expressions | no-unused-expressions | overrides | 错误 | — | — |
| 禁止未使用的私有成员 | no-unused-private-class-members | overrides | 错误 | — | ✅ |
| 禁止未使用变量 | no-unused-vars | overrides | 错误 | — | ✅ |
| 禁止先使用后定义 | no-use-before-define | overrides | 错误 | — | — |
| 禁止无用的正则反向引用 | no-useless-backreference | overrides | 错误 | — | — |
| 禁止多余的 call/apply | no-useless-call | overrides | 错误 | — | — |
| 禁止多余的 catch | no-useless-catch | overrides | 错误 | — | — |
| Disallow unnecessary computed property keys in objects and classes | no-useless-computed-key | overrides | 错误 | ✅ | — |
| Disallow unnecessary constructors | no-useless-constructor | overrides | 错误 | — | ✅ |
| 禁止多余的转义 | no-useless-escape | overrides | 错误 | — | ✅ |
| 禁止无意义的重命名 | no-useless-rename | overrides | 错误 | ✅ | — |
| Disallow redundant return statements | no-useless-return | overrides | 错误 | ✅ | — |
| 禁用 var | no-var | overrides | 警告 | ✅ | — |
Disallow void operators | no-void | overrides | 错误 | — | — |
Disallow with statements | no-with | overrides | 错误 | — | — |
| 对象简写 | object-shorthand | overrides | 警告 | ✅ | — |
| Enforce variables to be declared either together or separately in functions | one-var | overrides | 错误 | ✅ | — |
| 优先 const | prefer-const | overrides | 错误 | ✅ | — |
| reject 须用 Error | prefer-promise-reject-errors | overrides | 错误 | — | — |
Disallow use of the RegExp constructor in favor of regular expression literals | prefer-regex-literals | overrides | 错误 | — | ✅ |
| Require symbol descriptions | symbol-description | overrides | 错误 | — | — |
| Require or disallow Unicode byte order mark (BOM) | unicode-bom | overrides | 错误 | ✅ | — |
| 用 isNaN 判断 NaN | use-isnan | overrides | 错误 | — | ✅ |
| typeof 比较有效字符串 | valid-typeof | overrides | 错误 | — | ✅ |
| 禁止 Yoda 条件 | yoda | overrides | 错误 | ✅ | — |
unicorn(22)
| 规则名称 | 规则 | 配置方式 | 级别 | 修复 | 建议 |
|---|---|---|---|---|---|
| 禁止存取器中递归访问 this | unicorn/no-accessor-recursion | unicorn | 错误 | — | — |
| Disallow boolean-returning sort comparators. | unicorn/no-boolean-sort-comparator | unicorn | 错误 | — | ✅ |
| Disallow adjacent duplicate operands in logical expressions. | unicorn/no-duplicate-logical-operands | unicorn | 错误 | ✅ | ✅ |
Disallow impossible comparisons against .length or .size. | unicorn/no-impossible-length-comparison | unicorn | 错误 | — | — |
| 禁止错误的 querySelector | unicorn/no-incorrect-query-selector | unicorn | 错误 | ✅ | — |
| 禁止对内置对象用 instanceof | unicorn/no-instanceof-builtins | unicorn | 错误 | ✅ | ✅ |
| Disallow calling functions and constructors with an invalid number of arguments. | unicorn/no-invalid-argument-count | unicorn | 错误 | — | — |
| Disallow comparing a single character from a string to a multi-character string. | unicorn/no-invalid-character-comparison | unicorn | 错误 | — | — |
| 禁止无效的 fetch 选项 | unicorn/no-invalid-fetch-options | unicorn | 错误 | — | — |
| 禁止无效的 removeEventListener | unicorn/no-invalid-remove-event-listener | unicorn | 错误 | — | — |
| Disallow invalid implementations of well-known symbol methods. | unicorn/no-invalid-well-known-symbol-methods | unicorn | 错误 | ✅ | ✅ |
| 禁止事件后访问 currentTarget | unicorn/no-late-current-target-access | unicorn | 错误 | — | — |
| Disallow event-control method calls after the synchronous event dispatch has finished. | unicorn/no-late-event-control | unicorn | 错误 | — | — |
| Disallow checking a Map key before accessing a different key. | unicorn/no-mismatched-map-key | unicorn | 错误 | — | — |
| Disallow misrefactored compound assignments where the target is duplicated in the right-hand side. | unicorn/no-misrefactored-assignment | unicorn | 错误 | — | ✅ |
| 禁止 new Buffer() | unicorn/no-new-buffer | unicorn | 错误 | ✅ | ✅ |
| Disallow optional chaining on undeclared variables. | unicorn/no-optional-chaining-on-undeclared-variable | unicorn | 错误 | — | — |
Prevent unsafe use of ArrayBuffer view .buffer. | unicorn/no-unsafe-buffer-conversion | unicorn | 错误 | — | ✅ |
Disallow reading .value from Promise.allSettled() results without a fulfilled status guard. | unicorn/no-unsafe-promise-all-settled-values | unicorn | 错误 | — | — |
| Disallow unsafe values as property keys. | unicorn/no-unsafe-property-key | unicorn | 错误 | — | — |
Disallow non-literal replacement values in String#replace() and String#replaceAll(). | unicorn/no-unsafe-string-replacement | unicorn | 错误 | — | — |
| Require boolean-returning Proxy traps to return booleans. | unicorn/require-proxy-trap-boolean-return | unicorn | 错误 | ✅ | — |
TypeScript(9)
| 规则名称 | 规则 | 配置方式 | 级别 | 修复 | 建议 |
|---|---|---|---|---|---|
| 禁止 Array 构造函数 | @typescript-eslint/no-array-constructor | typescript | 错误 | ✅ | — |
| Disallow duplicate class members | @typescript-eslint/no-dupe-class-members | typescript | 错误 | — | — |
| Disallow literal numbers that lose precision | @typescript-eslint/no-loss-of-precision | typescript | 错误 | — | — |
| Disallow variable redeclaration | @typescript-eslint/no-redeclare | typescript | 错误 | — | — |
| 禁止未使用的表达式 | @typescript-eslint/no-unused-expressions | typescript | 错误 | — | — |
| Disallow unused private class members | @typescript-eslint/no-unused-private-class-members | typescript | 错误 | — | — |
| 禁止未使用变量 | @typescript-eslint/no-unused-vars | typescript | 错误 | ✅ | ✅ |
| Disallow the use of variables before they are defined | @typescript-eslint/no-use-before-define | typescript | 错误 | — | — |
| Disallow unnecessary constructors | @typescript-eslint/no-useless-constructor | typescript | 错误 | — | ✅ |
import-x(8)
| 规则名称 | 规则 | 配置方式 | 级别 | 修复 | 建议 |
|---|---|---|---|---|---|
| 校验默认导入存在 | import-x/default | importX | 错误 | — | — |
| 禁止无效导出 | import-x/export | importX | 错误 | — | — |
| 导入后缀一致 | import-x/extensions | importX.extensions | 错误 | ✅ | ✅ |
| 校验命名空间导入 | import-x/namespace | importX | 错误 | — | — |
| 禁止重复导入 | import-x/no-duplicates | importX | 警告 | ✅ | — |
| 禁止具名当默认导入 | import-x/no-named-as-default | importX | 警告 | — | — |
| 禁止具名当默认成员 | import-x/no-named-as-default-member | importX | 警告 | — | — |
| 禁止无法解析的导入 | import-x/no-unresolved | importX | 错误 | — | — |
perfectionist(21)
| 规则名称 | 规则 | 配置方式 | 级别 | 修复 | 建议 |
|---|---|---|---|---|---|
| includes 数组排序 | perfectionist/sort-array-includes | perfectionist | 错误 | ✅ | — |
| 类成员排序 | perfectionist/sort-classes | perfectionist | 错误 | ✅ | — |
| 装饰器排序 | perfectionist/sort-decorators | perfectionist | 错误 | ✅ | — |
| 枚举排序 | perfectionist/sort-enums | perfectionist | 错误 | ✅ | — |
| 导出属性排序 | perfectionist/sort-export-attributes | perfectionist | 错误 | ✅ | — |
| 导出排序 | perfectionist/sort-exports | perfectionist | 错误 | ✅ | — |
| 继承子句排序 | perfectionist/sort-heritage-clauses | perfectionist | 错误 | ✅ | — |
| 导入属性排序 | perfectionist/sort-import-attributes | perfectionist | 错误 | ✅ | — |
| 导入排序 | perfectionist/sort-imports | perfectionist.sort | 错误 | ✅ | — |
| 接口属性排序 | perfectionist/sort-interfaces | perfectionist | 错误 | ✅ | — |
| 交叉类型排序 | perfectionist/sort-intersection-types | perfectionist | 错误 | ✅ | — |
| JSX 属性排序 | perfectionist/sort-jsx-props | perfectionist | 错误 | ✅ | — |
| Map 排序 | perfectionist/sort-maps | perfectionist | 错误 | ✅ | — |
| 模块排序 | perfectionist/sort-modules | perfectionist | 错误 | ✅ | — |
| 具名导出排序 | perfectionist/sort-named-exports | perfectionist | 错误 | ✅ | — |
| 具名导入排序 | perfectionist/sort-named-imports | perfectionist | 错误 | ✅ | — |
| 对象类型排序 | perfectionist/sort-object-types | perfectionist | 错误 | ✅ | — |
| Set 排序 | perfectionist/sort-sets | perfectionist | 错误 | ✅ | — |
| switch 分支排序 | perfectionist/sort-switch-case | perfectionist | 错误 | ✅ | — |
| 联合类型排序 | perfectionist/sort-union-types | perfectionist | 错误 | ✅ | — |
| 变量声明排序 | perfectionist/sort-variable-declarations | perfectionist | 错误 | ✅ | — |
React(12)
| 规则名称 | 规则 | 配置方式 | 级别 | 修复 | 建议 |
|---|---|---|---|---|---|
| 禁止 innerHTML 与 children 并存 | @eslint-react/dom-no-dangerously-set-innerhtml-with-children | react | 错误 | — | — |
| 禁止使用 render 返回值 | @eslint-react/dom-no-render-return-value | react | 错误 | — | — |
| 禁止 javascript: URL | @eslint-react/dom-no-script-url | react | 警告 | — | — |
| 禁止不安全的 iframe sandbox | @eslint-react/dom-no-unsafe-iframe-sandbox | react | 警告 | — | — |
| 禁止空元素带 children | @eslint-react/dom-no-void-elements-with-children | react | 错误 | — | — |
| 禁止 children 属性与子节点并存 | @eslint-react/jsx-no-children-prop-with-children | react | 错误 | ✅ | ✅ |
| 禁止展开后再写 key | @eslint-react/jsx-no-key-after-spread | react | 错误 | — | — |
| 禁止 JSX 命名空间语法 | @eslint-react/jsx-no-namespace | react | 错误 | — | — |
| 禁止直接修改 state | @eslint-react/no-direct-mutation-state | react | 错误 | — | — |
| 列表须有 key | @eslint-react/no-missing-key | react | 错误 | — | — |
| Hook 依赖完整 | react-hooks/exhaustive-deps | react | 警告 | ✅ | ✅ |
| enforces the Rules of Hooks | react-hooks/rules-of-hooks | react | 错误 | — | — |
Vue(85)
| 规则名称 | 规则 | 配置方式 | 级别 | 修复 | 建议 |
|---|---|---|---|---|---|
| 支持模板注释指令 | vue/comment-directive | vue | 错误 | — | — |
| 标记 JSX 中使用的变量 | vue/jsx-uses-vars | vue | 错误 | — | — |
| 组件名多词 | vue/multi-word-component-names | vue | 错误 | — | — |
| 禁止 watch 用箭头函数 | vue/no-arrow-functions-in-watch | vue | 错误 | — | — |
| 禁止 computed 中异步 | vue/no-async-in-computed-properties | vue | 错误 | — | — |
| 禁止被指令覆盖的子内容 | vue/no-child-content | vue | 错误 | — | ✅ |
| 禁止 data 中访问 computed | vue/no-computed-properties-in-data | vue | 错误 | — | — |
| 禁止废弃的 data 对象声明 | vue/no-deprecated-data-object-declaration | vue | 错误 | ✅ | — |
| 禁止废弃的 $delete/$set | vue/no-deprecated-delete-set | vue | 错误 | — | — |
| 禁止废弃的 destroyed 钩子 | vue/no-deprecated-destroyed-lifecycle | vue | 错误 | ✅ | — |
| 禁止废弃的 $listeners | vue/no-deprecated-dollar-listeners-api | vue | 错误 | — | — |
| 禁止废弃的 $scopedSlots | vue/no-deprecated-dollar-scopedslots-api | vue | 错误 | ✅ | — |
| 禁止废弃的事件 API | vue/no-deprecated-events-api | vue | 错误 | — | — |
| 禁止废弃的过滤器语法 | vue/no-deprecated-filter | vue | 错误 | — | — |
| 禁止废弃的 functional 模板 | vue/no-deprecated-functional-template | vue | 错误 | — | — |
| 禁止 HTML 元素上废弃的 is | vue/no-deprecated-html-element-is | vue | 错误 | — | — |
| 禁止废弃的 inline-template | vue/no-deprecated-inline-template | vue | 错误 | — | — |
| 禁止废弃的 model 定义 | vue/no-deprecated-model-definition | vue | 错误 | — | ✅ |
| 禁止 props 默认函数中的 this | vue/no-deprecated-props-default-this | vue | 错误 | — | — |
| 禁止 RouterLink 废弃的 tag | vue/no-deprecated-router-link-tag-prop | vue | 错误 | — | — |
| 禁止废弃的 scope 属性 | vue/no-deprecated-scope-attribute | vue | 错误 | ✅ | — |
| 禁止废弃的 slot 属性 | vue/no-deprecated-slot-attribute | vue | 错误 | ✅ | — |
| 禁止废弃的 slot-scope 属性 | vue/no-deprecated-slot-scope-attribute | vue | 错误 | ✅ | — |
| 禁止废弃的 .sync | vue/no-deprecated-v-bind-sync | vue | 错误 | ✅ | — |
| 禁止废弃的 v-is | vue/no-deprecated-v-is | vue | 错误 | — | — |
| 禁止废弃的 .native | vue/no-deprecated-v-on-native-modifier | vue | 错误 | — | — |
| 禁止废弃的按键码修饰符 | vue/no-deprecated-v-on-number-modifiers | vue | 错误 | ✅ | — |
| 禁止废弃的 Vue.config.keyCodes | vue/no-deprecated-vue-config-keycodes | vue | 错误 | — | — |
| 禁止字段名重复 | vue/no-dupe-keys | vue | 错误 | — | — |
| 禁止 v-if 链重复条件 | vue/no-dupe-v-else-if | vue | 错误 | — | — |
| 禁止重复属性 | vue/no-duplicate-attributes | vue | 错误 | — | — |
| 禁止 script setup 中 export | vue/no-export-in-script-setup | vue | 错误 | — | — |
| 禁止 await 后注册 expose | vue/no-expose-after-await | vue | 错误 | — | — |
| 禁止 await 后注册生命周期 | vue/no-lifecycle-after-await | vue | 错误 | — | — |
| 禁止修改 props | vue/no-mutating-props | vue | 错误 | — | — |
| 禁止模板解析错误 | vue/no-parsing-error | vue | 错误 | — | — |
| 禁止 ref 直接作操作数 | vue/no-ref-as-operand | vue | 错误 | ✅ | — |
| 禁止保留组件名 | vue/no-reserved-component-names | vue | 错误 | — | — |
| 禁止覆盖保留键 | vue/no-reserved-keys | vue | 错误 | — | — |
| 禁止保留的 prop 名 | vue/no-reserved-props | vue | 错误 | — | — |
| data 须为函数 | vue/no-shared-component-data | vue | 错误 | ✅ | — |
| 禁止 computed 中副作用 | vue/no-side-effects-in-computed-properties | vue | 错误 | — | — |
| 禁止 template 上的 key | vue/no-template-key | vue | 错误 | — | — |
| 禁止 textarea 中插值 | vue/no-textarea-mustache | vue | 错误 | — | — |
| 禁止未使用组件 | vue/no-unused-components | vue | 错误 | — | — |
| 禁止未使用的模板变量 | vue/no-unused-vars | vue | 错误 | — | ✅ |
| 禁止把 computed 当方法 | vue/no-use-computed-property-like-method | vue | 错误 | — | — |
| 禁止 v-if 与 v-for 同元素 | vue/no-use-v-if-with-v-for | vue | 错误 | — | — |
| 禁止 template 上无用属性 | vue/no-useless-template-attributes | vue | 错误 | — | — |
| 禁止 template v-for 的 key 放子元素 | vue/no-v-for-template-key-on-child | vue | 错误 | — | — |
| 禁止组件上用 v-text/v-html | vue/no-v-text-v-html-on-component | vue | 错误 | — | — |
| 禁止 await 后注册 watch | vue/no-watch-after-await | vue | 错误 | — | — |
| 优先从 vue 导入 | vue/prefer-import-from-vue | vue | 错误 | ✅ | — |
| <component> 须有 :is | vue/require-component-is | vue | 错误 | — | — |
| prop 类型须为构造函数 | vue/require-prop-type-constructor | vue | 错误 | ✅ | — |
| render 须返回值 | vue/require-render-return | vue | 错误 | — | — |
| $slots 须作为函数调用 | vue/require-slots-as-functions | vue | 错误 | — | — |
| transition 内须控制显示 | vue/require-toggle-inside-transition | vue | 错误 | — | — |
| v-for 须有 key | vue/require-v-for-key | vue | 错误 | — | — |
| prop 默认值须有效 | vue/require-valid-default-prop | vue | 错误 | — | — |
| computed 须有 return | vue/return-in-computed-property | vue | 错误 | — | — |
| emits 校验器须有 return | vue/return-in-emits-validator | vue | 错误 | — | — |
| v-on 须用 exact 修饰符 | vue/use-v-on-exact | vue | 错误 | — | — |
| 属性名须有效 | vue/valid-attribute-name | vue | 错误 | — | — |
| defineEmits 须有效 | vue/valid-define-emits | vue | 错误 | — | — |
| defineOptions 须有效 | vue/valid-define-options | vue | 错误 | — | — |
| defineProps 须有效 | vue/valid-define-props | vue | 错误 | — | — |
| nextTick 调用须有效 | vue/valid-next-tick | vue | 错误 | ✅ | ✅ |
| 模板根须有效 | vue/valid-template-root | vue | 错误 | — | — |
| v-bind 须有效 | vue/valid-v-bind | vue | 错误 | — | — |
| v-cloak 须有效 | vue/valid-v-cloak | vue | 错误 | — | — |
| v-else 须有效 | vue/valid-v-else | vue | 错误 | — | — |
| v-else-if 须有效 | vue/valid-v-else-if | vue | 错误 | — | — |
| v-for 须有效 | vue/valid-v-for | vue | 错误 | — | — |
| v-html 须有效 | vue/valid-v-html | vue | 错误 | — | — |
| v-if 须有效 | vue/valid-v-if | vue | 错误 | — | — |
| v-is 须有效 | vue/valid-v-is | vue | 错误 | — | — |
| v-memo 须有效 | vue/valid-v-memo | vue | 错误 | — | — |
| v-model 须有效 | vue/valid-v-model | vue | 错误 | — | — |
| v-on 须有效 | vue/valid-v-on | vue | 错误 | — | — |
| v-once 须有效 | vue/valid-v-once | vue | 错误 | — | — |
| v-pre 须有效 | vue/valid-v-pre | vue | 错误 | — | — |
| v-show 须有效 | vue/valid-v-show | vue | 错误 | — | — |
| v-slot 须有效 | vue/valid-v-slot | vue | 错误 | — | — |
| v-text 须有效 | vue/valid-v-text | vue | 错误 | — | — |
Stylistic(59)
| 规则名称 | 规则 | 配置方式 | 级别 | 修复 | 建议 |
|---|---|---|---|---|---|
| Enforce consistent spacing inside array brackets | @stylistic/array-bracket-spacing | overrides | 错误 | ✅ | — |
| Enforce consistent spacing before and after the arrow in arrow functions | @stylistic/arrow-spacing | overrides | 错误 | ✅ | — |
| Disallow or enforce spaces inside of blocks after opening block and before closing block | @stylistic/block-spacing | overrides | 错误 | ✅ | — |
| Enforce consistent brace style for blocks | @stylistic/brace-style | overrides | 错误 | ✅ | — |
| Require or disallow trailing commas | @stylistic/comma-dangle | overrides | 错误 | ✅ | — |
| Enforce consistent spacing before and after commas | @stylistic/comma-spacing | overrides | 错误 | ✅ | — |
| Enforce consistent comma style | @stylistic/comma-style | overrides | 错误 | ✅ | — |
| Enforce consistent spacing inside computed property brackets | @stylistic/computed-property-spacing | overrides | 错误 | ✅ | — |
| Enforce consistent newlines before and after dots | @stylistic/dot-location | overrides | 错误 | ✅ | — |
| Require or disallow newline at the end of files | @stylistic/eol-last | overrides | 错误 | ✅ | — |
| Require or disallow spacing between function identifiers and their invocations | @stylistic/function-call-spacing | overrides | 错误 | ✅ | — |
Enforce consistent spacing around * operators in generator functions | @stylistic/generator-star-spacing | overrides | 错误 | ✅ | — |
| Enforce consistent indentation | @stylistic/indent | overrides | 错误 | ✅ | — |
| Enforce closing bracket location in JSX | @stylistic/jsx-closing-bracket-location | overrides | 错误 | ✅ | — |
| Enforce closing tag location for multiline JSX | @stylistic/jsx-closing-tag-location | overrides | 错误 | ✅ | — |
| Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes | @stylistic/jsx-curly-brace-presence | overrides | 错误 | ✅ | — |
| Enforce consistent linebreaks in curly braces in JSX attributes and expressions | @stylistic/jsx-curly-newline | overrides | 错误 | ✅ | — |
| Enforce or disallow spaces inside of curly braces in JSX attributes and expressions | @stylistic/jsx-curly-spacing | overrides | 错误 | ✅ | — |
| Enforce or disallow spaces around equal signs in JSX attributes | @stylistic/jsx-equals-spacing | overrides | 错误 | ✅ | — |
| Enforce proper position of the first property in JSX | @stylistic/jsx-first-prop-new-line | overrides | 错误 | ✅ | — |
| Enforce props indentation in JSX | @stylistic/jsx-indent-props | overrides | 错误 | ✅ | — |
| Enforce PascalCase for user-defined JSX components | @stylistic/jsx-pascal-case | overrides | 错误 | — | — |
| Enforce the consistent use of either double or single quotes in JSX attributes | @stylistic/jsx-quotes | overrides | 错误 | ✅ | — |
| Enforce whitespace in and around the JSX opening and closing brackets | @stylistic/jsx-tag-spacing | overrides | 错误 | ✅ | — |
| Disallow missing parentheses around multiline JSX | @stylistic/jsx-wrap-multilines | overrides | 错误 | ✅ | — |
| Enforce consistent spacing between property names and type annotations in types and interfaces | @stylistic/key-spacing | overrides | 错误 | ✅ | — |
| Enforce consistent spacing before and after keywords | @stylistic/keyword-spacing | overrides | 错误 | ✅ | — |
| Require or disallow an empty line between class members | @stylistic/lines-between-class-members | overrides | 错误 | ✅ | — |
| Enforce newlines between operands of ternary expressions | @stylistic/multiline-ternary | overrides | 错误 | ✅ | — |
| Enforce or disallow parentheses when invoking a constructor with no arguments | @stylistic/new-parens | overrides | 错误 | ✅ | — |
| Disallow unnecessary parentheses | @stylistic/no-extra-parens | overrides | 错误 | ✅ | — |
| Disallow leading or trailing decimal points in numeric literals | @stylistic/no-floating-decimal | overrides | 错误 | ✅ | — |
| Disallow mixed binary operators | @stylistic/no-mixed-operators | overrides | 错误 | — | — |
| Disallow mixed spaces and tabs for indentation | @stylistic/no-mixed-spaces-and-tabs | overrides | 错误 | — | — |
| Disallow multiple spaces | @stylistic/no-multi-spaces | overrides | 错误 | ✅ | — |
| Disallow multiple empty lines | @stylistic/no-multiple-empty-lines | overrides | 错误 | ✅ | — |
| Disallow all tabs | @stylistic/no-tabs | overrides | 错误 | — | — |
| Disallow trailing whitespace at the end of lines | @stylistic/no-trailing-spaces | overrides | 错误 | ✅ | — |
| Disallow whitespace before properties | @stylistic/no-whitespace-before-property | overrides | 错误 | ✅ | — |
| Enforce consistent line breaks after opening and before closing braces | @stylistic/object-curly-newline | overrides | 错误 | ✅ | — |
| Enforce consistent spacing inside braces | @stylistic/object-curly-spacing | overrides | 错误 | ✅ | — |
| Enforce placing object properties on separate lines | @stylistic/object-property-newline | overrides | 错误 | ✅ | — |
| Enforce consistent linebreak style for operators | @stylistic/operator-linebreak | overrides | 错误 | ✅ | — |
| Require or disallow padding within blocks | @stylistic/padded-blocks | overrides | 错误 | ✅ | — |
| Require quotes around object literal, type literal, interfaces and enums property names | @stylistic/quote-props | overrides | 错误 | ✅ | — |
| Enforce the consistent use of either backticks, double, or single quotes | @stylistic/quotes | overrides | 错误 | ✅ | — |
| Enforce spacing between rest and spread operators and their expressions | @stylistic/rest-spread-spacing | overrides | 错误 | ✅ | — |
| Require or disallow semicolons instead of ASI | @stylistic/semi | overrides | 错误 | ✅ | — |
| Enforce consistent spacing before and after semicolons | @stylistic/semi-spacing | overrides | 错误 | ✅ | — |
| Enforce consistent spacing before blocks | @stylistic/space-before-blocks | overrides | 错误 | ✅ | — |
| Enforce consistent spacing before function parenthesis | @stylistic/space-before-function-paren | overrides | 错误 | ✅ | — |
| Enforce consistent spacing inside parentheses | @stylistic/space-in-parens | overrides | 错误 | ✅ | — |
| Require spacing around infix operators | @stylistic/space-infix-ops | overrides | 错误 | ✅ | — |
| Enforce consistent spacing before or after unary operators | @stylistic/space-unary-ops | overrides | 错误 | ✅ | — |
Enforce consistent spacing after the // or /* in a comment | @stylistic/spaced-comment | overrides | 错误 | ✅ | — |
| Require or disallow spacing around embedded expressions of template strings | @stylistic/template-curly-spacing | overrides | 错误 | ✅ | — |
| Require or disallow spacing between template tags and their literals | @stylistic/template-tag-spacing | overrides | 错误 | ✅ | — |
Require parentheses around immediate function invocations | @stylistic/wrap-iife | overrides | 错误 | ✅ | — |
Require or disallow spacing around the * in yield* expressions | @stylistic/yield-star-spacing | overrides | 错误 | ✅ | — |