@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.
- package/package.json +18 -18
- 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.
|
|
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.
|
|
44
|
-
"@babel/eslint-parser": "^7.24.
|
|
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.
|
|
48
|
-
"@typescript-eslint/parser": "^7.
|
|
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.
|
|
62
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
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.
|
|
70
|
-
"eslint-plugin-react": "^7.34.
|
|
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.
|
|
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.
|
|
80
|
+
"postcss": "^8.4.39",
|
|
81
81
|
"postcss-scss": "^4.0.9",
|
|
82
82
|
"postcss-styled-syntax": "^0.6.4",
|
|
83
|
-
"prettier": "^3.3.
|
|
84
|
-
"stylelint": "^16.
|
|
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.
|
|
87
|
-
"stylelint-scss": "^6.
|
|
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.
|
|
95
|
-
"vitest": "^
|
|
94
|
+
"typescript": "^5.5.3",
|
|
95
|
+
"vitest": "^2.0.3"
|
|
96
96
|
},
|
|
97
97
|
"resolutions": {
|
|
98
98
|
"postcss": ">=8.4.38"
|
package/rules/eslint/node.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// only add node rules
|
|
2
|
-
// see: https://github.com/
|
|
2
|
+
// see: https://github.com/eslint-community/eslint-plugin-n#-rules
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
|
-
plugins: ['eslint-plugin-
|
|
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/
|
|
23
|
-
'
|
|
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/
|
|
27
|
-
'
|
|
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/
|
|
31
|
-
'
|
|
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/
|
|
35
|
-
'
|
|
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/
|
|
39
|
-
'
|
|
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/
|
|
43
|
-
'
|
|
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/
|
|
47
|
-
'
|
|
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/
|
|
51
|
-
'
|
|
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/
|
|
55
|
-
'
|
|
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/
|
|
59
|
-
'
|
|
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/
|
|
63
|
-
'
|
|
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/
|
|
67
|
-
'
|
|
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/
|
|
71
|
-
'
|
|
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/
|
|
75
|
-
'
|
|
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/
|
|
79
|
-
'
|
|
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/
|
|
83
|
-
'
|
|
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/
|
|
87
|
-
'
|
|
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/
|
|
92
|
-
'
|
|
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/
|
|
96
|
-
'
|
|
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/
|
|
100
|
-
'
|
|
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/
|
|
104
|
-
'
|
|
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/
|
|
108
|
-
'
|
|
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/
|
|
112
|
-
'
|
|
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/
|
|
116
|
-
'
|
|
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/
|
|
121
|
-
'
|
|
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/
|
|
125
|
-
'
|
|
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/
|
|
129
|
-
'
|
|
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/
|
|
134
|
-
'
|
|
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/
|
|
138
|
-
'
|
|
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/
|
|
142
|
-
'
|
|
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/
|
|
146
|
-
'
|
|
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/
|
|
150
|
-
'
|
|
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/
|
|
154
|
-
'
|
|
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/
|
|
158
|
-
'
|
|
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/
|
|
162
|
-
'
|
|
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/
|
|
166
|
-
'
|
|
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/
|
|
170
|
-
'
|
|
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
|
};
|