@hs-web-team/eslint-config-node 2.1.2 → 3.0.0-next.3
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 +1 -1
- package/.github/workflows/pr.yml +1 -1
- package/.github/workflows/release.yml +14 -2
- package/README.md +4 -0
- package/docs/MIGRATION-V3.md +13 -0
- package/index.js +54 -43
- package/package.json +11 -6
package/.github/workflows/pr.yml
CHANGED
|
@@ -10,9 +10,21 @@ jobs:
|
|
|
10
10
|
- uses: actions/checkout@v4
|
|
11
11
|
- uses: actions/setup-node@v4
|
|
12
12
|
with:
|
|
13
|
-
node-version:
|
|
13
|
+
node-version: 24
|
|
14
14
|
registry-url: 'https://registry.npmjs.org'
|
|
15
15
|
- run: npm install
|
|
16
|
-
-
|
|
16
|
+
- name: Publish to npm
|
|
17
|
+
run: |
|
|
18
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
19
|
+
if [[ "$VERSION" =~ -next\. ]]; then
|
|
20
|
+
echo "Publishing prerelease version $VERSION with tag 'next'"
|
|
21
|
+
npm publish --tag next
|
|
22
|
+
elif [[ "$VERSION" =~ -(alpha|beta|rc)\. ]]; then
|
|
23
|
+
echo "Publishing prerelease version $VERSION with tag 'next'"
|
|
24
|
+
npm publish --tag next
|
|
25
|
+
else
|
|
26
|
+
echo "Publishing stable version $VERSION"
|
|
27
|
+
npm publish
|
|
28
|
+
fi
|
|
17
29
|
env:
|
|
18
30
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/README.md
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Migration from v2 to v3
|
|
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 `npx @eslint/migrate-config .eslintrc`
|
|
13
|
+
- [ ] Commit the changes
|
package/index.js
CHANGED
|
@@ -1,45 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
import tseslint from 'typescript-eslint';
|
|
4
|
+
import { defineConfig } from 'eslint/config';
|
|
5
|
+
|
|
6
|
+
export default defineConfig([
|
|
7
|
+
{
|
|
8
|
+
files: ['**/*.{js,mjs,cjs,ts,mts,cts}'],
|
|
9
|
+
plugins: { js },
|
|
10
|
+
extends: ['js/recommended'],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
globals: {...globals.node, ...globals.es2022},
|
|
13
|
+
},
|
|
14
|
+
ignores: [
|
|
15
|
+
'**/node_modules/**',
|
|
16
|
+
'**/.serverless/**',
|
|
17
|
+
'**/.webpack/**',
|
|
18
|
+
'**/dist/**',
|
|
19
|
+
'eslint.config.js',
|
|
18
20
|
],
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
21
|
+
rules: {
|
|
22
|
+
'no-console': [
|
|
23
|
+
'error',
|
|
24
|
+
{
|
|
25
|
+
allow: ['info', 'warn', 'error'],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
camelcase: 'off',
|
|
29
|
+
'comma-dangle': ['warn', 'always-multiline'],
|
|
30
|
+
'arrow-parens': 0,
|
|
31
|
+
'no-plusplus': 0,
|
|
32
|
+
'no-underscore-dangle': 0,
|
|
33
|
+
'no-confusing-arrow': 0,
|
|
34
|
+
'import/no-unresolved': 0,
|
|
35
|
+
'import/prefer-default-export': 0,
|
|
36
|
+
'no-trailing-spaces': ['error', { skipBlankLines: true }],
|
|
37
|
+
'no-unused-expressions': ['warn', { allowTernary: true }],
|
|
38
|
+
'max-len': [
|
|
39
|
+
2,
|
|
40
|
+
{
|
|
41
|
+
code: 120,
|
|
42
|
+
ignoreStrings: true,
|
|
43
|
+
ignoreTemplateLiterals: true,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
'operator-linebreak': 0,
|
|
47
|
+
'implicit-arrow-linebreaks': 0,
|
|
48
|
+
'implicit-arrow-linebreak': 0,
|
|
49
|
+
'object-curly-newline': 0,
|
|
50
|
+
'newline-per-chained-call': 0,
|
|
51
|
+
indent: 0,
|
|
52
|
+
'function-paren-newline': 0,
|
|
53
|
+
},
|
|
44
54
|
},
|
|
45
|
-
|
|
55
|
+
tseslint.configs.recommended,
|
|
56
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hs-web-team/eslint-config-node",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-next.3",
|
|
4
4
|
"description": "HubSpot Marketing WebTeam ESLint rules for Node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"lint": "npx eslint -c ./index.js *.js --fix",
|
|
8
9
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
"node": ">=22"
|
|
12
13
|
},
|
|
13
14
|
"bin": {
|
|
14
|
-
"add-prettier": "
|
|
15
|
+
"add-prettier": "bin/add-prettier-scripts.js"
|
|
15
16
|
},
|
|
16
17
|
"repository": {
|
|
17
18
|
"type": "git",
|
|
@@ -27,9 +28,13 @@
|
|
|
27
28
|
},
|
|
28
29
|
"homepage": "https://github.com/HubSpotWebTeam/wt-eslint-node#readme",
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"eslint": "^
|
|
31
|
-
"eslint
|
|
32
|
-
"eslint-plugin
|
|
33
|
-
"
|
|
31
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
32
|
+
"@eslint/js": "^9.39.1",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^8.46.3",
|
|
34
|
+
"@typescript-eslint/parser": "^8.46.3",
|
|
35
|
+
"globals": "^16.5.0",
|
|
36
|
+
"prettier": "^3.6.2",
|
|
37
|
+
"jiti": "^2.6.1",
|
|
38
|
+
"typescript-eslint": "^8.46.3"
|
|
34
39
|
}
|
|
35
40
|
}
|