β
= done
π = in ESLint core
π = in another plugin
π = unimplemented
β = implementations differ or ESLint version is missing functionality
[1] The ESLint rule also supports silencing with an extra set of parens (if ((foo = bar)) {}
)
[2] Missing private class member support. typescript/no-unused-vars
adds support for some TS-specific features.
TSLint rule | ESLint rule | |
---|---|---|
cyclomatic-complexity |
π | complexity |
deprecation |
β | import/no-deprecated [1] |
eofline |
π | eol-last |
indent |
β | typescript/indent or Prettier |
linebreak-style |
π | linebreak-style or Prettier |
max-classes-per-file |
π | max-classes-per-file |
max-file-line-count |
π | max-lines |
max-line-length |
π | max-len or Prettier |
no-default-export |
π | import/no-default-export |
no-duplicate-imports |
π | import/no-duplicates |
no-mergeable-namespace |
π | N/A |
no-require-imports |
π | N/A |
object-literal-sort-keys |
β | sort-keys [2] |
prefer-const |
π | prefer-const |
prefer-readonly |
π | N/A |
trailing-comma |
β | comma-dangle or Prettier |
[1] Only warns when importing deprecated symbols
[2] Missing support for blank-line-delimited sections
[1] Recommended config: ["error", { blankLine: "always", prev: "*", next: "return" }]
[2] camelcase
, no-underscore-dangle
, id-blacklist
, and/or [id-match
]
Rule listing is here.
Deprecated rules are excluded (missing-jsdoc
, missing-optional-annotation
, no-duplicate-case
, no-duplicate-parameter-names
, no-increment-decrement
, no-empty-interfaces
, no-missing-visibility-modifiers
, no-multiple-var-decl
, no-reserved-keywords
, no-stateless-class
, no-var-self
, no-unnecessary-bind
, and valid-typeof
). See the docs in the link above to find out what to use instead.
Relevant plugins: chai-expect-keywords
, chai-expect
, chai-friendly
, mocha
, and jest
tslint-microsoft-contrib rule | ESLint rule | |
---|---|---|
chai-prefer-contains-to-index-of |
π | N/A |
chai-vague-errors |
π | N/A |
mocha-avoid-only |
π | jest/no-focused-tests |
mocha-unneeded-done |
π | N/A |
tslint-microsoft-contrib rule | ESLint rule | |
---|---|---|
prefer-array-literal |
β | typescript/no-array-constructor [1] |
prefer-type-cast |
π | N/A |
[1] ESLint rule is slightly less strict, allowing new Array<Foo>()
and Array(2)
.
tslint-microsoft-contrib rule | ESLint rule | |
---|---|---|
export-name |
π | N/A (relevant plugin) |
function-name |
π | N/A |
import-name |
π | N/A (relevant plugin) |
function-name |
π | N/A |
informative-docs |
π | N/A |
insecure-random |
π | custom implementation |
max-func-body-length |
π | max-statements |
no-banned-terms |
π | [no-callee ][no-callee] & no-eval |
no-constant-condition |
π | no-constant-condition |
no-control-regex |
π | no-control-regex |
no-delete-expression |
β | no-delete-var |
no-empty-line-after-opening-brace |
π | padded-blocks [1] or Prettier |
no-for-in |
π | no-restricted-syntax [2] |
no-function-expression |
π | func-style [3] |
no-invalid-regexp |
π | no-invalid-regexp |
no-multiline-string |
π | no-multi-str |
no-octal-literal |
π | no-octal-escape , see also no-octal |
no-regex-spaces |
π | no-regex-spaces |
no-relative-imports |
π | N/A, Not recommended by the maintainers |
no-single-line-block-comment |
π | N/A |
no-suspicious-comment |
π | [no-warning-comments ][no-warning-comments] [4] |
no-typeof-undefined |
π | N/A (this actually has a valid use: checking if a variable is defined) |
no-unexternalized-strings |
π | N/A |
no-unnecessary-field-initialization |
β | no-undef-init [5] |
no-unnecessary-local-variable |
π | N/A |
no-unnecessary-override |
π | N/A |
no-unnecessary-semicolons |
π | no-extra-semi or Prettier |
no-useless-files |
π | N/A |
no-with-statement |
π | no-with |
promise-must-complete |
π | N/A |
underscore-consistent-invocation |
π | lodash/chaining |
use-named-parameter |
π | N/A |
use-simple-attributes |
π | N/A |
[1] Enforces blank lines both at the beginning and end of a block
[2] Recommended config: ["error", "ForInStatement"]
[3] Recommended config: ["error", "declaration", { "allowArrowFunctions": true }]
[4] Recommended config: ["error", { "terms": ["BUG", "HACK", "FIXME", "LATER", "LATER2", "TODO"], "location": "anywhere" }]
[5] Does not check class fields.
tslint-microsoft-contrib rule | ESLint rule | |
---|---|---|
no-disable-auto-sanitization |
π | N/A |
no-document-domain |
β | Use no-restricted-syntax |
no-function-constructor-with-string-args |
π | no-new-func |
no-http-string |
π | N/A |
no-inner-html |
π | N/A |
no-string-based-set-immediate |
π | N/A |
no-string-based-set-interval |
π | N/A |
no-string-based-set-timeout |
π | N/A |
react-iframe-missing-sandbox |
π | N/A |
react-no-dangerous-html |
π | react/no-danger |
non-literal-fs-path |
π | security/detect-non-literal-fs-filename |
non-literal-require |
π | security/detect-non-literal-require |
possible-timing-attack |
π | security/detect-possible-timing-attacks |
tslint-microsoft-contrib rule | ESLint rule | |
---|---|---|
jquery-deferred-must-complete |
π | N/A |
no-backbone-get-set-outside-model |
π | N/A |
no-cookies |
β | Use no-restricted-syntax |
no-document-write |
β | Use no-restricted-syntax |
no-exec-script |
β | Use no-restricted-syntax |
no-jquery-raw-elements |
π | N/A |
no-unsupported-browser-code |
π | eslint-plugin-compat |
react-this-binding-issue |
π | |
react-tsx-curly-spacing |
π | react/jsx-curly-spacing |
react-unused-props-and-state |
β | react/no-unused-state |
tslint-microsoft-contrib rule | ESLint rule | |
---|---|---|
react-a11y-accessible-headings |
β | jsx-a11y/heading-has-content [1] |
react-a11y-anchors |
π | jsx-a11y/anchor-is-valid |
react-a11y-aria-unsupported-elements |
π | jsx-a11y/aria-unsupported-elements |
react-a11y-event-has-role |
β | jsx-a11y/no-static-element-interactions [2] |
react-a11y-image-button-has-alt |
π | jsx-a11y/alt-text |
react-a11y-img-has-alt |
π | jsx-a11y/alt-text |
react-a11y-input-elements |
π | N/A |
react-a11y-lang |
π | jsx-a11y/html-has-lang & jsx-a11y/lang |
react-a11y-meta |
π | N/A |
react-a11y-no-onchange |
π | jsx-a11y/no-onchange |
react-a11y-props |
π | jsx-a11y/aria-props |
react-a11y-proptypes |
π | jsx-a11y/aria-proptypes |
react-a11y-required |
π | N/A |
react-a11y-role-has-required-aria-props |
π | jsx-a11y/role-has-required-aria-props |
react-a11y-role-supports-aria-props |
π | jsx-a11y/role-supports-aria-props |
react-a11y-role |
π | jsx-a11y/aria-role |
react-a11y-tabindex-no-positive |
π | jsx-a11y/tabindex-no-positive |
react-a11y-titles |
π | N/A |
react-anchor-blank-noopener |
π | N/A |
[1] TSLint rule is more strict
[2] ESLint rule only reports for click handlers