@hs-web-team/eslint-config-node 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -19
- package/docs/MIGRATION-V2.md +24 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -15,28 +15,28 @@ This is a list of ESLint rules that are recommended for use with **Hubspot Marke
|
|
|
15
15
|
|
|
16
16
|
1. Install as dev dependency
|
|
17
17
|
|
|
18
|
-
```
|
|
19
|
-
npm i -D @hs-web-team/eslint-config-node
|
|
20
|
-
```
|
|
18
|
+
```sh
|
|
19
|
+
npm i -D @hs-web-team/eslint-config-node@latest
|
|
20
|
+
```
|
|
21
21
|
|
|
22
22
|
2. Add to `.eslintrc` in project root directory
|
|
23
23
|
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
```
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"extends": "@hs-web-team/eslint-config-node"
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
29
|
|
|
30
30
|
3. Extend the eslint on a project basis by adding rules to `.eslintrc` e.g.
|
|
31
31
|
|
|
32
|
-
```
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
```
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"extends": "@hs-web-team/eslint-config-node",
|
|
35
|
+
"settings": {
|
|
36
|
+
"import/resolver": "webpack"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
40
|
|
|
41
41
|
## Where to use it
|
|
42
42
|
|
|
@@ -48,16 +48,22 @@ This package includes a utility script to automatically add Prettier configurati
|
|
|
48
48
|
|
|
49
49
|
1. Run the script:
|
|
50
50
|
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
```
|
|
51
|
+
```sh
|
|
52
|
+
node ./node_modules/@hs-web-team/eslint-config-node/bin/add-prettier-scripts.js
|
|
53
|
+
```
|
|
54
54
|
|
|
55
55
|
2. The script will:
|
|
56
|
+
|
|
56
57
|
- Add `prettier:check` and `prettier:write` scripts to your package.json
|
|
57
58
|
- Install Prettier as a dev dependency if not already installed
|
|
58
59
|
- Create a `.prettierrc.js` file with shared config
|
|
59
60
|
- Create a `.prettierignore` file with sensible defaults
|
|
60
61
|
|
|
61
62
|
3. After installation, you can use the following commands:
|
|
63
|
+
|
|
62
64
|
- `npm run prettier:check` - Check files for formatting issues
|
|
63
65
|
- `npm run prettier:write` - Automatically fix formatting issues
|
|
66
|
+
|
|
67
|
+
## Migration from v1 to v2
|
|
68
|
+
|
|
69
|
+
See [MIGRATION-V2.md](./docs/MIGRATION-V2.md)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Migration from v1 to v2
|
|
2
|
+
|
|
3
|
+
## Steps to migrate
|
|
4
|
+
|
|
5
|
+
> **Note**
|
|
6
|
+
>
|
|
7
|
+
> This migration requires a manual review of the changes and also that you run your project in Node.js v22 or higher.
|
|
8
|
+
|
|
9
|
+
- [ ] Upgrade to Node.js v22 or higher
|
|
10
|
+
- [ ] Upgrade all dependencies to the latest version
|
|
11
|
+
- [ ] Update the package `npm install @hs-web-team/eslint-config-node@latest`
|
|
12
|
+
- [ ] Run the script `node ./node_modules/@hs-web-team/eslint-config-node/bin/add-prettier-scripts.js`
|
|
13
|
+
- [ ] Commit the changes
|
|
14
|
+
- [ ] Run the `prettier:check` command to preview what it's being changed
|
|
15
|
+
- [ ] Adjust the `.prettierignore` according to your project requirements, as you may not want to format certain files
|
|
16
|
+
- [ ] Run the `prettier:write` command to format the files
|
|
17
|
+
- [ ] Hope for the best :-D
|
|
18
|
+
- [ ] Test locally that everything is working correctly
|
|
19
|
+
- [ ] Commit the changes
|
|
20
|
+
- [ ] Create a PR
|
|
21
|
+
- [ ] Get it approved
|
|
22
|
+
- [ ] Merge it into `main`
|
|
23
|
+
- [ ] Test everything in QA
|
|
24
|
+
- [ ] Celebrate! 🎉
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hs-web-team/eslint-config-node",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "HubSpot Marketing WebTeam ESLint rules for Node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/HubSpotWebTeam/wt-eslint-node#readme",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"eslint": "^8.
|
|
30
|
+
"eslint": "^8.57.1",
|
|
31
31
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
32
|
-
"eslint-plugin-import": "^2.
|
|
33
|
-
"prettier": "^3.
|
|
32
|
+
"eslint-plugin-import": "^2.32.0",
|
|
33
|
+
"prettier": "^3.6.2"
|
|
34
34
|
}
|
|
35
35
|
}
|