Skip to content

Commit ab17a3c

Browse files
authored
Lint .cjs files in codebase (#569)
1 parent 0a752c7 commit ab17a3c

File tree

2 files changed

+66
-66
lines changed

2 files changed

+66
-66
lines changed

config/plugins.cjs

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ module.exports = {
66
ecmaVersion: 2021,
77
sourceType: 'module',
88
ecmaFeatures: {
9-
jsx: true
10-
}
9+
jsx: true,
10+
},
1111
},
1212
// -- End repeat
1313
plugins: [
@@ -17,17 +17,17 @@ module.exports = {
1717
'promise',
1818
'import',
1919
'node',
20-
'eslint-comments'
20+
'eslint-comments',
2121
],
2222
extends: [
2323
'plugin:ava/recommended',
24-
'plugin:unicorn/recommended'
24+
'plugin:unicorn/recommended',
2525
],
2626
settings: {
2727
'import/core-modules': [
2828
'electron',
29-
'atom'
30-
]
29+
'atom',
30+
],
3131
},
3232
rules: {
3333
'no-use-extend-native/no-use-extend-native': 'error',
@@ -44,91 +44,91 @@ module.exports = {
4444
replacements: {
4545
// https://thenextweb.com/dd/2020/07/13/linux-kernel-will-no-longer-use-terms-blacklist-and-slave/
4646
whitelist: {
47-
allowList: true
47+
allowList: true,
4848
},
4949
blacklist: {
50-
denyList: true
50+
denyList: true,
5151
},
5252
master: {
53-
main: true
53+
main: true,
5454
},
5555
slave: {
56-
secondary: true
56+
secondary: true,
5757
},
5858

5959
// Not part of `eslint-plugin-unicorn`
6060
application: {
61-
app: true
61+
app: true,
6262
},
6363
applications: {
64-
apps: true
64+
apps: true,
6565
},
6666

6767
// Part of `eslint-plugin-unicorn`
6868
arr: {
69-
array: true
69+
array: true,
7070
},
7171
e: {
7272
error: true,
73-
event: true
73+
event: true,
7474
},
7575
el: {
76-
element: true
76+
element: true,
7777
},
7878
elem: {
79-
element: true
79+
element: true,
8080
},
8181
len: {
82-
length: true
82+
length: true,
8383
},
8484
msg: {
85-
message: true
85+
message: true,
8686
},
8787
num: {
88-
number: true
88+
number: true,
8989
},
9090
obj: {
91-
object: true
91+
object: true,
9292
},
9393
opts: {
94-
options: true
94+
options: true,
9595
},
9696
param: {
97-
parameter: true
97+
parameter: true,
9898
},
9999
params: {
100-
parameters: true
100+
parameters: true,
101101
},
102102
prev: {
103-
previous: true
103+
previous: true,
104104
},
105105
req: {
106-
request: true
106+
request: true,
107107
},
108108
res: {
109109
response: true,
110-
result: true
110+
result: true,
111111
},
112112
ret: {
113-
returnValue: true
113+
returnValue: true,
114114
},
115115
str: {
116-
string: true
116+
string: true,
117117
},
118118
temp: {
119-
temporary: true
119+
temporary: true,
120120
},
121121
tmp: {
122-
temporary: true
122+
temporary: true,
123123
},
124124
val: {
125-
value: true
125+
value: true,
126126
},
127127
err: {
128-
error: true
129-
}
130-
}
131-
}
128+
error: true,
129+
},
130+
},
131+
},
132132
],
133133

134134
// TODO: Restore when it becomes safer: https://github.com/sindresorhus/eslint-plugin-unicorn/issues/681
@@ -148,8 +148,8 @@ module.exports = {
148148
'unicorn/better-regex': [
149149
'error',
150150
{
151-
sortCharacterClasses: false
152-
}
151+
sortCharacterClasses: false,
152+
},
153153
],
154154

155155
// TODO: Disabled for now until it becomes more stable: https://github.com/sindresorhus/eslint-plugin-unicorn/search?q=consistent-destructuring+is:issue&state=open&type=issues
@@ -161,7 +161,7 @@ module.exports = {
161161
// We only enforce it for single-line statements to not be too opinionated.
162162
'unicorn/prefer-ternary': [
163163
'error',
164-
'only-single-line'
164+
'only-single-line',
165165
],
166166

167167
// TODO: Remove this override when the rule is more stable.
@@ -177,8 +177,8 @@ module.exports = {
177177
'promise/no-return-wrap': [
178178
'error',
179179
{
180-
allowReject: true
181-
}
180+
allowReject: true,
181+
},
182182
],
183183
'promise/no-new-statics': 'error',
184184
'promise/no-return-in-finally': 'error',
@@ -194,9 +194,9 @@ module.exports = {
194194
// TypeScript doesn't yet support using extensions and fails with error TS2691.
195195
pattern: {
196196
ts: 'never',
197-
tsx: 'never'
198-
}
199-
}
197+
tsx: 'never',
198+
},
199+
},
200200
],
201201
'import/first': 'error',
202202

@@ -207,8 +207,8 @@ module.exports = {
207207
'import/namespace': [
208208
'error',
209209
{
210-
allowComputed: true
211-
}
210+
allowComputed: true,
211+
},
212212
],
213213
'import/no-absolute-path': 'error',
214214
'import/no-anonymous-default-export': 'error',
@@ -218,8 +218,8 @@ module.exports = {
218218
'import/no-cycle': [
219219
'error',
220220
{
221-
ignoreExternal: true
222-
}
221+
ignoreExternal: true,
222+
},
223223
],
224224
'import/no-useless-path-segments': 'error',
225225

@@ -261,9 +261,9 @@ module.exports = {
261261
'**/*.css',
262262
'**/*.scss',
263263
'**/*.sass',
264-
'**/*.less'
265-
]
266-
}
264+
'**/*.less',
265+
],
266+
},
267267
],
268268

269269
// Redundant with `import/no-extraneous-dependencies`.
@@ -283,15 +283,15 @@ module.exports = {
283283
{
284284
// TypeScript doesn't yet support using extensions and fails with error TS2691.
285285
'.ts': 'never',
286-
'.tsx': 'never'
287-
}
286+
'.tsx': 'never',
287+
},
288288
],
289289
'node/no-mixed-requires': [
290290
'error',
291291
{
292292
grouping: true,
293-
allowCall: true
294-
}
293+
allowCall: true,
294+
},
295295
],
296296
'node/no-new-require': 'error',
297297
'node/no-path-concat': 'error',
@@ -325,39 +325,39 @@ module.exports = {
325325
'node/no-deprecated-api': 'error',
326326
'node/prefer-global/buffer': [
327327
'error',
328-
'always'
328+
'always',
329329
],
330330
'node/prefer-global/console': [
331331
'error',
332-
'always'
332+
'always',
333333
],
334334
'node/prefer-global/process': [
335335
'error',
336-
'always'
336+
'always',
337337
],
338338
'node/prefer-global/text-decoder': [
339339
'error',
340-
'always'
340+
'always',
341341
],
342342
'node/prefer-global/text-encoder': [
343343
'error',
344-
'always'
344+
'always',
345345
],
346346
'node/prefer-global/url-search-params': [
347347
'error',
348-
'always'
348+
'always',
349349
],
350350
'node/prefer-global/url': [
351351
'error',
352-
'always'
352+
'always',
353353
],
354354
'node/prefer-promises/dns': 'error',
355355
'node/prefer-promises/fs': 'error',
356356
'eslint-comments/disable-enable-pair': [
357357
'error',
358358
{
359-
allowWholeFile: true
360-
}
359+
allowWholeFile: true,
360+
},
361361
],
362362
'eslint-comments/no-aggregating-enable': 'error',
363363
'eslint-comments/no-duplicate-disable': 'error',
@@ -366,6 +366,6 @@ module.exports = {
366366
// 'eslint-comments/no-unlimited-disable': 'error',
367367

368368
'eslint-comments/no-unused-disable': 'error',
369-
'eslint-comments/no-unused-enable': 'error'
370-
}
369+
'eslint-comments/no-unused-enable': 'error',
370+
},
371371
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"node": ">=12.20"
1717
},
1818
"scripts": {
19-
"test": "eslint --quiet . && nyc ava"
19+
"test": "eslint --quiet . --ext .js,.cjs && nyc ava"
2020
},
2121
"files": [
2222
"config",

0 commit comments

Comments
 (0)