Skip to content

Changes to the recommended sets for 5.0.0 #3746

Closed
@bradzacher

Description

@bradzacher

Similar to what I did for 3.0.0 (in #1423), I'm putting forward the new recommended set ahead of time.
I'm looking for feedback from the community before we go ahead and make the changes.

Hint: search for the text (new) to find the changes

Header Key
  • New = new since version 3 - the last time we updated the recommended sets
  • Ext = extension rule
  • Dep = deprecated
    • ☑️ = deprecated in the next major
    • 🗑️ = to be removed from the plugin in the next version
  • R = recommended
    • ⚠️ = recommended as warning
    • 🛑 = recommended as an error
    • 🗑️ = remove from recommended this version
  • RWT = recommended with typechecking
    • ⚠️ = recommended as warning
    • 🛑 = recommended as an error
    • 🗑️ = remove from recommended this version
Rule New Ext Dep R RWT Comment
adjacent‑overload‑signatures 🛑
array‑type
await‑thenable 🛑
ban‑ts‑comment 🛑
ban‑tslint‑comment ☑️ There's still 3m weekly downloads for TSLint - too many users to make this recommended for now.
ban‑types 🛑 We should remove object from the default config, because enough people want to use it and disagree with the reasoning.
brace‑style ☑️
class‑literal‑property‑style
comma‑dangle ☑️ ☑️ Not in ESLint's recommended.
comma‑spacing ☑️
consistent‑indexed‑object‑style ☑️ Stylistic.
consistent‑type‑assertions
consistent‑type‑definitions
consistent‑type‑imports ☑️ Stylistic.
default‑param‑last ☑️
dot‑notation ☑️
explicit‑function‑return‑type
explicit‑member‑accessibility
explicit‑module‑boundary‑types 🗑️ (new) A lot of people are against this style and turn the rule off. It's entirely stylistic so we shouldn't recommend it.
func‑call‑spacing ☑️
indent ☑️
init‑declarations ☑️
keyword‑spacing ☑️
lines‑between‑class‑members ☑️
member‑delimiter‑style
member‑ordering
method‑signature‑style
naming‑convention
no‑array‑constructor ☑️ 🛑
no‑base‑to‑string
no‑confusing‑non‑null‑assertion ☑️ Stylistic.
no‑confusing‑void‑expression ☑️ It's a good rule, but I think in general the errors it prevents will just be caught by the typechecker.
no‑dupe‑class‑members ☑️
no‑duplicate‑imports ☑️ ☑️ Stylistic.
no‑dynamic‑delete
no‑empty‑function ☑️ 🛑
no‑empty‑interface 🛑
no‑explicit‑any ⚠️
no‑extra‑non‑null‑assertion 🛑
no‑extra‑parens ☑️
no‑extra‑semi ☑️ 🛑
no‑extraneous‑class
no‑floating‑promises 🛑
no‑for‑in‑array 🛑
no‑implicit‑any‑catch ☑️ ☑️ (new) TS 4.4 now has a compiler flag for this. So it's now a rule we don't need! Because 4.4 is still in RC, we'll just deprecate it, and remove it in the next major.
no‑implied‑eval ☑️ 🛑
no‑inferrable‑types 🛑
no‑invalid‑this ☑️
no‑invalid‑void‑type
no‑loop‑func ☑️ ☑️ Not in ESLint's recommended.
no‑loss‑of‑precision ☑️ ☑️ 🛑 (new) ESLint added this to their recommended set.
no‑magic‑numbers ☑️
no‑misused‑new 🛑
no‑misused‑promises 🛑
no‑namespace 🛑
no‑non‑null‑asserted‑optional‑chain 🛑
no‑non‑null‑assertion ⚠️
no‑parameter‑properties
no‑redeclare ☑️ ☑️ Recommended by ESLint, but we disable it in our eslint-recommended set.
no‑require‑imports
no‑shadow ☑️ ☑️ Not in ESLint's recommended.
no‑this‑alias 🛑
no‑throw‑literal ☑️
no‑type‑alias
no‑unnecessary‑boolean‑literal‑compare
no‑unnecessary‑condition
no‑unnecessary‑qualifier
no‑unnecessary‑type‑arguments
no‑unnecessary‑type‑assertion 🛑
no‑unnecessary‑type‑constraint ☑️ 🛑 (new) Helps remove redundant code.
no‑unsafe‑argument ☑️ 🛑 (new) Same reasoning as the other no‑unsafe-* rules.
no‑unsafe‑assignment 🛑
no‑unsafe‑call 🛑
no‑unsafe‑member‑access 🛑
no‑unsafe‑return 🛑
no‑unused‑expressions ☑️
no‑unused‑vars‑experimental 🗑️ (new) no‑unused‑vars now completely supports TS - so this rule is no longer required.
no‑unused‑vars ☑️ ⚠️
no‑use‑before‑define ☑️
no‑useless‑constructor ☑️
no‑var‑requires 🛑
non‑nullable‑type‑assertion‑style
object‑curly‑spacing ☑️ ☑️ Not in ESLint's recommended.
prefer‑as‑const 🛑
prefer‑enum‑initializers ☑️ Stylistic.
prefer‑for‑of
prefer‑function‑type
prefer‑includes
prefer‑literal‑enum‑member ☑️ Stylistic.
prefer‑namespace‑keyword 🛑
prefer‑nullish‑coalescing
prefer‑optional‑chain
prefer‑readonly‑parameter‑types
prefer‑readonly
prefer‑reduce‑type‑parameter
prefer‑regexp‑exec 🗑️ (new) This is a stylistic rule and enough people have raised issues about its premise being wrong.
prefer‑return‑this‑type ☑️ Stylistic.
prefer‑string‑starts‑ends‑with
prefer‑ts‑expect‑error
promise‑function‑async
quotes ☑️
require‑array‑sort‑compare
require‑await ☑️
restrict‑plus‑operands 🛑
restrict‑template‑expressions 🛑
return‑await ☑️ 🛑
semi ☑️
sort‑type‑union‑intersection‑members ☑️ Stylistic.
space‑before‑function‑paren ☑️
space‑infix‑ops ☑️ ☑️ Not in ESLint's recommended.
strict‑boolean‑expressions
switch‑exhaustiveness‑check
triple‑slash‑reference 🛑
type‑annotation‑spacing
typedef
unbound‑method 🛑
unified‑signatures

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeThis change will require a new major version to be releasedpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginrecommended-rulesDiscussion about recommended rule sets

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions