You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Built-in [TypeScript support](https://github.com/torchbox/eslint-config-torchbox#typescript), via an experimental opt-in `torchbox/typescript` configuration.
22
22
- Additional peerDependencies added for TypeScript support: `@typescript-eslint/eslint-plugin`, and `@typescript-eslint/parser`. Both will be installed automatically in npm v7+, and should not change how the base configuration works in any way.
# 2. Attempt to auto-fix any new issue picked up by ESLint.
32
+
npm run lint:js -- --fix
33
+
npm run format
34
+
# 3. Check if there are remaining issues
35
+
npm run lint:js
36
+
```
37
+
38
+
If there are remaining issues, consider a gradual approach: whether you want to update the code, or disable the corresponding rules. This can be done either in the ESLint configuration (globally or via [overrides](https://github.com/torchbox/eslint-config-torchbox#overrides)), or via [`eslint-disable` configuration comments](https://eslint.org/docs/user-guide/configuring/rules#disabling-rules). Get the rules reporting issues with: `npm run lint:js -- --format tap | grep ruleId | cut -d ':' -f 2 | cut -c 2- | sort | uniq`.
39
+
40
+
#### Custom TypeScript linting
41
+
42
+
For projects previously using custom TypeScript linting, review our guidance on [linting setup for ongoing projects](https://github.com/torchbox/eslint-config-torchbox#linting-setup-for-ongoing-projects).
43
+
44
+
#### Migrate from Babel
45
+
46
+
Projects previously using Babel for linting can now remove the `babel-eslint` or `@babel/eslint-parser` dependencies.
47
+
48
+
---
49
+
50
+
Finally, if your project uses separate dependencies definitions for [pre-commit](https://github.com/torchbox/eslint-config-torchbox#pre-commit) hooks, make sure to update them similarly.
- Update to ESLint v8 and [eslint-config-airbnb v19.0.2](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/CHANGELOG.md), changing rules that are applied with this config.
29
57
@@ -77,9 +105,27 @@ Users of npm v7 can `npm install --save-dev eslint-config-torchbox@latest` and t
77
105
78
106
For older versions of npm, use `npx install-peerdeps --dev eslint-config-torchbox@latest` so all other peerDependencies are updated as well.
# 2. Attempt to auto-fix any new issue picked up by ESLint.
116
+
npm run lint:js -- --fix
117
+
npm run format
118
+
# 3. Check if there are remaining issues
119
+
npm run lint:js
120
+
```
121
+
122
+
If there are remaining issues, consider a gradual approach: whether you want to update the code, or disable the corresponding rules. This can be done either in the ESLint configuration (globally or via [overrides](https://github.com/torchbox/eslint-config-torchbox#overrides)), or via [`eslint-disable` configuration comments](https://eslint.org/docs/user-guide/configuring/rules#disabling-rules). Get the rules reporting issues with: `npm run lint:js -- --format tap | grep ruleId | cut -d ':' -f 2 | cut -c 2- | sort | uniq`. For projects strapped for time, disabling all new rules listed above may be a reasonable tradeoff.
123
+
124
+
Finally, if your project uses separate dependencies definitions for [pre-commit](https://github.com/torchbox/eslint-config-torchbox#pre-commit) hooks, make sure to update them similarly.
- Update to ESLint v7 and [eslint-config-airbnb v18.2.1](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/CHANGELOG.md), changing rules that are applied with this config.
85
131
- Update to eslint-config-prettier v8, which no longer requires specifying sub-configurations separately for different frameworks or syntaxes.
@@ -132,6 +178,24 @@ Users of npm v7 can `npm install --save-dev eslint-config-torchbox@latest` and t
132
178
133
179
For older versions of npm, use `npx install-peerdeps --dev eslint-config-torchbox@latest` so all other peerDependencies are updated as well.
# 2. Attempt to auto-fix any new issue picked up by ESLint.
189
+
npm run lint:js -- --fix
190
+
npm run format
191
+
# 3. Check if there are remaining issues
192
+
npm run lint:js
193
+
```
194
+
195
+
If there are remaining issues, consider a gradual approach: whether you want to update the code, or disable the corresponding rules. This can be done either in the ESLint configuration (globally or via [overrides](https://github.com/torchbox/eslint-config-torchbox#overrides)), or via [`eslint-disable` configuration comments](https://eslint.org/docs/user-guide/configuring/rules#disabling-rules). Get the rules reporting issues with: `npm run lint:js -- --format tap | grep ruleId | cut -d ':' -f 2 | cut -c 2- | sort | uniq`.
196
+
197
+
Finally, if your project uses separate dependencies definitions for [pre-commit](https://github.com/torchbox/eslint-config-torchbox#pre-commit) hooks, make sure to update them similarly.
@@ -175,6 +239,10 @@ To update, use `npx install-peerdeps --dev eslint-config-torchbox@latest` so all
175
239
176
240
Additionally, this config now requires `react` to be defined as a dependency on the project. Please refer to our [React configuration instructions](https://github.com/torchbox/eslint-config-torchbox#react) if you wish to bypass this.
177
241
242
+
### Upgrading to v0.3.0
243
+
244
+
Projects considering this release should [skip straight to v0.4.0](https://github.com/torchbox/eslint-config-torchbox/blob/main/CHANGELOG.md#upgrading-to-v040).
@@ -186,6 +254,10 @@ Additionally, this config now requires `react` to be defined as a dependency on
186
254
187
255
- The configuration is now defined based on [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb) ([#1](https://github.com/torchbox/eslint-config-torchbox/issues/1), [#2](https://github.com/torchbox/eslint-config-torchbox/pull/2)).
188
256
257
+
### Upgrading to v0.2.0
258
+
259
+
Projects considering this release should [skip straight to v0.4.0](https://github.com/torchbox/eslint-config-torchbox/blob/main/CHANGELOG.md#upgrading-to-v040).
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,12 @@ module.exports = {
63
63
64
64
### Tips
65
65
66
+
#### Linting setup for ongoing projects
67
+
68
+
Review our [CHANGELOG](https://github.com/torchbox/eslint-config-torchbox/blob/main/CHANGELOG.md) for guidance on how to upgrade a project’s linting to a specific version.
69
+
70
+
More generally, when retrofitting stricter linting onto an existing project, consider [a gradual approach to linting strictness](https://thib.me/upgrading-to-stricter-eslint-config), so you can start using linting without having to change significant portions of the project’s code.
71
+
66
72
#### Common CLI flags
67
73
68
74
We recommend the following `run` script to add to your `package.json`:
0 commit comments