eslint-config-ts-lib
ts-lib-scripts 创建的 ts 库项目使用的 ESLint 配置
安装
yarn add eslint-config-ts-lib typescript --dev
使用
{
"eslintConfig": {
"extends": "ts-lib"
}
}
包含的规则
- for-direction
- getter-return
- no-async-promise-executor
- no-compare-neg-zero
- no-cond-assign
- no-constant-condition
- no-control-regex
- no-debugger
- no-dupe-args
- no-dupe-else-if
- no-dupe-keys
- no-duplicate-case
- no-empty
- no-empty-character-class
- no-ex-assign
- no-extra-boolean-cast
- no-extra-semi
- no-func-assign
- no-import-assign
- no-inner-declarations
- no-invalid-regexp
- no-irregular-whitespace
- no-misleading-character-class
- no-obj-calls
- no-prototype-builtins
- no-regex-spaces
- no-setter-return
- no-sparse-arrays
- no-unexpected-multiline
- no-unreachable
- no-unsafe-finally
- no-unsafe-negation
- use-isnan
- valid-typeof
- no-case-declarations
- no-empty-pattern
- no-fallthrough
- no-global-assign
- no-octal
- no-redeclare
- no-self-assign
- no-unused-labels
- no-useless-catch
- no-useless-escape
- no-with
- no-delete-var
- no-shadow-restricted-names
- no-undef
- no-unused-vars
- no-mixed-spaces-and-tabs
- constructor-super
- no-class-assign
- no-const-assign
- no-dupe-class-members
- no-new-symbol
- no-this-before-super
- require-yield
- react/no-danger-with-children
- react/display-name
- react/no-children-prop
- react/no-deprecated
- react/no-direct-mutation-state
- react/no-find-dom-node
- react/no-render-return-value
- react/no-is-mounted
- react/no-string-refs
- react/no-unescaped-entities
- react/no-unknown-property
- react/react-in-jsx-scope
- react/prop-types
- react/require-render-return
- react/jsx-key
- react/jsx-no-comment-textnodes
- react/jsx-no-duplicate-props
- react/jsx-no-target-blank
- react/jsx-no-undef
- react/jsx-uses-react
- react/jsx-uses-vars
- @typescript-eslint/ban-ts-comment
- @typescript-eslint/adjacent-overload-signatures
- @typescript-eslint/explicit-module-boundary-types
- @typescript-eslint/no-explicit-any
- @typescript-eslint/ban-types
- @typescript-eslint/no-extra-non-null-assertion
- @typescript-eslint/no-inferrable-types
- @typescript-eslint/no-empty-interface
- @typescript-eslint/no-misused-new
- @typescript-eslint/no-namespace
- @typescript-eslint/no-var-requires
- @typescript-eslint/no-non-null-asserted-optional-chain
- @typescript-eslint/no-non-null-assertion
- @typescript-eslint/no-this-alias
- @typescript-eslint/prefer-namespace-keyword
- @typescript-eslint/prefer-as-const
- @typescript-eslint/triple-slash-reference
- @typescript-eslint/no-empty-function
- @typescript-eslint/no-array-constructor
- @typescript-eslint/no-extra-semi
- @typescript-eslint/no-unused-vars
- react-hooks/exhaustive-deps
- react-hooks/rules-of-hooks