@wistia/eslint-config 0.34.0 → 0.35.0

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.
Files changed (2) hide show
  1. package/package.json +18 -18
  2. package/rules/eslint/node.cjs +88 -76
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wistia/eslint-config",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "packageManager": "yarn@4.3.0",
5
5
  "description": "Wistia's ESLint configurations",
6
6
  "main": "react.js",
@@ -40,12 +40,12 @@
40
40
  "test:stylelint": "stylelint --print-config ./test/index.mjs"
41
41
  },
42
42
  "dependencies": {
43
- "@babel/core": "^7.24.7",
44
- "@babel/eslint-parser": "^7.24.7",
43
+ "@babel/core": "^7.24.9",
44
+ "@babel/eslint-parser": "^7.24.8",
45
45
  "@babel/preset-react": "^7.24.7",
46
46
  "@rushstack/eslint-patch": "^1.10.3",
47
- "@typescript-eslint/eslint-plugin": "^7.13.0",
48
- "@typescript-eslint/parser": "^7.13.0",
47
+ "@typescript-eslint/eslint-plugin": "^7.16.0",
48
+ "@typescript-eslint/parser": "^7.16.0",
49
49
  "confusing-browser-globals": "^1.0.11",
50
50
  "eslint": "^8.57.0",
51
51
  "eslint-config-prettier": "^9.1.0",
@@ -58,41 +58,41 @@
58
58
  "eslint-plugin-jest": "^28.6.0",
59
59
  "eslint-plugin-jest-dom": "^5.4.0",
60
60
  "eslint-plugin-jest-formatting": "^3.1.0",
61
- "eslint-plugin-jsdoc": "^48.2.9",
62
- "eslint-plugin-jsx-a11y": "^6.8.0",
61
+ "eslint-plugin-jsdoc": "^48.7.0",
62
+ "eslint-plugin-jsx-a11y": "^6.9.0",
63
+ "eslint-plugin-n": "^17.9.0",
63
64
  "eslint-plugin-no-only-tests": "^3.1.0",
64
65
  "eslint-plugin-no-snapshot-testing": "^1.0.61",
65
66
  "eslint-plugin-no-typeof-window-undefined": "^0.0.2",
66
- "eslint-plugin-node": "^11.1.0",
67
67
  "eslint-plugin-observers": "^1.0.1",
68
68
  "eslint-plugin-prettier": "^5.1.3",
69
- "eslint-plugin-promise": "^6.2.0",
70
- "eslint-plugin-react": "^7.34.2",
69
+ "eslint-plugin-promise": "^6.4.0",
70
+ "eslint-plugin-react": "^7.34.4",
71
71
  "eslint-plugin-react-hooks": "^4.6.2",
72
72
  "eslint-plugin-react-hooks-ssr": "^0.1.5",
73
73
  "eslint-plugin-sonarjs": "^1.0.3",
74
74
  "eslint-plugin-ssr-friendly": "^1.3.0",
75
75
  "eslint-plugin-storybook": "^0.8.0",
76
- "eslint-plugin-styled-components-a11y": "^2.1.34",
76
+ "eslint-plugin-styled-components-a11y": "^2.1.35",
77
77
  "eslint-plugin-testing-library": "^6.2.2",
78
78
  "eslint-plugin-vitest": "^0.5.4",
79
79
  "eslint-plugin-vitest-globals": "^1.5.0",
80
- "postcss": "^8.4.38",
80
+ "postcss": "^8.4.39",
81
81
  "postcss-scss": "^4.0.9",
82
82
  "postcss-styled-syntax": "^0.6.4",
83
- "prettier": "^3.3.1",
84
- "stylelint": "^16.6.1",
83
+ "prettier": "^3.3.3",
84
+ "stylelint": "^16.7.0",
85
85
  "stylelint-declaration-block-no-ignored-properties": "^2.8.0",
86
- "stylelint-prettier": "^5.0.0",
87
- "stylelint-scss": "^6.3.1"
86
+ "stylelint-prettier": "^5.0.1",
87
+ "stylelint-scss": "^6.4.1"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@commitlint/cli": "^19.3.0",
91
91
  "@commitlint/config-conventional": "^19.2.2",
92
92
  "check-export-map": "^1.3.1",
93
93
  "husky": "^9.0.11",
94
- "typescript": "^5.4.5",
95
- "vitest": "^1.6.0"
94
+ "typescript": "^5.5.3",
95
+ "vitest": "^2.0.3"
96
96
  },
97
97
  "resolutions": {
98
98
  "postcss": ">=8.4.38"
@@ -1,8 +1,8 @@
1
1
  // only add node rules
2
- // see: https://github.com/mysticatea/eslint-plugin-node#-rules
2
+ // see: https://github.com/eslint-community/eslint-plugin-n#-rules
3
3
 
4
4
  module.exports = {
5
- plugins: ['eslint-plugin-node'],
5
+ plugins: ['eslint-plugin-n'],
6
6
 
7
7
  rules: {
8
8
  // Node requires file extensions for ESM imports
@@ -19,154 +19,166 @@ module.exports = {
19
19
  ],
20
20
 
21
21
  // require error handling in callbacks
22
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/handle-callback-err.md
23
- 'node/handle-callback-err': 'error',
22
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/handle-callback-err.md
23
+ 'n/handle-callback-err': 'error',
24
24
 
25
25
  // ensure Node.js-style error-first callback pattern is followed
26
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-callback-literal.md
27
- 'node/no-callback-literal': 'error',
26
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-callback-literal.md
27
+ 'n/no-callback-literal': 'error',
28
28
 
29
29
  // disallow the assignment to exports
30
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-exports-assign.md
31
- 'node/no-exports-assign': 'error',
30
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-exports-assign.md
31
+ 'n/no-exports-assign': 'error',
32
32
 
33
33
  // disallow import declarations which import extraneous modules
34
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-extraneous-import.md
35
- 'node/no-extraneous-import': 'error',
34
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-import.md
35
+ 'n/no-extraneous-import': 'error',
36
36
 
37
37
  // disallow require() expressions which import extraneous modules
38
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-extraneous-require.md
39
- 'node/no-extraneous-require': 'error',
38
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-require.md
39
+ 'n/no-extraneous-require': 'error',
40
40
 
41
41
  // disallow import declarations which import non-existence modules
42
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-missing-import.md
43
- 'node/no-missing-import': 'error',
42
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-import.md
43
+ 'n/no-missing-import': 'error',
44
44
 
45
45
  // disallow require() expressions which import non-existence modules
46
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-missing-require.md
47
- 'node/no-missing-require': 'error',
46
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-require.md
47
+ 'n/no-missing-require': 'error',
48
48
 
49
49
  // disallow new operators with calls to require
50
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-new-require.md
51
- 'node/no-new-require': 'error',
50
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-new-require.md
51
+ 'n/no-new-require': 'error',
52
52
 
53
53
  // disallow string concatenation with __dirname and __filename
54
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-path-concat.md
55
- 'node/no-path-concat': 'error',
54
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-path-concat.md
55
+ 'n/no-path-concat': 'error',
56
56
 
57
57
  // disallow the use of process.exit()
58
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-process-exit.md
59
- 'node/no-process-exit': 'error',
58
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-exit.md
59
+ 'n/no-process-exit': 'error',
60
60
 
61
61
  // disallow bin files that npm ignores
62
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-bin.md
63
- 'node/no-unpublished-bin': 'error',
62
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-bin.md
63
+ 'n/no-unpublished-bin': 'error',
64
64
 
65
65
  // disallow import declarations which import private modules
66
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-import.md
67
- 'node/no-unpublished-import': 'error',
66
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-import.md
67
+ 'n/no-unpublished-import': 'error',
68
68
 
69
69
  // disallow require() expressions which import private modules
70
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-require.md
71
- 'node/no-unpublished-require': 'error',
70
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-require.md
71
+ 'n/no-unpublished-require': 'error',
72
72
 
73
73
  // disallow unsupported ECMAScript built-ins on the specified version
74
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unsupported-features/es-builtins.md
75
- 'node/no-unsupported-features/es-builtins': 'error',
74
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-builtins.md
75
+ 'n/no-unsupported-features/es-builtins': 'error',
76
76
 
77
77
  // disallow unsupported ECMAScript syntax on the specified version
78
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unsupported-features/es-syntax.md
79
- 'node/no-unsupported-features/es-syntax': ['error', { ignores: ['modules'] }],
78
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-syntax.md
79
+ 'n/no-unsupported-features/es-syntax': ['error', { ignores: ['modules'] }],
80
80
 
81
81
  // disallow unsupported Node.js built-in APIs on the specified version
82
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unsupported-features/node-builtins.md
83
- 'node/no-unsupported-features/node-builtins': 'error',
82
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/node-builtins.md
83
+ 'n/no-unsupported-features/node-builtins': 'error',
84
84
 
85
85
  // make process.exit() expressions the same code path as throw
86
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/process-exit-as-throw.md
87
- 'node/process-exit-as-throw': 'error',
86
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/process-exit-as-throw.md
87
+ 'n/process-exit-as-throw': 'error',
88
88
 
89
89
  // suggest correct usage of shebang
90
90
  // decision: turned this off because it expects files to be listed under `bin` in package.json
91
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/shebang.md
92
- 'node/shebang': 'off',
91
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/shebang.md
92
+ 'n/shebang': 'off',
93
93
 
94
94
  // disallow deprecated APIs
95
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md
96
- 'node/no-deprecated-api': 'error',
95
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-deprecated-api.md
96
+ 'n/no-deprecated-api': 'error',
97
97
 
98
98
  // require return statements after callbacks
99
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/callback-return.md
100
- 'node/callback-return': 'error',
99
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/callback-return.md
100
+ 'n/callback-return': 'error',
101
101
 
102
102
  // enforce either module.exports or exports
103
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/exports-style.md
104
- 'node/exports-style': 'error',
103
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/exports-style.md
104
+ 'n/exports-style': 'error',
105
105
 
106
106
  // enforce the style of file extensions in import declarations
107
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/file-extension-in-import.md
108
- 'node/file-extension-in-import': 'off',
107
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/file-extension-in-import.md
108
+ 'n/file-extension-in-import': 'off',
109
109
 
110
110
  // require require() calls to be placed at top-level module scope
111
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/global-require.md
112
- 'node/global-require': 'error',
111
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/global-require.md
112
+ 'n/global-require': 'error',
113
113
 
114
114
  // disallow require calls to be mixed with regular variable declarations
115
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-mixed-requires.md
116
- 'node/no-mixed-requires': 'error',
115
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-mixed-requires.md
116
+ 'n/no-mixed-requires': 'error',
117
117
 
118
118
  // disallow the use of process.env
119
119
  // decision: process.env is used by dotenv
120
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-process-env.md
121
- 'node/no-process-env': 'off',
120
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-env.md
121
+ 'n/no-process-env': 'off',
122
122
 
123
123
  // disallow specified modules when loaded by import declarations
124
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-restricted-import.md
125
- 'node/no-restricted-import': 'error',
124
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-import.md
125
+ 'n/no-restricted-import': 'error',
126
126
 
127
127
  // disallow specified modules when loaded by require
128
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-restricted-require.md
129
- 'node/no-restricted-require': 'error',
128
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-require.md
129
+ 'n/no-restricted-require': 'error',
130
130
 
131
131
  // disallow synchronous methods
132
132
  // decision: it's ok to use synchronous methods occasionally
133
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-sync.md
134
- 'node/no-sync': 'off',
133
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-sync.md
134
+ 'n/no-sync': 'off',
135
135
 
136
136
  // enforce either Buffer or require("buffer").Buffer
137
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/buffer.md
138
- 'node/prefer-global/buffer': 'error',
137
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/buffer.md
138
+ 'n/prefer-global/buffer': 'error',
139
139
 
140
140
  // enforce either console or require("console")
141
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/console.md
142
- 'node/prefer-global/console': 'error',
141
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/console.md
142
+ 'n/prefer-global/console': 'error',
143
143
 
144
144
  // enforce either process or require("process")
145
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/process.md
146
- 'node/prefer-global/process': 'error',
145
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/process.md
146
+ 'n/prefer-global/process': 'error',
147
147
 
148
148
  // enforce either TextDecoder or require("util").TextDecoder
149
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/text-decoder.md
150
- 'node/prefer-global/text-decoder': 'error',
149
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/text-decoder.md
150
+ 'n/prefer-global/text-decoder': 'error',
151
151
 
152
152
  // enforce either TextEncoder or require("util").TextEncoder
153
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/text-encoder.md
154
- 'node/prefer-global/text-encoder': 'error',
153
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/text-encoder.md
154
+ 'n/prefer-global/text-encoder': 'error',
155
155
 
156
156
  // enforce either URLSearchParams or require("url").URLSearchParams
157
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/url-search-params.md
158
- 'node/prefer-global/url-search-params': 'error',
157
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/url-search-params.md
158
+ 'n/prefer-global/url-search-params': 'error',
159
159
 
160
160
  // enforce either URL or require("url").URL
161
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/url.md
162
- 'node/prefer-global/url': 'error',
161
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/url.md
162
+ 'n/prefer-global/url': 'error',
163
163
 
164
164
  // enforce require("dns").promises
165
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-promises/dns.md
166
- 'node/prefer-promises/dns': 'error',
165
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-promises/dns.md
166
+ 'n/prefer-promises/dns': 'error',
167
167
 
168
168
  // enforce require("fs").promises
169
- // https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-promises/fs.md
170
- 'node/prefer-promises/fs': 'error',
169
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-promises/fs.md
170
+ 'n/prefer-promises/fs': 'error',
171
+
172
+ // require correct usage of hashbang
173
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/hashbang.md
174
+ 'n/hashbang': 'error',
175
+
176
+ // disallow third-party modules which are hiding core modules
177
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-hide-core-modules.md
178
+ 'n/no-hide-core-modules': 'error',
179
+
180
+ // enforce using the node: protocol when importing Node.js builtin modules
181
+ // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-node-protocol.md
182
+ 'n/prefer-node-protocol': 'error',
171
183
  },
172
184
  };