@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.
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- node: [20, 22]
14
+ node: [24]
15
15
 
16
16
  name: Node ${{ matrix.node }} sample
17
17
  steps:
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- node: [20, 22]
14
+ node: [24]
15
15
 
16
16
  name: Node ${{ matrix.node }} sample
17
17
  steps:
@@ -10,9 +10,21 @@ jobs:
10
10
  - uses: actions/checkout@v4
11
11
  - uses: actions/setup-node@v4
12
12
  with:
13
- node-version: 22
13
+ node-version: 24
14
14
  registry-url: 'https://registry.npmjs.org'
15
15
  - run: npm install
16
- - run: npm publish
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
@@ -67,3 +67,7 @@ This package includes a utility script to automatically add Prettier configurati
67
67
  ## Migration from v1 to v2
68
68
 
69
69
  See [MIGRATION-V2.md](./docs/MIGRATION-V2.md)
70
+
71
+ ## Migration from v2 to v3
72
+
73
+ See [MIGRATION-V3.md](./docs/MIGRATION-V3.md)
@@ -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
- module.exports = {
2
- env: {
3
- commonjs: true,
4
- es2021: true,
5
- node: true,
6
- },
7
- ignorePatterns: ['/node_modules/', '/.serverless/', '/.eslintrc.js', '/.webpack/'],
8
- extends: ['airbnb-base'],
9
- parserOptions: {
10
- ecmaVersion: 'latest',
11
- },
12
- rules: {
13
- 'no-console': [
14
- 'error',
15
- {
16
- allow: ['info', 'warn', 'error'],
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
- camelcase: 0,
20
- 'comma-dangle': 1,
21
- 'arrow-parens': 0,
22
- 'no-plusplus': 0,
23
- 'no-underscore-dangle': 0,
24
- 'no-confusing-arrow': 0,
25
- 'import/no-unresolved': 0,
26
- 'import/prefer-default-export': 0,
27
- 'no-trailing-spaces': [2, { skipBlankLines: true }],
28
- 'no-unused-expressions': [1, { allowTernary: true }],
29
- 'max-len': [
30
- 2,
31
- {
32
- code: 120,
33
- ignoreStrings: true,
34
- ignoreTemplateLiterals: true,
35
- },
36
- ],
37
- 'operator-linebreak': 0,
38
- 'implicit-arrow-linebreaks': 0,
39
- 'implicit-arrow-linebreak': 0,
40
- 'object-curly-newline': 0,
41
- 'newline-per-chained-call': 0,
42
- indent: 0,
43
- 'function-paren-newline': 0,
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": "2.1.2",
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": "./bin/add-prettier-scripts.js"
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": "^8.57.1",
31
- "eslint-config-airbnb-base": "^15.0.0",
32
- "eslint-plugin-import": "^2.32.0",
33
- "prettier": "^3.6.2"
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
  }