@hs-web-team/eslint-config-node 3.0.0-next.3 → 3.0.0-next.5
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/.github/workflows/main.yml +2 -2
- package/.github/workflows/pr.yml +1 -1
- package/README.md +27 -14
- package/docs/MIGRATION-V3.md +11 -0
- package/package.json +1 -1
package/.github/workflows/pr.yml
CHANGED
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
|
|
22
|
+
2. Add to `eslint.config.js` in project root directory
|
|
23
23
|
|
|
24
|
-
```
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
```
|
|
24
|
+
```typescript
|
|
25
|
+
import { defineConfig } from 'eslint/config';
|
|
26
|
+
import wtConfig from '@hs-web-team/eslint-config-node';
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
export default defineConfig([
|
|
29
|
+
...wtConfig,
|
|
30
|
+
]);
|
|
31
|
+
```
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
package/docs/MIGRATION-V3.md
CHANGED
|
@@ -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.
|