@hs-web-team/eslint-config-node 3.0.0-next.3 → 3.0.0-next.4

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 CHANGED
@@ -19,23 +19,36 @@ This is a list of ESLint rules that are recommended for use with **Hubspot Marke
19
19
  npm i -D @hs-web-team/eslint-config-node@latest
20
20
  ```
21
21
 
22
- 2. Add to `.eslintrc` in project root directory
22
+ 2. Add to `eslint.config.js` in project root directory
23
23
 
24
- ```json
25
- {
26
- "extends": "@hs-web-team/eslint-config-node"
27
- }
28
- ```
24
+ ```typescript
25
+ import { defineConfig } from 'eslint/config';
26
+ import wtConfig from '@hs-web-team/eslint-config-node';
29
27
 
30
- 3. Extend the eslint on a project basis by adding rules to `.eslintrc` e.g.
28
+ export default defineConfig([
29
+ ...wtConfig,
30
+ ]);
31
+ ```
31
32
 
32
- ```json
33
- {
34
- "extends": "@hs-web-team/eslint-config-node",
35
- "settings": {
36
- "import/resolver": "webpack"
37
- }
38
- }
33
+ 3. Extend the eslint on a project basis by adding rules to `eslint.config.js` e.g.
34
+
35
+ ```typescript
36
+ import { defineConfig } from 'eslint/config';
37
+ import wtConfig from '@hs-web-team/eslint-config-node';
38
+
39
+ export default defineConfig([
40
+ // Add project-specific ignores here
41
+ {
42
+ ignores: ['dist/**'],
43
+ },
44
+ // Add project-specific rules here
45
+ {
46
+ rules: {
47
+ 'no-console': 'error',
48
+ },
49
+ },
50
+ ...wtConfig, // This will include the shared rules from @hs-web-team/eslint-config-node
51
+ ]);
39
52
  ```
40
53
 
41
54
  ## Where to use it
@@ -10,4 +10,15 @@
10
10
  - [ ] Upgrade all dependencies to the latest version
11
11
  - [ ] Update the package `npm install @hs-web-team/eslint-config-node@latest`
12
12
  - [ ] Run the script `npx @eslint/migrate-config .eslintrc`
13
+ - [ ] Run `npm run lint` to check for any errors
13
14
  - [ ] Commit the changes
15
+ - [ ] Create a PR
16
+ - [ ] Get it approved
17
+ - [ ] Merge it into `main`
18
+ - [ ] Test everything in QA
19
+ - [ ] Celebrate! 🎉
20
+
21
+ > **Important**
22
+ >
23
+ > Bear in mind that this migration will remove the `.eslintrc` file and replace it with `eslint.config.js`.
24
+ > Also the automated migration might fail to migrate some of the rules, so you may need to manually adjust the `eslint.config.js` file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hs-web-team/eslint-config-node",
3
- "version": "3.0.0-next.3",
3
+ "version": "3.0.0-next.4",
4
4
  "description": "HubSpot Marketing WebTeam ESLint rules for Node.js",
5
5
  "main": "index.js",
6
6
  "type": "module",