规则支持状态

本文档跟踪 utoo-lint 当前已实现的 ESLint 兼容规则。 每条规则均链接到对应的 ESLint 规则参考文档。 支持自动修复的规则会特别注明;对于不安全的代码形态,仍会报告诊断,而不会重写代码。

规则状态
accessor-pairs支持 setWithoutGet、getWithoutSet 和 enforceForClassMembers 配置
array-callback-return已实现可选的 allowImplicit、checkForEach 和 allowVoid 行为
arrow-body-style支持 always、as-needed、never 和 requireReturnForObjectLiteral,并提供对注释、优先级和 ASI 安全的自动修复
block-scoped-var已实现
camelcase支持声明、导入、可选属性检查、ignoreDestructuring、ignoreImports、轻量级 allow 模式,并会解析 ignoreGlobals 以兼容迁移
capitalized-comments支持 always、never、ignoreInlineComments 和 ignoreConsecutiveComments 配置,并支持自动修复
class-methods-use-this支持方法、访问器、以函数为值的类字段,以及 exceptMethods、enforceForClassFields、ignoreOverrideMethods 和 ignoreClassesWithImplements 配置
complexity支持 max、已弃用的 maximum、classic 和 modified 变体,以及函数、箭头函数和静态块
consistent-return已实现对显式返回值与空返回混用,以及可能执行到底部的值返回函数的检查
consistent-this支持为直接捕获 this 配置别名,并检查同一作用域内的延迟赋值
constructor-super已实现
curly支持 all、multi-line、multi 和 multi-or-nest 配置;可在保留注释的同时稳定地自动添加或删除代码块,并拒绝存在 ASI 或悬空 else 风险的修复
default-case已实现常见的 commentPattern 行为
default-case-last已实现
default-param-last已实现
dot-notation支持自动修复、allowKeywords 及常见的 allowPattern 配置
eol-last支持 always、never、unix 和 windows 配置,并支持自动修复
eqeqeq支持 always、allow-null、smart 及 null: always/ignore/never 配置,并提供安全的自动修复
for-direction已实现
func-name-matching支持 always、never、includeCommonJSModuleExports 和 considerPropertyDescriptor 配置
func-names支持 always、as-needed、never 和 generators 配置
func-style支持声明式和表达式式风格、allowArrowFunctions 以及 overrides.namedExports
getter-return支持可选的 allowImplicit 行为
grouped-accessor-pairs已实现 anyOrder、getBeforeSet 和 setBeforeGet 选项
guard-for-in已实现
id-denylist支持配置受限标识符、私有标识符、成员写入检查,并跳过已重命名的导入和导出
id-length对绑定、导入、函数及类/对象属性支持 min、max、exceptions、常见 exceptionPatterns 和 properties
id-match支持对声明和导入别名进行轻量级模式匹配,并支持 properties、classFields、onlyDeclarations 和 ignoreDestructuring 配置
init-declarations支持 always、never 和 ignoreForLoopInit
linebreak-style支持 unix 和 windows 配置,并支持自动修复
logical-assignment-operators已实现 always、可选的 never 及可选的 enforceForIfStatements: true 行为,并提供对注释、优先级和求值安全的自动修复
max-classes-per-file支持 max 和 ignoreExpressions 配置
max-depth支持 max、已弃用的 maximum、函数作用域、静态块和 else if 链
max-lines支持 max、skipBlankLines 和 skipComments 配置
max-lines-per-function支持统计函数和箭头函数的行数,以及 max、skipBlankLines、skipComments 和 IIFEs 配置
max-nested-callbacks支持 max、已弃用的 maximum,以及调用参数中的回调检测
max-params支持 max、已弃用的 maximum 和 countThis 配置
max-statements支持 max、已弃用的 maximum、ignoreTopLevelFunctions 和静态块隔离
new-cap支持 newIsCap、capIsNew、properties、例外名称和例外模式
new-parens已实现,并提供对嵌套表达式安全的自动修复
no-alert已实现对全局 this、window 和 globalThis 的检测
no-array-constructor已实现保留参数且对 ASI 安全的自动修复
no-async-promise-executor已实现
no-await-in-loop已实现
no-bitwise已实现
no-buffer-constructor已实现
no-caller已实现
no-case-declarations已实现
no-class-assign已实现
no-confusing-arrow支持 allowParens,并可在允许括号时自动修复
no-comma-operator已实现
no-compare-neg-zero已实现
no-cond-assign已实现
no-console已实现,并通过 allow 支持配置允许的 console 方法
no-const-assign已实现
no-constant-binary-expression检测恒定的逻辑/空值短路、恒定的空值/布尔比较,以及新构造对象之间的比较
no-constant-condition已实现
no-constructor-return已实现
no-continue已实现
no-control-regex已实现
no-debugger已实现
no-delete-var已实现
no-div-regex已实现并支持自动修复
no-dupe-args已实现
no-dupe-class-members已实现
no-dupe-else-if已实现
no-dupe-keys已实现
no-duplicate-case已实现
no-duplicate-imports支持 allowSeparateTypeImports 和 includeExports 配置
no-else-return已实现
no-empty已实现可选的 allowEmptyCatch 行为
no-empty-block-statements已实现
no-empty-character-class已实现
no-empty-function已实现函数、箭头函数、异步/生成器函数、方法、异步/生成器方法、getter、setter 和构造函数的 allow 行为
no-empty-pattern已实现可选的 allowObjectPatternsAsParameters 行为
no-empty-static-block已实现
no-eq-null已实现
no-eval支持 allowIndirect 配置
no-ex-assign已实现
no-extend-native支持 exceptions 配置
no-extra-bind已实现对副作用和注释安全的自动修复
no-extra-boolean-cast支持安全自动修复、enforceForInnerExpressions 及旧版 enforceForLogicalOperands 配置
no-extra-label已实现多轮自动修复,可移除冗余引用和标签声明
no-extra-semi已实现并支持自动修复
no-fallthrough支持 allowEmptyCase、常见 commentPattern 和 reportUnusedFallthroughComment 配置
no-floating-decimal已实现对 token 安全的自动修复
no-for-in已实现
no-func-assign已实现
no-global-assign支持 exceptions 配置和 languageOptions.globals(readonly 会报告写入,writable 允许写入)
no-global-is-finite已实现
no-global-is-nan已实现
no-implicit-coercion支持 boolean、number、string、allow 和 disallowTemplateShorthand 配置
no-implicit-globals支持检查脚本顶层的 var/函数,以及可选的 lexicalBindings 检查
no-implied-eval已实现对使用求值字符串参数的全局定时器及 execScript 调用的检查
no-import-assign已实现
no-inline-comments支持 ignorePattern 配置及常见的类正则模式
no-inner-declarations支持默认的 functions 模式,以及检查嵌套 var 声明的 both 模式
no-invalid-regexp已实现可选的 allowConstructorFlags 行为
no-invalid-this支持严格模式函数、模块、构造函数、显式绑定的回调、类字段和静态块、TypeScript this 参数、JSDoc @this 以及 capIsConstructor
no-irregular-whitespace已实现
no-iterator已实现
no-label-var已实现
no-labels已实现
no-lone-blocks已实现,并对块级作用域绑定作例外处理
no-lonely-if已实现并支持安全自动修复
no-loop-func已实现
no-loss-of-precision已实现
no-magic-numbers支持 detectObjects、enforceConst、ignore、ignoreArrayIndexes、ignoreDefaultValues、ignoreClassFieldInitialValues、ignoreEnums、ignoreNumericLiteralTypes、ignoreReadonlyClassProperties 和 ignoreTypeIndexes 配置
no-mixed-spaces-and-tabs支持 smart-tabs 配置
no-misleading-character-class已实现
no-multi-assign支持 ignoreNonDeclaration 配置和类字段初始化器
no-multi-spaces支持 ignoreEOLComments 和常见 exceptions 配置,并支持自动修复
no-multi-str已实现
no-multiple-empty-lines已实现可选的 max、maxBOF 和 maxEOF 行为,并支持自动修复
no-negated-condition已实现
no-nested-ternary已实现
no-new已实现
no-new-func已实现
no-new-native-nonconstructor已实现
no-new-object已实现
no-new-require已实现
no-new-symbol已实现
no-new-wrappers已实现
no-nonoctal-decimal-escape已实现
no-obj-calls已实现
no-object-constructor已实现
no-octal已实现
no-octal-escape已实现
no-param-reassign已实现可选的 props、ignorePropertyModificationsFor 及常见 ignorePropertyModificationsForRegex 行为
no-path-concat已实现
no-plusplus已实现可选的 allowForLoopAfterthoughts 行为
no-process-env已实现
no-process-exit已实现
no-promise-executor-return支持 allowVoid 配置
no-proto已实现
no-prototype-builtins已实现
no-redeclare已实现,并针对 TypeScript 感知场景回退到 @typescript-eslint/no-redeclare
no-restricted-exports支持 restrictedNamedExports 和 restrictDefaultExports
no-restricted-globals支持直接限制全局变量、自定义消息,以及可选的全局对象检查
no-restricted-imports支持受限 paths、简单 patterns、自定义消息、导入名称允许/拒绝列表、仅类型例外及再导出检查
no-restricted-modules支持受限 CommonJS require() 来源、paths、简单 patterns、否定模式和自定义消息
no-restricted-properties支持对象/属性限制、解构,以及 allowObjects/allowProperties 配置
no-restricted-syntax支持带自定义消息的轻量级 AST 节点选择器限制
no-regex-spaces已实现对字面量及静态字符串构造器的安全自动修复
no-return-assign已实现 except-parens 和可选的 always 行为
no-return-await已实现对 return 语句、异步箭头函数表达式主体和嵌套尾部表达式的检查
no-script-url已实现
no-self-assign支持 props 配置
no-self-compare已实现
no-sequences已实现可选的 allowInParentheses 行为
no-setter-return已实现
no-shadow支持 allow、builtinGlobals、hoist 和 ignoreOnInitialization 配置
no-shadow-restricted-names已实现
no-sparse-arrays已实现
no-tabs支持 allowIndentationTabs 配置
no-template-curly-in-string已实现
no-ternary已实现
no-this-before-super已实现
no-throw-literal已实现
no-trailing-spaces支持 skipBlankLines 和 ignoreComments 配置,并支持自动修复
no-undef已实现;接受 languageOptions.globals 中声明的名称,并报告被设为 off 的全局变量
no-undef-init已实现对 let 绑定安全的自动修复
no-unassigned-vars报告已被读取但没有初始化器且从未赋值的 let/var 绑定
no-underscore-dangle支持 allow、allowAfterThis、allowAfterSuper、allowAfterThisConstructor、allowFunctionParams、allowInArrayDestructuring、allowInObjectDestructuring、enforceInMethodNames 和 enforceInClassFields 配置
no-undefined已实现对标识符引用和绑定名称的检查
no-unneeded-ternary支持 defaultAssignment,并提供对优先级、副作用和注释安全的自动修复
no-unexpected-multiline报告容易混淆的多行调用、计算属性访问、标签模板以及看似正则表达式的除法链
no-unmodified-loop-condition已实现
no-unreachable已实现,并处理提升声明
no-unreachable-loop支持循环体退出检测和 ignore 配置
no-unsafe-finally已实现,并处理局部循环、switch 和标签退出
no-unsafe-negation支持 enforceForOrderingRelations 配置
no-unsafe-optional-chaining已实现对不安全成员访问、调用、构造器、标签模板、展开、迭代、解构、二元对象操作、with、类 extends 的检查,以及可选的 disallowArithmeticOperators 行为
no-unused-private-class-members已实现对私有字段、方法、访问器和静态块的检查
no-use-before-define支持 functions、classes、variables 和 allowNamedExports 配置
no-unused-expressions已实现可选的 allowShortCircuit、allowTernary 和 allowTaggedTemplates 行为
no-unused-labels已实现嵌套标签遮蔽检查,并支持自动修复
no-unused-vars支持 vars、args、caughtErrors、ignoreRestSiblings、ignoreClassWithStaticInitBlock、ignoreUsingDeclarations、reportUsedIgnorePattern,以及常见的 argsIgnorePattern/caughtErrorsIgnorePattern/destructuredArrayIgnorePattern/varsIgnorePattern 配置
no-useless-assignment实现了可感知控制流的无用赋值分析
no-useless-backreference检测正则字面量和静态 RegExp 构造器中的嵌套、前向、分支及负向环视反向引用
no-useless-call已实现
no-useless-catch已实现
no-useless-computed-key已实现可选的 enforceForClassMembers 行为,并支持自动修复
no-useless-concat已实现对连接链中相邻静态字符串和模板字面量的检查
no-useless-constructor已实现
no-useless-escape支持 allowRegexCharacters 配置及 ESLint 模板转义处理
no-useless-rename支持自动修复,以及 ignoreDestructuring、ignoreImport 和 ignoreExport 配置
no-useless-return已实现对语句列表中 return 语句的注释安全自动修复
no-var已实现作用域安全的 var 到 let 自动修复;多轮修复随后可应用 prefer-const
no-void已实现可选的 allowAsStatement 行为
no-warning-comments已实现可配置的 terms、location 和常见 decoration 行为
no-with已实现
object-shorthand支持 always、methods、properties、never、avoidQuotes、ignoreConstructors 和 avoidExplicitReturnArrows 配置,并提供对注释和语义安全的自动修复
one-var支持字符串形式的 never,以及按类型设置 var/let/const 的 never 配置,并提供对注释和上下文安全的自动修复
operator-assignment支持 always 和 never 模式,并提供安全自动修复
prefer-arrow-callback支持回调函数表达式,以及 allowNamedFunctions 和 allowUnboundThis 配置;当参数、注释和词法绑定均安全时,可自动修复匿名同步回调
prefer-const支持 destructuring 和 ignoreReadBeforeAssign 配置;仅当每个绑定都能安全改为 const 时,才会自动修复 let 声明
prefer-destructuring支持对象/数组变量声明器和赋值表达式配置,以及 enforceForRenamedProperties;当可保留注释时,会自动修复简单的同名对象属性声明
prefer-exponentiation-operator已实现并支持安全自动修复
prefer-named-capture-group检测正则字面量和静态 RegExp 构造器中的未命名捕获组
prefer-numeric-literals已实现对全局静态字符串和模板形式 parseInt 调用的自动修复,支持二进制、八进制或十六进制基数
prefer-object-has-own已实现并支持自动修复
prefer-object-spread对以新对象字面量为目标的全局 Object.assign 调用支持访问器安全、保留注释的自动修复,包括单参数调用
prefer-promise-reject-errors支持 allowEmptyReject 配置
preserve-caught-error报告 catch 块中重新抛出的内置错误:其省略或替换了捕获错误的 cause;支持 requireCatchParameter
prefer-regex-literals支持 disallowRedundantWrapping 配置
prefer-rest-params已实现
prefer-spread已实现
prefer-template已实现
radix已实现
require-await已实现
require-atomic-updates支持 allowProperties 配置
require-unicode-regexp支持正则字面量、静态 RegExp 构造器和 requireFlag 配置
require-yield已实现
sort-imports支持声明/成员排序、ignoreCase、ignoreDeclarationSort、ignoreMemberSort、allowSeparatedGroups、memberSyntaxSortOrder,以及对注释安全的具名成员自动修复
sort-keys支持对象字面量键排序,以及 asc/desc、caseSensitive、natural、minKeys 和 allowLineSeparatedGroups
sort-vars支持同一声明内的标识符排序、ignoreCase,以及对字面量初始化器保持格式的自动修复
spaced-comment支持 always、never、markers 和 exceptions 配置,并提供安全自动修复
strict支持 safe、global、function 和 never 模式,并可自动修复冗余指令
symbol-description已实现
unicode-bom支持 never 和 always 配置,并支持自动修复
use-isnan支持 enforceForIndexOf 和 enforceForSwitchCase 配置
valid-typeof支持 requireStringLiterals 配置
vars-on-top已实现
wrap-iife已实现 outside、inside 和 any 选项,并支持自动修复
yoda支持 never、always、onlyEquality 和 exceptRange 配置,并提供对注释和 token 安全的自动修复

ESLint 注释规则

规则状态
eslint-comments/no-restricted-disable支持针对已配置规则限制 disable 注释

Import 插件规则

规则状态
import/default已实现对使用 fishlint 已配置扩展名解析的相对导入的检查
import/export已实现对重复本地导出和相对 export * 的检查
import/first已实现
import/named已实现对使用 fishlint 已配置扩展名解析的相对导入的检查
import/namespace已实现对使用 fishlint 已配置扩展名解析的相对命名空间导入的检查
import/newline-after-import已实现 count、exactCount 和 considerComments 配置
import/no-amd已实现
import/no-cycle已实现对使用 fishlint 已配置扩展名解析的相对导入和再导出的检查,并支持 maxDepth(整数、"∞",或通过 JavaScript API 传入的 Infinity)、commonjs 和 amd 配置
import/no-duplicates已实现 considerQueryString 配置
import/no-named-as-default已实现对使用 fishlint 已配置扩展名解析的相对导入的检查
import/no-named-as-default-member已实现对使用 fishlint 已配置扩展名解析的相对导入的检查
import/no-unresolved已实现 fishlint 的 Node 解析器扩展名、smallfish:/minifish: 忽略、commonjs、amd 及常见 ignore 模式行为
import/no-self-import已实现对使用 fishlint 已配置扩展名解析的相对导入的检查

Jest 插件规则

规则状态
jest/no-conditional-expect已实现条件表达式、catch 子句、Promise catch 回调、内联测试回调及命名测试回调检查
jest/no-deprecated-functions已实现已安装或显式配置的 Jest 版本检测,并支持上游自动修复
jest/no-export已实现对包含 Jest 测试的文件中的 ESM、CommonJS 和 TypeScript 导出检查
jest/no-focused-tests已实现对全局、导入、别名及链式聚焦测试的检查,并提供上游编辑器建议
jest/no-identical-title已实现对同一测试套件层级中重复静态测试和套件标题的检查
jest/no-interpolation-in-snapshots已实现对内联快照模板插值的检查,包括属性匹配器重载形式
jest/no-jasmine-globals已实现 Jasmine 全局函数、成员调用、赋值、局部遮蔽和上游自动修复
jest/no-mocks-import已实现对嵌套 __mocks__ 目录中静态导入、动态导入和 CommonJS require 的检查
jest/no-standalone-expect支持测试套件、测试、钩子、辅助函数、导入 API 和 additionalTestBlockFunctions 上下文检查
jest/valid-describe-callback校验同步函数回调、意外参数和返回值,并支持别名及 describe.each
jest/valid-expect-in-promise要求测试中包含断言的 then、catch 和 finally 链被返回、等待或通过受支持的 Promise 模式消费
jest/valid-expect已实现参数数量、匹配器与修饰符校验、异步断言等待或返回检查,并支持全部上游选项
jest/valid-title支持静态及模板标题、全部上游选项、.each 格式符检查和上游安全自动修复

Promise 插件规则

规则状态
promise/always-return支持 ignoreLastCallback 和 ignoreAssignmentVariable 配置
promise/catch-or-return支持 allowThen、allowThenStrict、allowFinally,以及字符串/数组形式的 terminationMethod 配置
promise/no-callback-in-promise支持 exceptions 和 timeoutsErr 配置,包括延迟回调例外
promise/no-nesting已实现嵌套 then/catch 检测,并对最近处理器中的闭包作例外处理
promise/no-new-statics已实现所有 Promise 静态方法,并支持自动修复
promise/no-promise-in-callback已实现 exemptDeclarations 配置
promise/no-return-in-finally已实现
promise/no-return-wrap已实现 allowReject 配置
promise/param-names已实现 resolvePattern 和 rejectPattern 配置
promise/valid-params已实现 exclude 配置

JSX 无障碍规则

规则状态
jsx-a11y/alt-text支持 elements 和元素组件映射配置
jsx-a11y/anchor-has-content支持 components 配置
jsx-a11y/aria-props已实现
jsx-a11y/aria-proptypes已实现
jsx-a11y/aria-role支持 allowedInvalidRoles 和 ignoreNonDOM 配置
jsx-a11y/aria-unsupported-elements已实现
jsx-a11y/iframe-has-title已实现
jsx-a11y/img-redundant-alt支持 components 和 words 配置
jsx-a11y/no-access-key已实现
jsx-a11y/no-distracting-elements支持 elements 配置
jsx-a11y/role-has-required-aria-props已实现
jsx-a11y/role-supports-aria-props已实现
jsx-a11y/scope已实现

解析器诊断

parser-semantic-errors 报告来自 Yuku 的解析诊断,默认包括语义早期错误。它不是 ESLint 规则,因此没有对应的 ESLint 规则页面。

React 规则

规则状态
react/button-has-type支持 button、submit 和 reset 配置
react/default-props-match-prop-types支持 allowRequiredDefaults 配置
react/display-name支持 checkContextObjects 和 ignoreTranspilerName 配置
react/forbid-prop-types支持 forbid、checkContextTypes 和 checkChildContextTypes 配置
react/jsx-boolean-value已实现 never 和 always 配置 ;支持安全自动修复,保留注释
react/jsx-filename-extension支持 extensions 和 allow 配置
react/jsx-key支持 checkKeyMustBeforeSpread、checkFragmentShorthand 和 warnOnDuplicates 配置
react/jsx-no-bind支持 allowArrowFunctions、allowFunctions、allowBind、ignoreRefs 和 ignoreDOMComponents 配置
react/jsx-no-comment-textnodes已实现
react/jsx-no-duplicate-props已实现可配置的 ignoreCase 行为
react/jsx-no-undef已实现
react/jsx-uses-react已实现
react/jsx-uses-vars为兼容旧配置而接受此规则;JSX 标签始终作为语义变量引用,与 ESLint 10 一致
react/jsx-no-target-blank支持 allowReferrer、enforceDynamicLinks、warnOnSpreadAttributes、links 和 forms 配置
react/jsx-pascal-case支持 allowAllCaps、allowLeadingUnderscore、allowNamespace 和 ignore 配置
react/no-access-state-in-setstate已实现
react/no-array-index-key已实现
react/no-children-prop支持 allowFunctions 配置
react/no-danger已实现
react/no-danger-with-children已实现
react/no-deprecated已实现
react/no-direct-mutation-state已实现
react/no-find-dom-node已实现
react/no-forward-ref可选择启用的 React 19 诊断;识别来自 react 的具名、别名、默认和命名空间导入
react/no-is-mounted已实现
react/no-multi-comp支持 ignoreStateless 配置
react/no-unstable-nested-components可选择启用;支持 allowAsProps 和 propNamePattern,包括包装后的嵌套组件
react/no-redundant-should-component-update已实现
react/no-render-return-value已实现 eslint-plugin-react 默认/最新 React 版本的行为
react/no-string-refs支持 noTemplateLiterals 配置
react/no-this-in-sfc已实现
react/no-typos已实现
react/no-unescaped-entities支持 forbid 配置
react/no-unknown-property支持 ignore 和 requireDataLowercase 配置;自动修复已知 DOM 属性别名和大小写,避免生成重复属性
react/no-unused-prop-types支持 skipShapeProps、ignore 和 customValidators 配置
react/no-unused-state已实现
react/no-will-update-set-state已实现
react/prefer-es6-class支持 always 和 never 配置
react/prop-types支持 skipUndeclared、ignore 和 customValidators 配置 ;识别 React forwardRef<Ref, Props> 泛型及 memo 包装
react/require-render-return已实现
react/self-closing-comp支持 component 和 html 配置
react/style-prop-object已实现
react/void-dom-elements-no-children已实现

React Hooks 规则

规则状态
react-hooks/exhaustive-deps已实现内置 Hook 和 additionalHooks 字面量、分支、锚点及通配符模式的依赖数组验证;无需类型信息即可报告缺失、重复、不必要、复杂和不稳定的依赖
react-hooks/rules-of-hooks已实现顶层、普通函数、类方法、回调、条件分支和循环检查
react-hooks/use-memo按需开启;检查内联和可静态解析的具名 useMemo 回调的参数、async/generator 和对捕获变量的直接重赋值;允许回调内部局部变量重赋值,暂不分析嵌套闭包写入
react-hooks/void-use-memo按需开启;检查没有返回值的内联和可静态解析的具名回调,嵌套函数的 return 不计入;同时检查表达式语句中被丢弃的结果;接受显式 return(包括空 return)、表达式函数体和含 throw 的回调,暂不做全路径返回值或返回类型推断
react-hooks/purity按需开启;检查渲染、内联/具名 useMemo 和同步 IIFE 中调用全局 Math.random、Date.now、Date()、无参 new Date、crypto.randomUUID、performance.now 及其稳定别名;跳过延迟回调、惰性初始化函数和被局部变量遮蔽的全局对象
react-hooks/set-state-in-render按需开启;检查 useState setter 及其稳定别名在渲染期间被无条件调用,覆盖内联/具名 useMemo、同步 IIFE,以及正常结束的循环和分支之后的调用;跳过条件更新、可能提前退出的前置语句、重新赋值的 setter 和延迟回调

这些按需开启的规则是 React Compiler 相关检查的原生实现子集,并未运行 React Compiler 诊断引擎。 支持 ES 模块及字面量 require("react") 导入、稳定局部别名和局部变量遮蔽,通过组件/Hook 命名以及 React memo/forwardRef 包装识别渲染函数。 具名 memo 回调会关联到渲染时的调用点;暂不覆盖动态重赋值、任意跨函数调用分析以及 Compiler 的数据流和配置分析。 refs、immutability、preserve-manual-memoization、config、gating 等规则仍不支持。 用法见配置。

Unused Imports 规则

规则状态
unused-imports/no-unused-imports检测 JavaScript、TypeScript 和 TSX 中未使用的默认、具名、命名空间及仅类型绑定;自动修复会保留已使用的绑定、注释、多行语法和副作用导入

TypeScript ESLint 规则

规则状态
@typescript-eslint/adjacent-overload-signatures已实现
@typescript-eslint/array-type已实现 default: array、array-simple 和 generic 配置
@typescript-eslint/ban-ts-comment已实现指令模式和 minimumDescriptionLength
@typescript-eslint/ban-tslint-comment已实现
@typescript-eslint/ban-types支持 types 和 extendDefaults 配置
@typescript-eslint/class-literal-property-style已实现 fields 和 getters 配置
@typescript-eslint/consistent-type-assertions支持 assertionStyle,以及对象/数组字面量断言模式
@typescript-eslint/consistent-type-definitions已实现 interface 和 type 配置
@typescript-eslint/dot-notation已通过核心规则实现并支持自动修复
@typescript-eslint/explicit-member-accessibility支持 accessibility: "no-public"、"explicit" 和 "off"
@typescript-eslint/member-ordering已实现 fishlint 的默认类成员顺序
@typescript-eslint/method-signature-style已实现 fishlint 的 property 配置
@typescript-eslint/no-array-constructor已实现保留参数且对 ASI 安全的自动修复
@typescript-eslint/no-confusing-non-null-assertion已实现
@typescript-eslint/no-dupe-class-members已实现
@typescript-eslint/no-empty-function支持基础 allow 类型,以及 private-constructors、protected-constructors、decoratedFunctions 和 overrideMethods 配置
@typescript-eslint/no-empty-interface支持 allowSingleExtends 配置
@typescript-eslint/no-empty-object-type支持 allowInterfaces、allowObjectTypes 和常见的锚定 allowWithName 模式;排除交叉类型中的空对象组成部分
@typescript-eslint/no-duplicate-enum-values已实现
@typescript-eslint/no-extra-semi已实现并支持自动修复
@typescript-eslint/no-extra-non-null-assertion已实现
@typescript-eslint/no-explicit-any按配置启用;支持 ignoreRestArgs、fixToUnknown 及替换为 unknown 或 never 的编辑器建议
@typescript-eslint/no-inferrable-types支持 ignoreParameters 和 ignoreProperties 配置 ;支持安全自动修复,保留注释
@typescript-eslint/no-invalid-void-type支持 allowAsThisParameter,以及布尔值/字符串列表形式的 allowInGenericTypeArguments 配置
@typescript-eslint/no-loop-func已实现 TypeScript 循环捕获检查;禁用时回退到核心 no-loop-func
@typescript-eslint/no-loss-of-precision已实现
@typescript-eslint/no-misused-new已实现
@typescript-eslint/no-namespace已实现 allowDeclarations 和 allowDefinitionFiles 配置
@typescript-eslint/no-non-null-asserted-optional-chain已实现
@typescript-eslint/no-redeclare支持 builtinGlobals 和 ignoreDeclarationMerge 配置
@typescript-eslint/no-require-imports支持 allow 和 allowAsImport 配置
@typescript-eslint/no-shadow支持 allow、builtinGlobals、hoist、ignoreOnInitialization、ignoreTypeValueShadow 和 ignoreFunctionTypeParameterNameValueShadow 配置
@typescript-eslint/no-this-alias支持 allowedNames 和 allowDestructuring 配置
@typescript-eslint/no-unsafe-declaration-merging已实现
@typescript-eslint/no-unsafe-function-type报告类型注解、接口继承及类 implements 子句中未被遮蔽的全局 Function 引用
@typescript-eslint/triple-slash-reference已实现 path、types 和 lib 的 always/never 配置
@typescript-eslint/typedef支持 propertyDeclaration、memberVariableDeclaration、parameter、arrowParameter、arrayDestructuring、objectDestructuring、variableDeclaration 和 variableDeclarationIgnoreFunction 配置
@typescript-eslint/unified-signatures已实现
@typescript-eslint/no-unnecessary-parameter-property-assignment已实现对构造函数体内构造函数赋值的检查
@typescript-eslint/no-unnecessary-type-constraint已实现
@typescript-eslint/no-useless-constructor已实现
@typescript-eslint/no-useless-empty-export已实现
@typescript-eslint/no-unused-expressions支持 allowShortCircuit、allowTernary 和 allowTaggedTemplates 配置
@typescript-eslint/no-unused-vars支持 vars、args、caughtErrors、ignoreRestSiblings、ignoreClassWithStaticInitBlock、ignoreUsingDeclarations、reportUsedIgnorePattern,以及常见的 argsIgnorePattern/caughtErrorsIgnorePattern/destructuredArrayIgnorePattern/varsIgnorePattern 配置
@typescript-eslint/no-use-before-define支持 functions、classes、variables、typedefs、enums、allowNamedExports 和 ignoreTypeReferences 配置
@typescript-eslint/no-var-requires已实现
@typescript-eslint/no-wrapper-object-types已实现
@typescript-eslint/prefer-as-const已实现 ;支持安全自动修复,保留注释
@typescript-eslint/prefer-namespace-keyword已实现
@typescript-eslint/restrict-plus-operands支持 allowNumberAndString、allowAny、skipCompoundAssignments,识别原始类型、局部函数返回类型、直接泛型参数推断和数组元素类型
最后更新时间: