@hs-web-team/eslint-config-node 3.0.0-next.10 → 3.0.0-next.12

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/CLAUDE.md CHANGED
@@ -26,8 +26,13 @@ When testing changes to this package in downstream projects, you'll typically:
26
26
  ### Core Configuration File
27
27
  - **`index.js`**: The main ESLint configuration export using ESLint 9's flat config format
28
28
  - Uses `@eslint/js`, `typescript-eslint`, and `globals` packages
29
- - Exports two separate configurations: one for JavaScript files (`**/*.{js,mjs,cjs}`) and one for TypeScript files (`**/*.{ts,mts,cts,tsx}`)
30
- - JavaScript config uses `js/recommended`, TypeScript config uses `tseslint.configs.recommended`
29
+ - Exports an array of configuration objects (flat config format)
30
+ - Structure:
31
+ 1. Global ignores object
32
+ 2. `js.configs.recommended` for JavaScript baseline
33
+ 3. JavaScript-specific config for `**/*.{js,mjs,cjs}` files
34
+ 4. Spreads `tseslint.configs.recommended` for TypeScript baseline
35
+ 5. TypeScript-specific config for `**/*.{ts,mts,cts,tsx}` files
31
36
  - Includes Node.js, ES2022, and Jest globals
32
37
  - Common ignores: `node_modules`, `.serverless`, `.webpack`, `dist`, `eslint.config.js`
33
38
  - Key custom rules: `no-console` (allows info/warn/error), `max-len` (120 chars), camelcase disabled
package/README.md CHANGED
@@ -22,21 +22,19 @@ This is a list of ESLint rules that are recommended for use with **Hubspot Marke
22
22
  2. Add to `eslint.config.js` in project root directory
23
23
 
24
24
  ```typescript
25
- import { defineConfig } from 'eslint/config';
26
25
  import wtConfig from '@hs-web-team/eslint-config-node';
27
26
 
28
- export default defineConfig([
27
+ export default [
29
28
  ...wtConfig,
30
- ]);
29
+ ];
31
30
  ```
32
31
 
33
32
  3. Extend the eslint on a project basis by adding rules to `eslint.config.js` e.g.
34
33
 
35
34
  ```typescript
36
- import { defineConfig } from 'eslint/config';
37
35
  import wtConfig from '@hs-web-team/eslint-config-node';
38
36
 
39
- export default defineConfig([
37
+ export default [
40
38
  // Add project-specific ignores here
41
39
  {
42
40
  ignores: ['dist/**'],
@@ -48,7 +46,7 @@ This is a list of ESLint rules that are recommended for use with **Hubspot Marke
48
46
  },
49
47
  },
50
48
  ...wtConfig, // This will include the shared rules from @hs-web-team/eslint-config-node
51
- ]);
49
+ ];
52
50
  ```
53
51
 
54
52
  ## Where to use it
package/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import js from '@eslint/js';
2
2
  import globals from 'globals';
3
3
  import tseslint from 'typescript-eslint';
4
- import { defineConfig } from 'eslint/config';
5
4
 
6
5
  // Base rules for all JavaScript files
7
6
  const baseRules = {
@@ -47,26 +46,30 @@ const commonIgnores = [
47
46
  'eslint.config.js',
48
47
  ];
49
48
 
50
- export default defineConfig([
49
+ export default [
50
+ // Global ignores
51
+ {
52
+ ignores: commonIgnores,
53
+ },
51
54
  // Base config for all JavaScript files
55
+ js.configs.recommended,
52
56
  {
53
57
  files: ['**/*.{js,mjs,cjs}'],
54
- plugins: { js },
55
- extends: ['js/recommended'],
56
58
  languageOptions: {
57
59
  globals: {...globals.node, ...globals.es2022, ...globals.jest},
58
60
  },
59
- ignores: commonIgnores,
60
61
  rules: baseRules,
61
62
  },
62
- // TypeScript config that extends the base config
63
+ // TypeScript config - restrict to TypeScript files only
64
+ ...tseslint.configs.recommended.map(config => ({
65
+ ...config,
66
+ files: ['**/*.{ts,mts,cts,tsx}'],
67
+ })),
63
68
  {
64
69
  files: ['**/*.{ts,mts,cts,tsx}'],
65
- ...tseslint.configs.recommended,
66
- // You can add or override rules specific to TypeScript here
67
- rules: {
68
- ...baseRules,
69
- // Add any TypeScript-specific rules here
70
+ languageOptions: {
71
+ globals: {...globals.node, ...globals.es2022, ...globals.jest},
70
72
  },
73
+ rules: baseRules,
71
74
  },
72
- ]);
75
+ ];
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.10",
3
+ "version": "3.0.0-next.12",
4
4
  "description": "HubSpot Marketing WebTeam ESLint rules for Node.js",
5
5
  "main": "index.js",
6
6
  "type": "module",