@@ -17,17 +17,22 @@ const internalPackages = getPackages()
17
17
. sort ( ) ;
18
18
19
19
module . exports = {
20
+ env : {
21
+ 'jest/globals' : true ,
22
+ node : true ,
23
+ } ,
20
24
extends : [
21
- 'fb-strict' ,
22
25
'plugin:import/errors' ,
23
- 'plugin:import/typescript' ,
24
26
'prettier' ,
25
- 'prettier/flowtype' ,
26
27
'plugin:eslint-comments/recommended' ,
27
28
] ,
28
29
overrides : [
29
30
{
30
- extends : [ 'plugin:@typescript-eslint/eslint-recommended' ] ,
31
+ extends : [
32
+ 'plugin:@typescript-eslint/eslint-recommended' ,
33
+ 'plugin:import/typescript' ,
34
+ 'prettier/@typescript-eslint' ,
35
+ ] ,
31
36
files : [ '*.ts' , '*.tsx' ] ,
32
37
plugins : [ '@typescript-eslint/eslint-plugin' , 'local' ] ,
33
38
rules : {
@@ -139,34 +144,22 @@ module.exports = {
139
144
rules : {
140
145
'arrow-body-style' : 'off' ,
141
146
'consistent-return' : 'off' ,
142
- 'flowtype/require-valid-file-annotation' : 'off' ,
143
147
'import/no-extraneous-dependencies' : 'off' ,
144
148
'import/no-unresolved' : 'off' ,
145
- 'jest/no-focused-tests' : 'off' ,
146
- 'jest/no-identical-title' : 'off' ,
147
- 'jest/valid-expect' : 'off' ,
149
+ 'no-console' : 'off' ,
148
150
'no-undef' : 'off' ,
149
151
'no-unused-vars' : 'off' ,
150
152
'prettier/prettier' : 'off' ,
151
- 'react/jsx-no-undef' : 'off' ,
152
- 'react/react-in-jsx-scope' : 'off' ,
153
153
'sort-keys' : 'off' ,
154
154
} ,
155
155
} ,
156
156
{
157
157
files : [ 'examples/**/*' ] ,
158
158
rules : {
159
- 'babel/func-params-comma-dangle' : 'off' ,
160
159
'import/no-unresolved' : [ 'error' , { ignore : [ '^react-native$' ] } ] ,
161
160
'import/order' : 'off' ,
162
161
} ,
163
162
} ,
164
- {
165
- files : [ 'scripts/**/*' , 'e2e/**/*' ] ,
166
- rules : {
167
- 'babel/func-params-comma-dangle' : 'off' ,
168
- } ,
169
- } ,
170
163
{
171
164
files : 'packages/jest-types/**/*' ,
172
165
rules : {
@@ -225,23 +218,68 @@ module.exports = {
225
218
} ,
226
219
} ,
227
220
{
228
- files : [ 'test-types/*.test.ts' ] ,
221
+ files : [ 'test-types/*.test.ts' , '*.md' ] ,
229
222
rules : {
230
223
'jest/no-focused-tests' : 'off' ,
231
224
'jest/no-identical-title' : 'off' ,
232
225
'jest/valid-expect' : 'off' ,
233
226
} ,
234
227
} ,
228
+ {
229
+ files : [
230
+ 'scripts/*' ,
231
+ 'packages/jest-cli/src/init/index.ts' ,
232
+ 'packages/jest-repl/src/cli/runtime-cli.ts' ,
233
+ ] ,
234
+ rules : {
235
+ 'no-console' : 'off' ,
236
+ } ,
237
+ } ,
238
+ {
239
+ files : [
240
+ 'e2e/**' ,
241
+ 'examples/**' ,
242
+ 'scripts/*' ,
243
+ 'website/**' ,
244
+ '**/__mocks__/**' ,
245
+ '**/__tests__/**' ,
246
+ '**/__performance_tests__/**' ,
247
+ 'packages/diff-sequences/perf/index.js' ,
248
+ 'packages/pretty-format/perf/test.js'
249
+ ] ,
250
+ rules : {
251
+ 'import/no-unresolved' : 'off' ,
252
+ 'no-console' : 'off' ,
253
+ 'no-unused-vars' : 'off' ,
254
+ } ,
255
+ } ,
235
256
] ,
236
257
parser : '@typescript-eslint/parser' ,
237
- plugins : [ 'markdown' , 'import' , 'prettier' , 'eslint-comments' ] ,
258
+ parserOptions : {
259
+ sourceType : 'module' ,
260
+ } ,
261
+ plugins : [ 'markdown' , 'import' , 'jest' ] ,
238
262
rules : {
239
- 'arrow-body-style' : 'error' ,
263
+ 'accessor-pairs' : [ 'warn' , { setWithoutGet : true } ] ,
264
+ 'block-scoped-var' : 'off' ,
265
+ 'callback-return' : 'off' ,
266
+ camelcase : [ 'off' , { properties : 'always' } ] ,
267
+ complexity : 'off' ,
268
+ 'consistent-return' : 'warn' ,
269
+ 'consistent-this' : [ 'off' , 'self' ] ,
270
+ 'constructor-super' : 'error' ,
271
+ 'default-case' : 'off' ,
272
+ 'dot-notation' : 'off' ,
273
+ eqeqeq : [ 'off' , 'allow-null' ] ,
240
274
'eslint-comments/disable-enable-pair' : [ 'error' , { allowWholeFile : true } ] ,
241
275
'eslint-comments/no-unused-disable' : 'error' ,
242
- 'flowtype/boolean-style' : 'error' ,
243
- 'flowtype/no-primitive-constructor-types' : 'error' ,
244
- 'flowtype/require-valid-file-annotation' : 'error' ,
276
+ 'func-names' : 'off' ,
277
+ 'func-style' : [ 'off' , 'declaration' ] ,
278
+ 'global-require' : 'off' ,
279
+ 'guard-for-in' : 'off' ,
280
+ 'handle-callback-err' : 'off' ,
281
+ 'id-length' : 'off' ,
282
+ 'id-match' : 'off' ,
245
283
'import/no-duplicates' : 'error' ,
246
284
'import/no-extraneous-dependencies' : [
247
285
'error' ,
@@ -277,17 +315,153 @@ module.exports = {
277
315
'newlines-between' : 'never' ,
278
316
} ,
279
317
] ,
280
- 'no-console' : 'off' ,
318
+ 'init-declarations' : 'off' ,
319
+ 'jest/no-focused-tests' : 'error' ,
320
+ 'jest/no-identical-title' : 'error' ,
321
+ 'jest/valid-expect' : 'error' ,
322
+ 'lines-around-comment' : 'off' ,
323
+ 'max-depth' : 'off' ,
324
+ 'max-nested-callbacks' : 'off' ,
325
+ 'max-params' : 'off' ,
326
+ 'max-statements' : 'off' ,
327
+ 'new-cap' : 'off' ,
328
+ 'new-parens' : 'error' ,
329
+ 'newline-after-var' : 'off' ,
330
+ 'no-alert' : 'off' ,
331
+ 'no-array-constructor' : 'error' ,
332
+ 'no-bitwise' : 'warn' ,
333
+ 'no-caller' : 'error' ,
334
+ 'no-case-declarations' : 'off' ,
335
+ 'no-catch-shadow' : 'error' ,
336
+ 'no-class-assign' : 'warn' ,
337
+ 'no-cond-assign' : 'off' ,
338
+ 'no-confusing-arrow' : 'off' ,
339
+ 'no-console' : [
340
+ 'warn' ,
341
+ { allow : [ 'warn' , 'error' , 'time' , 'timeEnd' , 'timeStamp' ] } ,
342
+ ] ,
343
+ 'no-const-assign' : 'error' ,
344
+ 'no-constant-condition' : 'off' ,
345
+ 'no-continue' : 'off' ,
346
+ 'no-control-regex' : 'off' ,
347
+ 'no-debugger' : 'error' ,
348
+ 'no-delete-var' : 'error' ,
349
+ 'no-div-regex' : 'off' ,
350
+ 'no-dupe-args' : 'error' ,
351
+ 'no-dupe-class-members' : 'error' ,
352
+ 'no-dupe-keys' : 'error' ,
353
+ 'no-duplicate-case' : 'warn' ,
354
+ 'no-else-return' : 'off' ,
355
+ 'no-empty' : 'off' ,
356
+ 'no-empty-character-class' : 'warn' ,
357
+ 'no-empty-pattern' : 'warn' ,
358
+ 'no-eq-null' : 'off' ,
359
+ 'no-eval' : 'error' ,
360
+ 'no-ex-assign' : 'warn' ,
361
+ 'no-extend-native' : 'warn' ,
362
+ 'no-extra-bind' : 'warn' ,
363
+ 'no-extra-boolean-cast' : 'warn' ,
364
+ 'no-fallthrough' : 'warn' ,
365
+ 'no-floating-decimal' : 'error' ,
366
+ 'no-func-assign' : 'error' ,
367
+ 'no-implicit-coercion' : 'off' ,
368
+ 'no-implied-eval' : 'error' ,
369
+ 'no-inline-comments' : 'off' ,
370
+ 'no-inner-declarations' : 'off' ,
371
+ 'no-invalid-regexp' : 'warn' ,
372
+ 'no-invalid-this' : 'off' ,
373
+ 'no-irregular-whitespace' : 'error' ,
374
+ 'no-iterator' : 'off' ,
375
+ 'no-label-var' : 'warn' ,
376
+ 'no-labels' : [ 'error' , { allowLoop : true , allowSwitch : true } ] ,
377
+ 'no-lonely-if' : 'off' ,
378
+ 'no-loop-func' : 'off' ,
379
+ 'no-magic-numbers' : 'off' ,
380
+ 'no-mixed-requires' : 'off' ,
381
+ 'no-mixed-spaces-and-tabs' : 'error' ,
382
+ 'no-multi-str' : 'error' ,
383
+ 'no-multiple-empty-lines' : 'off' ,
384
+ 'no-native-reassign' : [ 'error' , { exceptions : [ 'Map' , 'Set' ] } ] ,
385
+ 'no-negated-condition' : 'off' ,
386
+ 'no-negated-in-lhs' : 'error' ,
387
+ 'no-nested-ternary' : 'off' ,
388
+ 'no-new' : 'warn' ,
389
+ 'no-new-func' : 'error' ,
390
+ 'no-new-object' : 'warn' ,
391
+ 'no-new-require' : 'off' ,
392
+ 'no-new-wrappers' : 'warn' ,
393
+ 'no-obj-calls' : 'error' ,
394
+ 'no-octal' : 'warn' ,
395
+ 'no-octal-escape' : 'warn' ,
396
+ 'no-param-reassign' : 'off' ,
397
+ 'no-path-concat' : 'off' ,
398
+ 'no-plusplus' : 'off' ,
399
+ 'no-process-env' : 'off' ,
400
+ 'no-process-exit' : 'off' ,
401
+ 'no-proto' : 'error' ,
402
+ 'no-redeclare' : 'warn' ,
403
+ 'no-regex-spaces' : 'warn' ,
281
404
'no-restricted-imports' : [
282
405
'error' ,
283
- {
284
- message : 'Please use graceful-fs instead.' ,
285
- name : 'fs' ,
286
- } ,
406
+ { message : 'Please use graceful-fs instead.' , name : 'fs' } ,
407
+ ] ,
408
+ 'no-restricted-modules' : 'off' ,
409
+ 'no-restricted-syntax' : 'off' ,
410
+ 'no-return-assign' : 'off' ,
411
+ 'no-script-url' : 'error' ,
412
+ 'no-self-compare' : 'warn' ,
413
+ 'no-sequences' : 'warn' ,
414
+ 'no-shadow' : 'off' ,
415
+ 'no-shadow-restricted-names' : 'warn' ,
416
+ 'no-sparse-arrays' : 'error' ,
417
+ 'no-sync' : 'off' ,
418
+ 'no-ternary' : 'off' ,
419
+ 'no-this-before-super' : 'error' ,
420
+ 'no-throw-literal' : 'error' ,
421
+ 'no-undef' : 'error' ,
422
+ 'no-undef-init' : 'off' ,
423
+ 'no-undefined' : 'off' ,
424
+ 'no-underscore-dangle' : 'off' ,
425
+ 'no-unneeded-ternary' : 'warn' ,
426
+ 'no-unreachable' : 'error' ,
427
+ 'no-unused-expressions' : 'off' ,
428
+ 'no-unused-vars' : [ 'error' , { argsIgnorePattern : '^_' } ] ,
429
+ 'no-use-before-define' : 'off' ,
430
+ 'no-useless-call' : 'warn' ,
431
+ 'no-useless-computed-key' : 'error' ,
432
+ 'no-useless-concat' : 'warn' ,
433
+ 'no-var' : 'error' ,
434
+ 'no-void' : 'off' ,
435
+ 'no-warn-comments' : 'off' ,
436
+ 'no-with' : 'off' ,
437
+ 'object-shorthand' : 'error' ,
438
+ 'one-var' : [ 'warn' , { initialized : 'never' } ] ,
439
+ 'operator-assignment' : [ 'warn' , 'always' ] ,
440
+ 'operator-linebreak' : 'off' ,
441
+ 'padded-blocks' : 'off' ,
442
+ 'prefer-arrow-callback' : [ 'error' , { allowNamedFunctions : true } ] ,
443
+ 'prefer-const' : 'error' ,
444
+ 'prefer-template' : 'off' ,
445
+ quotes : [
446
+ 'error' ,
447
+ 'single' ,
448
+ { allowTemplateLiterals : true , avoidEscape : true } ,
287
449
] ,
288
- 'no-unused-vars' : 'error' ,
289
- 'prettier/prettier' : 'error' ,
450
+ radix : 'warn' ,
451
+ 'require-jsdoc' : 'off' ,
452
+ 'require-yield' : 'off' ,
290
453
'sort-imports' : [ 'error' , { ignoreDeclarationSort : true } ] ,
454
+ 'sort-keys' : 'error' ,
455
+ 'sort-vars' : 'off' ,
456
+ 'spaced-comment' : [ 'off' , 'always' , { exceptions : [ 'eslint' , 'global' ] } ] ,
457
+ strict : 'off' ,
458
+ 'use-isnan' : 'error' ,
459
+ 'valid-jsdoc' : 'off' ,
460
+ 'valid-typeof' : 'error' ,
461
+ 'vars-on-top' : 'off' ,
462
+ 'wrap-iife' : 'off' ,
463
+ 'wrap-regex' : 'off' ,
464
+ yoda : 'off' ,
291
465
} ,
292
466
settings : {
293
467
'import/ignore' : [ 'react-native' ] ,
0 commit comments