Skip to main content

Deprecating Formatting Rules

· 2 min read
Josh Goldberg
typescript-eslint Maintainer

ESLint recently announced their plan to deprecate their core formatting rules. The ESLint Stylistic project has taken over maintenance of formatting rules.

As a result, we in typescript-eslint are now able to deprecate our formatting rules as well. We'll keep these deprecated rules available until our next major version.

Context: Formatting Rules

The ESLint blog post thoroughly explains the history and tradeoffs of formatting rules. See also ESLint's 2020 Changes to Rule Policies blog post and our What About Formatting? docs. The performance downsides of formatting rules are heightened when linting with type information.

Timelines

v6.16.0, released December 25th, 2023, marks the rules as deprecated. Deprecation is only a documentation change. Per semantic versioning, formatting-related rules will remain available for all releases of typescript-eslint in the current major version, v6.

Our next major version, v7, will remove all deprecated rules.

Upgrading to ESLint Stylistic

Although you can continue to use formatting rules in typescript-eslint for now, we don't plan on adding any new features or fixes to the rules. You'll want to switch to using their equivalents from ESLint Stylistic.

See the ESLint Stylistic > Getting Started guide for how to switch formatting rules to that project. The equivalent stylistic rules for deprecated typescript-eslint rules are summarized in this table:

typescript-eslint RuleESLint Stylistic Rule
@typescript-eslint/block-spacing@stylistic/block-spacing
@typescript-eslint/brace-style@stylistic/brace-style
@typescript-eslint/comma-dangle@stylistic/comma-dangle
@typescript-eslint/comma-spacing@stylistic/comma-spacing
@typescript-eslint/func-call-spacing@stylistic/func-call-spacing
@typescript-eslint/indent@stylistic/indent
@typescript-eslint/key-spacing@stylistic/key-spacing
@typescript-eslint/keyword-spacing@stylistic/keyword-spacing
@typescript-eslint/lines-around-comment@stylistic/lines-around-comment
@typescript-eslint/lines-between-class-members@stylistic/lines-between-class-members
@typescript-eslint/member-delimiter-style@stylistic/member-delimiter-style
@typescript-eslint/no-extra-parens@stylistic/no-extra-parens
@typescript-eslint/no-extra-semi@stylistic/no-extra-semi
@typescript-eslint/padding-line-between-statements@stylistic/padding-line-between-statements
@typescript-eslint/quotes@stylistic/quotes
@typescript-eslint/semi@stylistic/semi
@typescript-eslint/space-before-blocks@stylistic/space-before-blocks
@typescript-eslint/space-before-function-paren@stylistic/space-before-function-paren
@typescript-eslint/space-infix-ops@stylistic/space-infix-ops
@typescript-eslint/type-annotation-spacing@stylistic/type-annotation-spacing

Supporting typescript-eslint

If you enjoyed this blog post and/or use typescript-eslint, please consider supporting us on Open Collective. We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great. Thanks! 💖