Skip to content

Commit 2f538ff

Browse files
committed
Add more didactic upgrade docs
1 parent 622c081 commit 2f538ff

File tree

2 files changed

+81
-3
lines changed

2 files changed

+81
-3
lines changed

CHANGELOG.md

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,42 @@ Note the [experimental TypeScript support](https://github.com/torchbox/eslint-co
1616

1717
## [0.6.0](https://github.com/torchbox/eslint-config-torchbox/compare/v0.5.0...v0.6.0) (2022-03-09)
1818

19-
## Features
19+
### Features
2020

2121
- Built-in [TypeScript support](https://github.com/torchbox/eslint-config-torchbox#typescript), via an experimental opt-in `torchbox/typescript` configuration.
2222
- 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.
2323

24+
### Upgrading to v0.6.0
25+
26+
Here are recommended steps:
27+
28+
```bash
29+
# 1. Install the new versions.
30+
npm install --save-dev eslint@7 [email protected]
31+
# 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.
51+
2452
## [0.5.0](https://github.com/torchbox/eslint-config-torchbox/compare/v0.4.0...v0.5.0) (2021-12-13)
2553

26-
## Features
54+
### Features
2755

2856
- 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.
2957

@@ -77,9 +105,27 @@ Users of npm v7 can `npm install --save-dev eslint-config-torchbox@latest` and t
77105

78106
For older versions of npm, use `npx install-peerdeps --dev eslint-config-torchbox@latest` so all other peerDependencies are updated as well.
79107

108+
### Upgrading to v0.5.0
109+
110+
Here are recommended steps:
111+
112+
```bash
113+
# 1. Install the new versions.
114+
npm install --save-dev eslint@8 [email protected]
115+
# 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.
125+
80126
## [0.4.0](https://github.com/torchbox/eslint-config-torchbox/compare/v0.3.3...v0.4.0) (2021-07-15)
81127

82-
## Features
128+
### Features
83129

84130
- 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.
85131
- 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
132178

133179
For older versions of npm, use `npx install-peerdeps --dev eslint-config-torchbox@latest` so all other peerDependencies are updated as well.
134180

181+
### Upgrading to v0.4.0
182+
183+
Here are recommended steps:
184+
185+
```bash
186+
# 1. Install the new versions.
187+
npm install --save-dev eslint@7 [email protected]
188+
# 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.
198+
135199
## [0.3.3](https://github.com/torchbox/eslint-config-torchbox/compare/v0.3.2...v0.3.3) (2020-03-12)
136200

137201
### Bug fixes
@@ -175,6 +239,10 @@ To update, use `npx install-peerdeps --dev eslint-config-torchbox@latest` so all
175239

176240
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.
177241

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).
245+
178246
## [0.2.0](https://github.com/torchbox/eslint-config-torchbox/compare/v0.1.0...v0.2.0) (2019-07-16)
179247

180248
### Features
@@ -186,6 +254,10 @@ Additionally, this config now requires `react` to be defined as a dependency on
186254

187255
- 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)).
188256

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).
260+
189261
## [0.1.0](https://github.com/torchbox/eslint-config-torchbox/releases/tag/v0.1.0) (2019-07-04)
190262

191263
First release

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ module.exports = {
6363

6464
### Tips
6565

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+
6672
#### Common CLI flags
6773

6874
We recommend the following `run` script to add to your `package.json`:

0 commit comments

Comments
 (0)