跳至內容

規則

所有規則實作的進度追蹤在此

  • 規則總數:441
  • 預設啟用的規則:97

正確性 (172):

完全錯誤或無用的程式碼。

規則名稱來源預設可修正?
for-directioneslint⚠️🛠️️
no-async-promise-executoreslint
no-callereslint
no-class-assigneslint
no-compare-neg-zeroeslint🛠️💡
no-cond-assigneslint
no-const-assigneslint
no-constant-binary-expressioneslint
no-constant-conditioneslint
no-control-regexeslint
no-debuggereslint🛠️
no-delete-vareslint
no-dupe-class-memberseslint
no-dupe-else-ifeslint
no-dupe-keyseslint
no-duplicate-caseeslint
no-empty-character-classeslint
no-empty-patterneslint
no-empty-static-blockeslint💡
no-ex-assigneslint
no-extra-boolean-casteslint🚧
no-func-assigneslint
no-global-assigneslint
no-import-assigneslint
no-invalid-regexpeslint
no-irregular-whitespaceeslint
no-loss-of-precisioneslint
no-new-native-nonconstructoreslint
no-nonoctal-decimal-escapeeslint🚧
no-obj-callseslint
no-self-assigneslint
no-setter-returneslint
no-shadow-restricted-nameseslint
no-sparse-arrayseslint
no-this-before-supereslint
no-unsafe-finallyeslint
no-unsafe-negationeslint🛠️
no-unsafe-optional-chainingeslint
no-unused-labelseslint🛠️
no-unused-private-class-memberseslint
no-unused-varseslint⚠️💡
no-useless-catcheslint
no-useless-escapeeslint🛠️
no-useless-renameeslint
no-witheslint
require-yieldeslint
use-isnaneslint🛠️
valid-typeofeslint🛠️
defaultimport
namedimport
namespaceimport
expect-expectjest
no-conditional-expectjest
no-disabled-testsjest
no-exportjest
no-focused-testsjest🛠️
no-standalone-expectjest
require-to-throw-messagejest
valid-describe-callbackjest
valid-expectjest
valid-titlejest🛠️
check-property-namesjsdoc
check-tag-namesjsdoc
implements-on-classesjsdoc
no-defaultsjsdoc
require-propertyjsdoc
require-property-descriptionjsdoc
require-property-namejsdoc
require-property-typejsdoc
require-yieldsjsdoc
alt-textjsx_a11y
anchor-has-contentjsx_a11y💡
anchor-is-validjsx_a11y
aria-activedescendant-has-tabindexjsx_a11y
aria-propsjsx_a11y🛠️
aria-rolejsx_a11y
aria-unsupported-elementsjsx_a11y🛠️
autocomplete-validjsx_a11y
click-events-have-key-eventsjsx_a11y
heading-has-contentjsx_a11y
html-has-langjsx_a11y
iframe-has-titlejsx_a11y
img-redundant-altjsx_a11y
label-has-associated-controljsx_a11y
langjsx_a11y
media-has-captionjsx_a11y
mouse-events-have-key-eventsjsx_a11y
no-access-keyjsx_a11y💡
no-aria-hidden-on-focusablejsx_a11y🛠️
no-autofocusjsx_a11y🛠️
no-distracting-elementsjsx_a11y
no-redundant-rolesjsx_a11y🛠️
prefer-tag-over-rolejsx_a11y
role-has-required-aria-propsjsx_a11y
role-supports-aria-propsjsx_a11y
scopejsx_a11y🛠️
tabindex-no-positivejsx_a11y🚧
google-font-displaynextjs
google-font-preconnectnextjs
inline-script-idnextjs
next-script-for-ganextjs
no-assign-module-variablenextjs
no-async-client-componentnextjs
no-before-interactive-script-outside-documentnextjs
no-css-tagsnextjs
no-document-import-in-pagenextjs
no-duplicate-headnextjs
no-head-elementnextjs
no-head-import-in-documentnextjs
no-img-elementnextjs
no-page-custom-fontnextjs
no-script-component-in-headnextjs
no-styled-jsx-in-documentnextjs
no-sync-scriptsnextjs
no-title-in-document-headnextjs
no-typosnextjs🚧
no-unwanted-polyfillionextjs
bad-array-method-on-argumentsoxc
bad-char-at-comparisonoxc
bad-comparison-sequenceoxc
bad-min-max-funcoxc
bad-object-literal-comparisonoxc
bad-replace-all-argoxc
const-comparisonsoxc
double-comparisonsoxc🛠️
erasing-opoxc💡
missing-throwoxc💡
number-arg-out-of-rangeoxc
only-used-in-recursionoxc⚠️🛠️️
uninvoked-array-callbackoxc
no-callback-in-promisepromise
no-new-staticspromise🛠️
valid-paramspromise
jsx-keyreact
jsx-no-duplicate-propsreact
jsx-no-target-blankreact
jsx-no-undefreact
jsx-props-no-spread-multireact🛠️
no-children-propreact
no-danger-with-childrenreact
no-direct-mutation-statereact
no-find-dom-nodereact
no-is-mountedreact
no-render-return-valuereact
no-string-refsreact
void-dom-elements-no-childrenreact
api-keyssecurity
no-duplicate-enum-valuestypescript
no-extra-non-null-assertiontypescript
no-misused-newtypescript
no-non-null-asserted-optional-chaintypescript
no-this-aliastypescript
no-unsafe-declaration-mergingtypescript
no-useless-empty-exporttypescript🛠️
no-wrapper-object-typestypescript🛠️
prefer-as-consttypescript🛠️
triple-slash-referencetypescript
no-await-in-promise-methodsunicorn
no-document-cookieunicorn
no-empty-fileunicorn
no-invalid-remove-event-listenerunicorn
no-new-arrayunicorn🚧
no-single-promise-in-promise-methodsunicorn🛠️
no-thenableunicorn
no-unnecessary-awaitunicorn🛠️
no-useless-fallback-in-spreadunicorn🛠️
no-useless-length-checkunicorn🚧
no-useless-spreadunicorn🛠️
prefer-set-sizeunicorn🛠️
prefer-string-starts-ends-withunicorn🛠️
no-conditional-testsvitest
require-local-test-context-for-concurrent-snapshotsvitest🚧

效能 (6):

可以寫得更快執行的程式碼。

規則名稱來源預設可修正?
no-await-in-loopeslint
no-accumulating-spreadoxc
jsx-no-jsx-as-propreact_perf
jsx-no-new-array-as-propreact_perf
jsx-no-new-function-as-propreact_perf
jsx-no-new-object-as-propreact_perf

限制 (57):

防止使用語言和程式庫功能的檢查。不得整體啟用,應在啟用前逐案考慮。

規則名稱來源預設可修正?
default-caseeslint
no-alerteslint
no-bitwiseeslint
no-consoleeslint
no-div-regexeslint🛠️
no-emptyeslint💡
no-empty-functioneslint
no-eq-nulleslint⚠️🛠️️
no-evaleslint
no-iteratoreslint🚧
no-pluspluseslint💡
no-protoeslint🚧
no-regex-spaceseslint🚧
no-restricted-globalseslint
no-undefinedeslint
no-vareslint🛠️
no-voideslint🚧
unicode-bomeslint🛠️
no-amdimport
no-cycleimport
no-default-exportimport
no-dynamic-requireimport
no-webpack-loader-syntaximport
check-accessjsdoc
empty-tagsjsdoc
no-new-requirenode
bad-bitwise-operatoroxc
no-async-awaitoxc
no-barrel-fileoxc
no-const-enumoxc🛠️
no-optional-chainingoxc
no-rest-spread-propertiesoxc
catch-or-returnpromise
spec-onlypromise
button-has-typereact
no-dangerreact
no-unknown-propertyreact🚧
explicit-function-return-typetypescript
no-dynamic-deletetypescript
no-explicit-anytypescript🛠️
no-import-type-side-effectstypescript🛠️
no-namespacetypescript
no-non-null-asserted-nullish-coalescingtypescript
no-non-null-assertiontypescript
no-var-requirestypescript
prefer-literal-enum-membertypescript
no-abusive-eslint-disableunicorn
no-anonymous-default-exportunicorn
no-array-for-eachunicorn🚧
no-array-reduceunicorn
no-length-as-slice-endunicorn🛠️
no-magic-array-flat-depthunicorn
no-nested-ternaryunicorn🛠️
no-process-exitunicorn🚧
prefer-modern-math-apisunicorn🚧
prefer-node-protocolunicorn🛠️
prefer-number-propertiesunicorn🚧

可疑 (21):

極有可能錯誤或無用的程式碼。

規則名稱來源預設可修正?
no-extend-nativeeslint
no-neweslint
no-unexpected-multilineeslint⚠️🛠️️
no-useless-concateslint
no-useless-constructoreslint🛠️
no-duplicatesimport
no-named-as-defaultimport
no-named-as-default-memberimport
no-self-importimport
no-commented-out-testsjest
approx-constantoxc
misrefactored-assign-opoxc🚧
no-async-endpoint-handlersoxc
iframe-missing-sandboxreact🚧
jsx-no-comment-textnodesreact
react-in-jsx-scopereact
no-confusing-non-null-assertiontypescript🚧
no-extraneous-classtypescript
no-unnecessary-type-constrainttypescript
consistent-function-scopingunicorn🚧
prefer-add-event-listenerunicorn🚧

迂腐 (72):

相當嚴格或偶爾有誤判的檢查。

規則名稱來源預設可修正?
array-callback-returneslint
eqeqeqeslint🛠️
max-classes-per-fileeslint
max-lineseslint
no-array-constructoreslint🚧
no-case-declarationseslint
no-constructor-returneslint
no-else-returneslint🛠️
no-fallthrougheslint🚧
no-inner-declarationseslint
no-new-wrapperseslint🚧
no-prototype-builtinseslint
no-redeclareeslint
no-self-compareeslint
no-throw-literaleslint💡
radixeslint
require-awaiteslint
sort-varseslint🚧
symbol-descriptioneslint
max-dependenciesimport
no-conditional-in-testjest
require-paramjsdoc
require-param-descriptionjsdoc
require-param-namejsdoc
require-param-typejsdoc
require-returnsjsdoc
require-returns-descriptionjsdoc
require-returns-typejsdoc
checked-requires-onchange-or-readonlyreact
jsx-no-useless-fragmentreact
no-unescaped-entitiesreact
ban-ts-commenttypescript🛠️
ban-typestypescript🚧
prefer-enum-initializerstypescript🚧
prefer-ts-expect-errortypescript🛠️
consistent-empty-array-spreadunicorn💡
escape-caseunicorn🛠️
explicit-length-checkunicorn🛠️
new-for-builtinsunicorn
no-hex-escapeunicorn🛠️
no-instanceof-arrayunicorn🛠️
no-lonely-ifunicorn
no-negated-conditionunicorn🚧
no-negation-in-equality-checkunicorn🚧
no-new-bufferunicorn🚧
no-object-as-default-parameterunicorn
no-static-only-classunicorn🚧
no-this-assignmentunicorn
no-typeof-undefinedunicorn🚧
no-unreadable-iifeunicorn
no-useless-promise-resolve-rejectunicorn🛠️
no-useless-switch-caseunicorn🚧
no-useless-undefinedunicorn🛠️
prefer-array-flatunicorn🛠️
prefer-array-someunicorn🛠️
prefer-blob-reading-methodsunicorn🚧
prefer-code-pointunicorn🛠️
prefer-date-nowunicorn🛠️
prefer-dom-node-appendunicorn🛠️
prefer-dom-node-datasetunicorn🚧
prefer-dom-node-removeunicorn
prefer-event-targetunicorn
prefer-math-min-maxunicorn🛠️
prefer-math-truncunicorn🚧
prefer-native-coercion-functionsunicorn🚧
prefer-prototype-methodsunicorn🛠️
prefer-query-selectorunicorn🛠️
prefer-regexp-testunicorn🛠️
prefer-string-replace-allunicorn🛠️
prefer-string-sliceunicorn🛠️
prefer-type-errorunicorn🛠️
require-number-to-fixed-digits-argumentunicorn🛠️

樣式 (103):

應該以更慣用的方式編寫的程式碼。

規則名稱來源預設可修正?
default-case-lasteslint
default-param-lasteslint
func-nameseslint🛠️💡
guard-for-ineslint
max-paramseslint
no-continueeslint
no-label-vareslint
no-magic-numberseslint🚧
no-multi-streslint
no-new-funceslint
no-return-assigneslint🚧
no-script-urleslint
no-template-curly-in-stringeslint🚧
no-ternaryeslint
prefer-exponentiation-operatoreslint
prefer-numeric-literalseslint🛠️
sort-importseslint🛠️
sort-keyseslint🚧
consistent-test-itjest🛠️
max-expectsjest
max-nested-describejest
no-alias-methodsjest🛠️
no-confusing-set-timeoutjest
no-deprecated-functionsjest🛠️
no-done-callbackjest
no-duplicate-hooksjest
no-hooksjest
no-identical-titlejest
no-interpolation-in-snapshotsjest
no-jasmine-globalsjest🛠️
no-large-snapshotsjest
no-mocks-importjest
no-restricted-jest-methodsjest
no-restricted-matchersjest
no-test-prefixesjest🛠️
no-test-return-statementjest
no-untyped-mock-factoryjest🛠️
偏好使用 calledWithjest
偏好使用比較匹配器jest🛠️
偏好使用相等匹配器jest
偏好使用 expect.resolvesjest🛠️
偏好依序使用 Hooksjest
偏好將 Hooks 放在頂部jest
偏好使用 Jest 模擬 (mock)jest🛠️
偏好使用小寫標題jest🛠️
偏好使用模擬 Promise 簡寫jest🛠️
偏好使用 spyOnjest🛠️
偏好使用 strictEqualjest🛠️
偏好使用 toBejest🛠️
偏好使用 toContainjest
偏好使用 toHaveLengthjest🛠️
偏好使用 todojest🛠️
需要 Hookjest
需要頂層的 describejest
避免對 exports 賦值node🛠️
避免使用 newpromise
參數名稱promise
偏好使用 await 而非 callbackspromise
偏好使用 await 而非 thenpromise
JSX 布林值屬性react🛠️
JSX 大括號的使用react
避免使用 setStatereact
偏好使用 ES6 classreact
自閉合元件react🚧
相鄰的重載簽名typescript
陣列型別typescript🛠️
禁用 tslint 註解typescript🛠️
一致的索引物件樣式typescript🛠️
一致的型別定義typescript🛠️
避免空的介面typescript
偏好使用 for...oftypescript🚧
偏好使用函數型別typescript🛠️
偏好使用 namespace 關鍵字typescript🛠️
catch 錯誤名稱unicorn🚧
空大括號的空格unicorn🛠️
錯誤訊息unicorn
檔案名稱大小寫unicorn
避免在 await 表達式中使用成員unicorn🚧
避免 console 的空格unicorn🛠️
避免使用 nullunicorn🛠️
避免不可讀的陣列解構unicorn
避免零分數unicorn🛠️
數字字面值大小寫unicorn🛠️
數字分隔符號樣式unicorn🛠️
偏好使用陣列的 flatMapunicorn🛠️
偏好使用 DOM 節點的 textContentunicorn🛠️
偏好使用 includesunicorn🚧
偏好使用邏輯運算子而非三元運算子unicorn🚧
偏好使用現代 DOM APIsunicorn🚧
偏好使用可選的 catch 綁定unicorn🛠️
偏好使用 Reflect.applyunicorn
偏好使用展開語法unicorn🛠️
偏好使用字串的 trimStart 和 trimEndunicorn🛠️
偏好使用結構化複製 (structured clone)unicorn🚧
需要陣列 join 的分隔符號unicorn🛠️
switch case 的大括號unicorn🛠️
文字編碼識別符號大小寫unicorn🛠️
拋出 new Errorunicorn🛠️
避免引入 node testvitest🛠️
偏好使用 eachvitest
偏好使用 toBeFalsyvitest🛠️
偏好使用 toBeObjectvitest🛠️
偏好使用 toBeTruthyvitest🛠️

培育中 (10):

仍在開發中的新 Lint 規則。

規則名稱來源預設可修正?
constructor-supereslint
getter-returneslint
no-undefeslint
no-unreachableeslint
exportimport
no-return-in-finallypromise
require-render-returnreact
rules-of-hooksreact
no-side-effects-in-initializationtree_shaking
consistent-type-importstypescript🛠️

以 MIT 授權發佈。