Skip to content

全部规则

本页由配置自动生成,列出每一层启用的全部规则。具体规则的 ❌/✅ 示例见各规则层页面。

  • 配置方式:控制该规则的 lintspec() 选项;基线层规则只能通过 overrides 调整。
  • 修复 / 建议:✅ 修复 = 可通过 eslint --fix 自动修复;✅ 建议 = 在编辑器中提供修复建议。
  • 级别错误 报错并阻断;警告 仅提示。

基线层(87)

规则名称规则配置方式级别修复建议
数组回调需返回值array-callback-returnoverrides错误
构造函数须调用 super()constructor-superoverrides错误
default 置于最后default-case-lastoverrides错误
严格相等eqeqeqoverrides错误
for 计数方向正确for-directionoverrides错误
getter 须返回值getter-returnoverrides错误
存取器成对相邻grouped-accessor-pairsoverrides错误
文件最大行数max-linesmaxLines警告
禁用 alertno-alertoverrides错误
禁止 async Promise executorno-async-promise-executoroverrides错误
禁止循环内 awaitno-await-in-loopoverrides警告
禁止 case 内声明no-case-declarationsoverrides错误
禁止重写类no-class-assignoverrides错误
禁止与 -0 比较no-compare-neg-zerooverrides错误
禁止条件中赋值no-cond-assignoverrides错误
禁止重写 constno-const-assignoverrides错误
禁止无效的常量运算no-constant-binary-expressionoverrides错误
禁止常量条件no-constant-conditionoverrides错误
禁止构造函数返回值no-constructor-returnoverrides错误
禁用 debuggerno-debuggeroverrides错误
禁止 delete 变量no-delete-varoverrides错误
禁止重复函数参数no-dupe-argsoverrides错误
禁止重复类成员no-dupe-class-membersoverrides错误
禁止重复的 else-if 条件no-dupe-else-ifoverrides错误
禁止重复对象键no-dupe-keysoverrides错误
禁止重复 caseno-duplicate-caseoverrides错误
禁止重复导入no-duplicate-importsoverrides错误
禁止空代码块no-emptyoverrides错误
禁止空字符类no-empty-character-classoverrides错误
禁止空解构no-empty-patternoverrides错误
禁止空静态块no-empty-static-blockoverrides错误
禁用 evalno-evaloverrides错误
禁止重写异常参数no-ex-assignoverrides错误
禁止扩展原生类型no-extend-nativeoverrides错误
禁止多余的 bindno-extra-bindoverrides错误
禁止 case 穿透no-fallthroughoverrides错误
禁止重写函数声明no-func-assignoverrides错误
禁止改写全局对象no-global-assignoverrides错误
禁止隐式 evalno-implied-evaloverrides错误
禁止给导入赋值no-import-assignoverrides错误
禁止异常空白字符no-irregular-whitespaceoverrides错误
禁止精度丢失的数字no-loss-of-precisionoverrides错误
禁止误导性字符类no-misleading-character-classoverrides错误
禁止 Function 构造函数no-new-funcoverrides错误
禁止 new 非构造函数no-new-native-nonconstructoroverrides错误
禁止把全局对象当函数调用no-obj-callsoverrides错误
禁止 Promise executor 返回值no-promise-executor-returnoverrides错误
禁止直接调用 Object.prototype 方法no-prototype-builtinsoverrides错误
禁止重复声明no-redeclareoverrides错误
禁止正则中多个空格no-regex-spacesoverrides错误
禁止自我赋值no-self-assignoverrides错误
禁止自我比较no-self-compareoverrides错误
禁止 setter 返回值no-setter-returnoverrides错误
禁止稀疏数组no-sparse-arraysoverrides错误
禁止普通字符串中的模板占位符no-template-curly-in-stringoverrides错误
禁止 super() 前用 thisno-this-before-superoverrides错误
禁止抛出字面量no-throw-literaloverrides错误
禁止未声明变量no-undefoverrides错误
禁止易混淆的多行表达式no-unexpected-multilineoverrides错误
禁止未修改的循环条件no-unmodified-loop-conditionoverrides警告
禁止多余的三元no-unneeded-ternaryoverrides错误
禁止不可达代码no-unreachableoverrides错误
禁止只执行一次的循环no-unreachable-loopoverrides错误
禁止 finally 中的控制流no-unsafe-finallyoverrides错误
禁止关系运算符左侧取反no-unsafe-negationoverrides错误
禁止不安全的可选链no-unsafe-optional-chainingoverrides错误
禁止未使用的私有成员no-unused-private-class-membersoverrides错误
禁止未使用变量no-unused-varsoverrides警告
禁止先使用后定义no-use-before-defineoverrides错误
禁止无用赋值no-useless-assignmentoverrides错误
禁止无用的正则反向引用no-useless-backreferenceoverrides错误
禁止多余的 call/applyno-useless-calloverrides错误
禁止多余的 catchno-useless-catchoverrides错误
禁止多余的字符串拼接no-useless-concatoverrides错误
禁止多余的转义no-useless-escapeoverrides错误
禁止无意义的重命名no-useless-renameoverrides错误
禁用 varno-varoverrides错误
对象简写object-shorthandoverrides错误
优先 constprefer-constoverrides错误
优先 Object.hasOwnprefer-object-has-ownoverrides错误
reject 须用 Errorprefer-promise-reject-errorsoverrides错误
优先剩余参数prefer-rest-paramsoverrides错误
优先展开运算符prefer-spreadoverrides错误
async 须含 awaitrequire-awaitoverrides警告
用 isNaN 判断 NaNuse-isnanoverrides错误
typeof 比较有效字符串valid-typeofoverrides错误
禁止 Yoda 条件yodaoverrides错误

unicorn(159)

规则名称规则配置方式级别修复建议
优先更好的 DOM 遍历 APIunicorn/better-dom-traversingunicorn错误
catch 参数名约定unicorn/catch-error-nameunicorn错误
一致的断言风格unicorn/consistent-assertunicorn错误
一致的复合词拼写unicorn/consistent-compound-wordsunicorn错误
一致的 Date 克隆unicorn/consistent-date-cloneunicorn错误
一致的空数组展开类型unicorn/consistent-empty-array-spreadunicorn错误
一致的索引存在性检查unicorn/consistent-existence-index-checkunicorn错误
函数提到最高作用域unicorn/consistent-function-scopingunicorn错误
一致的 JSON 文件读取unicorn/consistent-json-file-readunicorn错误
一致的模板字面量转义unicorn/consistent-template-literal-escapeunicorn错误
一致的 dataset 访问unicorn/dom-node-datasetunicorn错误
大括号内无空格unicorn/empty-brace-spacesunicorn错误
创建错误须带 messageunicorn/error-messageunicorn错误
转义序列大小写一致unicorn/escape-caseunicorn错误
TODO 须带过期条件unicorn/expiring-todo-commentsunicorn错误
显式比较 length/sizeunicorn/explicit-length-checkunicorn错误
模块导入风格约定unicorn/import-styleunicorn错误
隔离函数禁用外部变量unicorn/isolated-functionsunicorn错误
内置对象须用 newunicorn/new-for-builtinsunicorn错误
禁止滥用 eslint-disableunicorn/no-abusive-eslint-disableunicorn错误
禁止存取器中递归访问 thisunicorn/no-accessor-recursionunicorn错误
禁止匿名默认导出unicorn/no-anonymous-default-exportunicorn错误
禁止直接传函数引用给迭代方法unicorn/no-array-callback-referenceunicorn错误
禁止用引用值作 fill 值unicorn/no-array-fill-with-reference-typeunicorn错误
优先 for…of 替代 forEachunicorn/no-array-for-eachunicorn错误
禁止 Array.from 后 fillunicorn/no-array-from-fillunicorn错误
禁止数组方法的 this 参数unicorn/no-array-method-this-argumentunicorn错误
优先 toReversedunicorn/no-array-reverseunicorn错误
优先 toSortedunicorn/no-array-sortunicorn错误
禁止 await 表达式成员访问unicorn/no-await-expression-memberunicorn错误
禁止 Promise 方法参数中 awaitunicorn/no-await-in-promise-methodsunicorn错误
禁止多余的 Blob 转 Fileunicorn/no-blob-to-fileunicorn错误
优先直接绘制 canvasunicorn/no-canvas-to-imageunicorn错误
禁止易混淆的 splice 用法unicorn/no-confusing-array-spliceunicorn错误
禁止 console 参数首尾空格unicorn/no-console-spacesunicorn错误
禁止直接用 document.cookieunicorn/no-document-cookieunicorn错误
禁止 Set 中重复值unicorn/no-duplicate-set-valuesunicorn错误
禁止空文件unicorn/no-empty-fileunicorn错误
禁止脚本中 exportunicorn/no-exports-in-scriptsunicorn错误
禁止可改写为 for-of 的循环unicorn/no-for-loopunicorn错误
优先 Unicode 转义unicorn/no-hex-escapeunicorn错误
禁止赋值后立即修改unicorn/no-immediate-mutationunicorn错误
禁止错误的 querySelectorunicorn/no-incorrect-query-selectorunicorn错误
禁止对内置对象用 instanceofunicorn/no-instanceof-builtinsunicorn错误
禁止无效的 fetch 选项unicorn/no-invalid-fetch-optionsunicorn错误
禁止无效的 removeEventListenerunicorn/no-invalid-remove-event-listenerunicorn错误
禁止事件后访问 currentTargetunicorn/no-late-current-target-accessunicorn错误
禁止孤立的 ifunicorn/no-lonely-ifunicorn错误
禁止 flat 的魔法深度值unicorn/no-magic-array-flat-depthunicorn错误
禁止默认导入具名化unicorn/no-named-defaultunicorn错误
禁止否定条件unicorn/no-negated-conditionunicorn错误
禁止相等判断中取反unicorn/no-negation-in-equality-checkunicorn错误
禁止 new Array()unicorn/no-new-arrayunicorn错误
禁止 new Buffer()unicorn/no-new-bufferunicorn错误
禁止对象作默认参数unicorn/no-object-as-default-parameterunicorn错误
禁止 process.exit()unicorn/no-process-exitunicorn错误
禁止单元素数组传 Promise 方法unicorn/no-single-promise-in-promise-methodsunicorn错误
禁止纯静态类unicorn/no-static-only-classunicorn错误
禁止 then 属性unicorn/no-thenableunicorn错误
禁止把 this 赋给变量unicorn/no-this-assignmentunicorn错误
禁止类外使用 thisunicorn/no-this-outside-of-classunicorn错误
禁止 typeof 判断 undefinedunicorn/no-typeof-undefinedunicorn错误
禁止 flat(1) 多余深度unicorn/no-unnecessary-array-flat-depthunicorn错误
禁止 splice 多余的删除数unicorn/no-unnecessary-array-splice-countunicorn错误
禁止 await 非 Promiseunicorn/no-unnecessary-awaitunicorn错误
禁止多余的嵌套三元unicorn/no-unnecessary-nested-ternaryunicorn错误
禁止多余的 polyfillunicorn/no-unnecessary-polyfillsunicorn错误
禁止 slice 多余的结束参数unicorn/no-unnecessary-slice-endunicorn错误
禁止难读的数组解构unicorn/no-unreadable-array-destructuringunicorn错误
禁止难读的 IIFEunicorn/no-unreadable-iifeunicorn错误
禁止忽略数组方法返回值unicorn/no-unused-array-method-returnunicorn错误
禁止集合中无用的值/回退unicorn/no-useless-collection-argumentunicorn错误
禁止多余的 captureStackTraceunicorn/no-useless-error-capture-stack-traceunicorn错误
禁止展开中无用的回退unicorn/no-useless-fallback-in-spreadunicorn错误
禁止多余的迭代器 toArrayunicorn/no-useless-iterator-to-arrayunicorn错误
禁止无用的 length 检查unicorn/no-useless-length-checkunicorn错误
禁止多余的 Promise.resolve/rejectunicorn/no-useless-promise-resolve-rejectunicorn错误
禁止多余的展开unicorn/no-useless-spreadunicorn错误
禁止无用的 switch caseunicorn/no-useless-switch-caseunicorn错误
禁止无用的 undefinedunicorn/no-useless-undefinedunicorn错误
禁止多余的小数零unicorn/no-zero-fractionsunicorn错误
数字字面量大小写unicorn/number-literal-caseunicorn错误
数字分隔符风格unicorn/numeric-separators-styleunicorn错误
优先 addEventListenerunicorn/prefer-add-event-listenerunicorn错误
优先 findunicorn/prefer-array-findunicorn错误
优先 Array#flatunicorn/prefer-array-flatunicorn错误
优先 flatMapunicorn/prefer-array-flat-mapunicorn错误
优先 indexOfunicorn/prefer-array-index-ofunicorn错误
优先末尾导向的数组方法unicorn/prefer-array-last-methodsunicorn错误
优先 someunicorn/prefer-array-someunicorn错误
优先 .at()unicorn/prefer-atunicorn错误
优先 BigInt 字面量unicorn/prefer-bigint-literalsunicorn错误
优先 Blob 读取方法unicorn/prefer-blob-reading-methodsunicorn错误
优先类字段声明unicorn/prefer-class-fieldsunicorn错误
优先 classList.toggleunicorn/prefer-classlist-toggleunicorn错误
优先 codePointAtunicorn/prefer-code-pointunicorn错误
优先 Date.now()unicorn/prefer-date-nowunicorn错误
优先默认参数unicorn/prefer-default-parametersunicorn错误
优先 appendunicorn/prefer-dom-node-appendunicorn错误
优先 removeunicorn/prefer-dom-node-removeunicorn错误
优先 textContentunicorn/prefer-dom-node-text-contentunicorn错误
优先 EventTargetunicorn/prefer-event-targetunicorn错误
优先 export…fromunicorn/prefer-export-fromunicorn错误
优先 getOrInsertComputedunicorn/prefer-get-or-insert-computedunicorn错误
优先 globalThisunicorn/prefer-global-thisunicorn错误
优先 HTTPSunicorn/prefer-httpsunicorn错误
优先 includesunicorn/prefer-includesunicorn错误
优先 includes 替代重复比较unicorn/prefer-includes-over-repeated-comparisonsunicorn错误
toArray 置于链尾unicorn/prefer-iterator-to-array-at-endunicorn错误
优先 KeyboardEvent#keyunicorn/prefer-keyboard-event-keyunicorn错误
优先逻辑运算符替代三元unicorn/prefer-logical-operator-over-ternaryunicorn错误
优先 Math.absunicorn/prefer-math-absunicorn错误
优先 Math.min/maxunicorn/prefer-math-min-maxunicorn错误
优先 Math.truncunicorn/prefer-math-truncunicorn错误
优先现代 DOM APIunicorn/prefer-modern-dom-apisunicorn错误
优先现代 Math APIunicorn/prefer-modern-math-apisunicorn错误
优先 ESM 模块unicorn/prefer-moduleunicorn错误
优先原生强制转换函数unicorn/prefer-native-coercion-functionsunicorn错误
优先负索引unicorn/prefer-negative-indexunicorn错误
优先 node: 协议unicorn/prefer-node-protocolunicorn错误
优先 Number 静态属性unicorn/prefer-number-propertiesunicorn错误
优先 Object.fromEntriesunicorn/prefer-object-from-entriesunicorn错误
优先省略 catch 参数unicorn/prefer-optional-catch-bindingunicorn错误
优先借用原型方法unicorn/prefer-prototype-methodsunicorn错误
优先 querySelectorunicorn/prefer-query-selectorunicorn错误
优先 queueMicrotaskunicorn/prefer-queue-microtaskunicorn错误
优先 Reflect.applyunicorn/prefer-reflect-applyunicorn错误
优先 RegExp#testunicorn/prefer-regexp-testunicorn错误
优先 Response.jsonunicorn/prefer-response-static-jsonunicorn错误
优先 Set#hasunicorn/prefer-set-hasunicorn错误
优先 Set#sizeunicorn/prefer-set-sizeunicorn错误
简单条件前置unicorn/prefer-simple-condition-firstunicorn错误
合并多次调用unicorn/prefer-single-callunicorn错误
split 带 limitunicorn/prefer-split-limitunicorn错误
优先展开运算符unicorn/prefer-spreadunicorn错误
优先 matchAllunicorn/prefer-string-match-allunicorn错误
优先 padStart/padEndunicorn/prefer-string-pad-start-endunicorn错误
优先 String.rawunicorn/prefer-string-rawunicorn错误
优先 repeatunicorn/prefer-string-repeatunicorn错误
优先 replaceAllunicorn/prefer-string-replace-allunicorn错误
优先 sliceunicorn/prefer-string-sliceunicorn错误
优先 startsWith/endsWithunicorn/prefer-string-starts-ends-withunicorn错误
优先 trimStart/trimEndunicorn/prefer-string-trim-start-endunicorn错误
优先 structuredCloneunicorn/prefer-structured-cloneunicorn错误
优先 switchunicorn/prefer-switchunicorn错误
优先三元unicorn/prefer-ternaryunicorn错误
类型检查抛 TypeErrorunicorn/prefer-type-errorunicorn错误
相对 URL 风格unicorn/relative-url-styleunicorn错误
join 须带分隔符unicorn/require-array-join-separatorunicorn错误
CSS 插值须用 CSS.escapeunicorn/require-css-escapeunicorn错误
须带模块属性unicorn/require-module-attributesunicorn错误
导入导出须有具名列表unicorn/require-module-specifiersunicorn错误
toFixed 须带位数unicorn/require-number-to-fixed-digits-argumentunicorn错误
高频事件须被动监听unicorn/require-passive-eventsunicorn错误
case 大括号风格unicorn/switch-case-bracesunicorn错误
case 中 break 位置unicorn/switch-case-break-positionunicorn错误
模板字符串缩进unicorn/template-indentunicorn错误
文本编码标识大小写unicorn/text-encoding-identifier-caseunicorn错误
创建错误须用 newunicorn/throw-new-errorunicorn错误

TypeScript(27)

规则名称规则配置方式级别修复建议
限制 @ts 注释@typescript-eslint/ban-ts-commenttypescript错误
一致的类型导入@typescript-eslint/consistent-type-importstypescript错误
命名约定@typescript-eslint/naming-conventiontypescript错误
禁止 Array 构造函数@typescript-eslint/no-array-constructortypescript错误
禁止重复枚举值@typescript-eslint/no-duplicate-enum-valuestypescript错误
禁止空对象类型@typescript-eslint/no-empty-object-typetypescript错误
禁止显式 any@typescript-eslint/no-explicit-anytypescript错误
禁止多余的非空断言@typescript-eslint/no-extra-non-null-assertiontypescript错误
顶层 import type@typescript-eslint/no-import-type-side-effectstypescript错误
正确定义 new/constructor@typescript-eslint/no-misused-newtypescript错误
禁止 namespace@typescript-eslint/no-namespacetypescript错误
禁止可选链后非空断言@typescript-eslint/no-non-null-asserted-optional-chaintypescript错误
禁止 require@typescript-eslint/no-require-importstypescript警告
禁止 this 别名@typescript-eslint/no-this-aliastypescript错误
禁止多余的类型约束@typescript-eslint/no-unnecessary-type-constrainttypescript错误
禁止不安全的声明合并@typescript-eslint/no-unsafe-declaration-mergingtypescript错误
禁止不安全的 Function 类型@typescript-eslint/no-unsafe-function-typetypescript错误
禁止未使用的表达式@typescript-eslint/no-unused-expressionstypescript错误
禁止未使用变量@typescript-eslint/no-unused-varstypescript错误
禁止包装对象类型@typescript-eslint/no-wrapper-object-typestypescript错误
优先 as const@typescript-eslint/prefer-as-consttypescript错误
优先 namespace 关键字@typescript-eslint/prefer-namespace-keywordtypescript错误
限制三斜线指令@typescript-eslint/triple-slash-referencetypescript错误
禁用 varno-vartypescript错误
优先 constprefer-consttypescript错误
优先剩余参数prefer-rest-paramstypescript错误
优先展开运算符prefer-spreadtypescript错误

import-x(8)

规则名称规则配置方式级别修复建议
校验默认导入存在import-x/defaultimportX错误
禁止无效导出import-x/exportimportX错误
导入后缀一致import-x/extensionsimportX.extensions错误
校验命名空间导入import-x/namespaceimportX错误
禁止重复导入import-x/no-duplicatesimportX警告
禁止具名当默认导入import-x/no-named-as-defaultimportX警告
禁止具名当默认成员import-x/no-named-as-default-memberimportX警告
禁止无法解析的导入import-x/no-unresolvedimportX错误

perfectionist(22)

规则名称规则配置方式级别修复建议
includes 数组排序perfectionist/sort-array-includesperfectionist错误
类成员排序perfectionist/sort-classesperfectionist错误
装饰器排序perfectionist/sort-decoratorsperfectionist错误
枚举排序perfectionist/sort-enumsperfectionist错误
导出属性排序perfectionist/sort-export-attributesperfectionist错误
导出排序perfectionist/sort-exportsperfectionist错误
继承子句排序perfectionist/sort-heritage-clausesperfectionist错误
导入属性排序perfectionist/sort-import-attributesperfectionist错误
导入排序perfectionist/sort-importsperfectionist.sort错误
接口属性排序perfectionist/sort-interfacesperfectionist错误
交叉类型排序perfectionist/sort-intersection-typesperfectionist错误
JSX 属性排序perfectionist/sort-jsx-propsperfectionist错误
Map 排序perfectionist/sort-mapsperfectionist错误
模块排序perfectionist/sort-modulesperfectionist错误
具名导出排序perfectionist/sort-named-exportsperfectionist错误
具名导入排序perfectionist/sort-named-importsperfectionist错误
对象类型排序perfectionist/sort-object-typesperfectionist错误
对象键排序perfectionist/sort-objectsperfectionist错误
Set 排序perfectionist/sort-setsperfectionist错误
switch 分支排序perfectionist/sort-switch-caseperfectionist错误
联合类型排序perfectionist/sort-union-typesperfectionist错误
变量声明排序perfectionist/sort-variable-declarationsperfectionist错误

React(66)

规则名称规则配置方式级别修复建议
禁用 dangerouslySetInnerHTML@eslint-react/dom-no-dangerously-set-innerhtmlreact警告
禁止 innerHTML 与 children 并存@eslint-react/dom-no-dangerously-set-innerhtml-with-childrenreact错误
禁用 findDOMNode@eslint-react/dom-no-find-dom-nodereact错误
禁用 flushSync@eslint-react/dom-no-flush-syncreact错误
用 hydrateRoot 替代 hydrate@eslint-react/dom-no-hydratereact错误
用 createRoot 替代 render@eslint-react/dom-no-renderreact错误
禁止使用 render 返回值@eslint-react/dom-no-render-return-valuereact错误
禁止 javascript: URL@eslint-react/dom-no-script-urlreact警告
禁止不安全的 iframe sandbox@eslint-react/dom-no-unsafe-iframe-sandboxreact警告
用 useActionState 替代 useFormState@eslint-react/dom-no-use-form-statereact错误
禁止空元素带 children@eslint-react/dom-no-void-elements-with-childrenreact错误
用错误边界替代 try/catch@eslint-react/error-boundariesreact错误
Hook 依赖完整@eslint-react/exhaustive-depsreact警告
禁止 children 作属性@eslint-react/jsx-no-children-propreact警告
禁止 children 属性与子节点并存@eslint-react/jsx-no-children-prop-with-childrenreact错误
禁止 JSX 文本中的注释@eslint-react/jsx-no-comment-textnodesreact警告
禁止展开后再写 key@eslint-react/jsx-no-key-after-spreadreact错误
禁止 JSX 中泄漏的 $@eslint-react/jsx-no-leaked-dollarreact警告
禁止 JSX 中泄漏的分号@eslint-react/jsx-no-leaked-semicolonreact警告
禁止 JSX 命名空间语法@eslint-react/jsx-no-namespacereact错误
Context 命名约定@eslint-react/naming-convention-context-namereact警告
useId 命名约定@eslint-react/naming-convention-id-namereact警告
useRef 命名约定@eslint-react/naming-convention-ref-namereact警告
禁止 setState 中访问 state@eslint-react/no-access-state-in-setstatereact错误
禁止用数组下标作 key@eslint-react/no-array-index-keyreact警告
禁用 Children.count@eslint-react/no-children-countreact警告
禁用 Children.forEach@eslint-react/no-children-for-eachreact警告
禁用 Children.map@eslint-react/no-children-mapreact警告
禁用 Children.only@eslint-react/no-children-onlyreact警告
禁用 Children.toArray@eslint-react/no-children-to-arrayreact警告
禁用 cloneElement@eslint-react/no-clone-elementreact警告
禁用 componentWillMount@eslint-react/no-component-will-mountreact错误
禁用 componentWillReceiveProps@eslint-react/no-component-will-receive-propsreact错误
禁用 componentWillUpdate@eslint-react/no-component-will-updatereact错误
用 <Context> 替代 Provider@eslint-react/no-context-providerreact警告
禁用 createRef@eslint-react/no-create-refreact错误
禁止直接修改 state@eslint-react/no-direct-mutation-statereact错误
用 ref 属性替代 forwardRef@eslint-react/no-forward-refreact警告
列表须有 key@eslint-react/no-missing-keyreact错误
禁止嵌套定义组件@eslint-react/no-nested-component-definitionsreact错误
禁止嵌套 lazy 组件@eslint-react/no-nested-lazy-component-declarationsreact错误
禁止 didMount 中 setState@eslint-react/no-set-state-in-component-did-mountreact警告
禁止 didUpdate 中 setState@eslint-react/no-set-state-in-component-did-updatereact警告
禁止 willUpdate 中 setState@eslint-react/no-set-state-in-component-will-updatereact警告
use 前缀须用 Hook@eslint-react/no-unnecessary-use-prefixreact警告
警告 UNSAFE_componentWillMount@eslint-react/no-unsafe-component-will-mountreact警告
警告 UNSAFE_componentWillReceiveProps@eslint-react/no-unsafe-component-will-receive-propsreact警告
警告 UNSAFE_componentWillUpdate@eslint-react/no-unsafe-component-will-updatereact警告
禁止未使用的类成员@eslint-react/no-unused-class-component-membersreact警告
用 use 替代 useContext@eslint-react/no-use-contextreact警告
组件/Hook 须为纯函数@eslint-react/purityreact警告
校验 RSC 函数定义@eslint-react/rsc-function-definitionreact错误
Hook 规则@eslint-react/rules-of-hooksreact错误
禁止 effect 中同步 setState@eslint-react/set-state-in-effectreact警告
禁止 render 中 setState@eslint-react/set-state-in-renderreact错误
组件须稳定不重建@eslint-react/static-componentsreact错误
禁止 Compiler 不支持的语法@eslint-react/unsupported-syntaxreact错误
useMemo 须返回值@eslint-react/use-memoreact错误
正确使用 useState@eslint-react/use-statereact警告
事件监听须清理@eslint-react/web-api-no-leaked-event-listenerreact警告
fetch 须可中止@eslint-react/web-api-no-leaked-fetchreact警告
IntersectionObserver 须断开@eslint-react/web-api-no-leaked-intersection-observerreact警告
setInterval 须清理@eslint-react/web-api-no-leaked-intervalreact警告
ResizeObserver 须断开@eslint-react/web-api-no-leaked-resize-observerreact警告
setTimeout 须清理@eslint-react/web-api-no-leaked-timeoutreact警告
Hook 依赖完整react-hooks/exhaustive-depsreact警告

Vue(118)

规则名称规则配置方式级别修复建议
属性名连字符风格vue/attribute-hyphenationvue警告
属性顺序vue/attributes-ordervue警告
顶层块顺序vue/block-ordervue警告
支持模板注释指令vue/comment-directivevue错误
组件定义名大小写vue/component-definition-name-casingvue警告
首个属性换行位置vue/first-attribute-linebreakvue警告
闭合括号前换行vue/html-closing-bracket-newlinevue警告
闭合括号前空格vue/html-closing-bracket-spacingvue警告
结束标签风格vue/html-end-tagsvue警告
模板缩进vue/html-indentvue警告
HTML 属性引号风格vue/html-quotesvue警告
自闭合风格vue/html-self-closingvue警告
标记 JSX 中使用的变量vue/jsx-uses-varsvue错误
每行最大属性数vue/max-attributes-per-linevue警告
组件名多词vue/multi-word-component-namesvue错误
多行元素内容换行vue/multiline-html-element-content-newlinevue警告
插值空格风格vue/mustache-interpolation-spacingvue警告
禁止 watch 用箭头函数vue/no-arrow-functions-in-watchvue错误
禁止 computed 中异步vue/no-async-in-computed-propertiesvue错误
禁止被指令覆盖的子内容vue/no-child-contentvue错误
禁止 data 中访问 computedvue/no-computed-properties-in-datavue错误
禁止废弃的 data 对象声明vue/no-deprecated-data-object-declarationvue错误
禁止废弃的 $delete/$setvue/no-deprecated-delete-setvue错误
禁止废弃的 destroyed 钩子vue/no-deprecated-destroyed-lifecyclevue错误
禁止废弃的 $listenersvue/no-deprecated-dollar-listeners-apivue错误
禁止废弃的 $scopedSlotsvue/no-deprecated-dollar-scopedslots-apivue错误
禁止废弃的事件 APIvue/no-deprecated-events-apivue错误
禁止废弃的过滤器语法vue/no-deprecated-filtervue错误
禁止废弃的 functional 模板vue/no-deprecated-functional-templatevue错误
禁止 HTML 元素上废弃的 isvue/no-deprecated-html-element-isvue错误
禁止废弃的 inline-templatevue/no-deprecated-inline-templatevue错误
禁止废弃的 model 定义vue/no-deprecated-model-definitionvue错误
禁止 props 默认函数中的 thisvue/no-deprecated-props-default-thisvue错误
禁止 RouterLink 废弃的 tagvue/no-deprecated-router-link-tag-propvue错误
禁止废弃的 scope 属性vue/no-deprecated-scope-attributevue错误
禁止废弃的 slot 属性vue/no-deprecated-slot-attributevue错误
禁止废弃的 slot-scope 属性vue/no-deprecated-slot-scope-attributevue错误
禁止废弃的 .syncvue/no-deprecated-v-bind-syncvue错误
禁止废弃的 v-isvue/no-deprecated-v-isvue错误
禁止废弃的 .nativevue/no-deprecated-v-on-native-modifiervue错误
禁止废弃的按键码修饰符vue/no-deprecated-v-on-number-modifiersvue错误
禁止废弃的 Vue.config.keyCodesvue/no-deprecated-vue-config-keycodesvue错误
禁止字段名重复vue/no-dupe-keysvue错误
禁止 v-if 链重复条件vue/no-dupe-v-else-ifvue错误
禁止重复属性vue/no-duplicate-attributesvue错误
禁止 script setup 中 exportvue/no-export-in-script-setupvue错误
禁止 await 后注册 exposevue/no-expose-after-awaitvue错误
禁止 await 后注册生命周期vue/no-lifecycle-after-awaitvue错误
禁止多余的 templatevue/no-lone-templatevue警告
禁止多个空格vue/no-multi-spacesvue警告
禁止作用域插槽多参数vue/no-multiple-slot-argsvue警告
禁止修改 propsvue/no-mutating-propsvue错误
禁止模板解析错误vue/no-parsing-errorvue错误
禁止 ref 直接作操作数vue/no-ref-as-operandvue错误
有默认值的 prop 须可选vue/no-required-prop-with-defaultvue警告
禁止保留组件名vue/no-reserved-component-namesvue错误
禁止覆盖保留键vue/no-reserved-keysvue错误
禁止保留的 prop 名vue/no-reserved-propsvue错误
data 须为函数vue/no-shared-component-datavue错误
禁止 computed 中副作用vue/no-side-effects-in-computed-propertiesvue错误
禁止属性等号周围空格vue/no-spaces-around-equal-signs-in-attributevue警告
禁止 template 上的 keyvue/no-template-keyvue错误
禁止模板变量遮蔽vue/no-template-shadowvue警告
禁止 textarea 中插值vue/no-textarea-mustachevue错误
禁止未使用组件vue/no-unused-componentsvue错误
禁止未使用的模板变量vue/no-unused-varsvue错误
禁止把 computed 当方法vue/no-use-computed-property-like-methodvue错误
禁止 v-if 与 v-for 同元素vue/no-use-v-if-with-v-forvue错误
禁止 template 上无用属性vue/no-useless-template-attributesvue错误
禁止 template v-for 的 key 放子元素vue/no-v-for-template-key-on-childvue错误
禁用 v-html(防 XSS)vue/no-v-htmlvue警告
禁止组件上用 v-text/v-htmlvue/no-v-text-v-html-on-componentvue错误
禁止 await 后注册 watchvue/no-watch-after-awaitvue错误
每文件一个组件vue/one-component-per-filevue警告
组件选项顺序vue/order-in-componentsvue警告
优先从 vue 导入vue/prefer-import-from-vuevue错误
prop 名大小写vue/prop-name-casingvue警告
<component> 须有 :isvue/require-component-isvue错误
prop 须有默认值vue/require-default-propvue警告
须显式声明 emitsvue/require-explicit-emitsvue警告
prop 类型须为构造函数vue/require-prop-type-constructorvue错误
prop 须有类型vue/require-prop-typesvue警告
render 须返回值vue/require-render-returnvue错误
$slots 须作为函数调用vue/require-slots-as-functionsvue错误
transition 内须控制显示vue/require-toggle-inside-transitionvue错误
v-for 须有 keyvue/require-v-for-keyvue错误
prop 默认值须有效vue/require-valid-default-propvue错误
computed 须有 returnvue/return-in-computed-propertyvue错误
emits 校验器须有 returnvue/return-in-emits-validatorvue错误
单行元素内容换行vue/singleline-html-element-content-newlinevue警告
禁止模板中用 thisvue/this-in-templatevue警告
v-on 须用 exact 修饰符vue/use-v-on-exactvue错误
v-bind 写法风格vue/v-bind-stylevue警告
v-on 事件名连字符风格vue/v-on-event-hyphenationvue警告
v-on 写法风格vue/v-on-stylevue警告
v-slot 写法风格vue/v-slot-stylevue警告
属性名须有效vue/valid-attribute-namevue错误
defineEmits 须有效vue/valid-define-emitsvue错误
defineOptions 须有效vue/valid-define-optionsvue错误
defineProps 须有效vue/valid-define-propsvue错误
nextTick 调用须有效vue/valid-next-tickvue错误
模板根须有效vue/valid-template-rootvue错误
v-bind 须有效vue/valid-v-bindvue错误
v-cloak 须有效vue/valid-v-cloakvue错误
v-else 须有效vue/valid-v-elsevue错误
v-else-if 须有效vue/valid-v-else-ifvue错误
v-for 须有效vue/valid-v-forvue错误
v-html 须有效vue/valid-v-htmlvue错误
v-if 须有效vue/valid-v-ifvue错误
v-is 须有效vue/valid-v-isvue错误
v-memo 须有效vue/valid-v-memovue错误
v-model 须有效vue/valid-v-modelvue错误
v-on 须有效vue/valid-v-onvue错误
v-once 须有效vue/valid-v-oncevue错误
v-pre 须有效vue/valid-v-prevue错误
v-show 须有效vue/valid-v-showvue错误
v-slot 须有效vue/valid-v-slotvue错误
v-text 须有效vue/valid-v-textvue错误