|
| 1 | +--- |
| 2 | +authors: |
| 3 | + - image_url: https://www.joshuakgoldberg.com/img/josh.jpg |
| 4 | + name: Josh Goldberg |
| 5 | + title: typescript-eslint Maintainer |
| 6 | + url: https://github.com/JoshuaKGoldberg |
| 7 | +description: We're following ESLint's lead in moving our formatting lint rules to the ESLint Stylistic project. |
| 8 | +slug: deprecating-formatting-rules |
| 9 | +tags: [formatter, formatting, prettier, style, stylistic] |
| 10 | +title: Deprecating Formatting Rules |
| 11 | +--- |
| 12 | + |
| 13 | +[ESLint recently announced their plan to deprecate their core formatting rules](https://eslint.org/blog/2023/10/deprecating-formatting-rules). |
| 14 | +The [ESLint Stylistic](https://eslint.style) project has taken over maintenance of formatting rules. |
| 15 | + |
| 16 | +As a result, we in typescript-eslint are now able to deprecate our formatting rules as well. |
| 17 | +We'll keep these deprecated rules available until our next major version. |
| 18 | + |
| 19 | +<!--truncate--> |
| 20 | + |
| 21 | +## Context: Formatting Rules |
| 22 | + |
| 23 | +The ESLint blog post thoroughly explains the history and tradeoffs of formatting rules. |
| 24 | +See also [ESLint's 2020 Changes to Rule Policies blog post](https://eslint.org/blog/2020/05/changes-to-rules-policies/#what-are-the-changes) and our _[What About Formatting?](/linting/troubleshooting/formatting)_ docs. |
| 25 | +The performance downsides of formatting rules are heightened when [linting with type information](/linting/typed-linting). |
| 26 | + |
| 27 | +## Timelines |
| 28 | + |
| 29 | +[v6.16.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v6.16.0), released December 25th, 2023, marks the rules as deprecated. |
| 30 | +Deprecation is only a documentation change. |
| 31 | +Per semantic versioning, formatting-related rules will remain available for all releases of typescript-eslint in the current major version, v6. |
| 32 | + |
| 33 | +**Our next major version, v7, will remove all deprecated rules.** |
| 34 | + |
| 35 | +## Upgrading to ESLint Stylistic |
| 36 | + |
| 37 | +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. |
| 38 | +You'll want to switch to using their equivalents from [ESLint Stylistic](https://eslint.style). |
| 39 | + |
| 40 | +See the [ESLint Stylistic > Getting Started](https://eslint.style/guide/getting-started) guide for how to switch formatting rules to that project. |
| 41 | +The equivalent stylistic rules for deprecated typescript-eslint rules are summarized in this table: |
| 42 | + |
| 43 | +| typescript-eslint Rule | ESLint Stylistic Rule | |
| 44 | +| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | |
| 45 | +| [`@typescript-eslint/block-spacing`](/rules/block-spacing) | [`@stylistic/block-spacing`](https://eslint.style/rules/ts/block-spacing) | |
| 46 | +| [`@typescript-eslint/brace-style`](/rules/brace-style) | [`@stylistic/brace-style`](https://eslint.style/rules/ts/brace-style) | |
| 47 | +| [`@typescript-eslint/comma-dangle`](/rules/comma-dangle) | [`@stylistic/comma-dangle`](https://eslint.style/rules/ts/comma-dangle) | |
| 48 | +| [`@typescript-eslint/comma-spacing`](/rules/comma-spacing) | [`@stylistic/comma-spacing`](https://eslint.style/rules/ts/comma-spacing) | |
| 49 | +| [`@typescript-eslint/func-call-spacing`](/rules/func-call-spacing) | [`@stylistic/func-call-spacing`](https://eslint.style/rules/ts/func-call-spacing) | |
| 50 | +| [`@typescript-eslint/indent`](/rules/indent) | [`@stylistic/indent`](https://eslint.style/rules/ts/indent) | |
| 51 | +| [`@typescript-eslint/key-spacing`](/rules/key-spacing) | [`@stylistic/key-spacing`](https://eslint.style/rules/ts/key-spacing) | |
| 52 | +| [`@typescript-eslint/keyword-spacing`](/rules/keyword-spacing) | [`@stylistic/keyword-spacing`](https://eslint.style/rules/ts/keyword-spacing) | |
| 53 | +| [`@typescript-eslint/lines-around-comment`](/rules/lines-around-comment) | [`@stylistic/lines-around-comment`](https://eslint.style/rules/ts/lines-around-comment) | |
| 54 | +| [`@typescript-eslint/lines-between-class-members`](/rules/lines-between-class-members) | [`@stylistic/lines-between-class-members`](https://eslint.style/rules/ts/lines-between-class-members) | |
| 55 | +| [`@typescript-eslint/member-delimiter-style`](/rules/member-delimiter-style) | [`@stylistic/member-delimiter-style`](https://eslint.style/rules/ts/member-delimiter-style) | |
| 56 | +| [`@typescript-eslint/no-extra-parens`](/rules/no-extra-parens) | [`@stylistic/no-extra-parens`](https://eslint.style/rules/ts/no-extra-parens) | |
| 57 | +| [`@typescript-eslint/no-extra-semi`](/rules/no-extra-semi) | [`@stylistic/no-extra-semi`](https://eslint.style/rules/ts/no-extra-semi) | |
| 58 | +| [`@typescript-eslint/padding-line-between-statements`](/rules/padding-line-between-statements) | [`@stylistic/padding-line-between-statements`](https://eslint.style/rules/ts/padding-line-between-statements) | |
| 59 | +| [`@typescript-eslint/quotes`](/rules/quotes) | [`@stylistic/quotes`](https://eslint.style/rules/ts/quotes) | |
| 60 | +| [`@typescript-eslint/semi`](/rules/semi) | [`@stylistic/semi`](https://eslint.style/rules/ts/semi) | |
| 61 | +| [`@typescript-eslint/space-before-blocks`](/rules/space-before-blocks) | [`@stylistic/space-before-blocks`](https://eslint.style/rules/ts/space-before-blocks) | |
| 62 | +| [`@typescript-eslint/space-before-function-paren`](/rules/space-before-function-paren) | [`@stylistic/space-before-function-paren`](https://eslint.style/rules/ts/space-before-function-paren) | |
| 63 | +| [`@typescript-eslint/space-infix-ops`](/rules/space-infix-ops) | [`@stylistic/space-infix-ops`](https://eslint.style/rules/ts/space-infix-ops) | |
| 64 | +| [`@typescript-eslint/type-annotation-spacing`](/rules/type-annotation-spacing) | [`@stylistic/type-annotation-spacing`](https://eslint.style/rules/ts/type-annotation-spacing) | |
| 65 | + |
| 66 | +## Supporting typescript-eslint |
| 67 | + |
| 68 | +If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint). |
| 69 | +We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great. |
| 70 | +Thanks! 💖 |
0 commit comments