6
6
node : true
7
7
reportUnusedDisableDirectives : true
8
8
plugins :
9
+ - graphql-internal
9
10
- flowtype
11
+ - node
12
+ - istanbul
10
13
- import
11
14
12
15
rules :
13
16
# #############################################################################
14
- # `eslint-plugin-flowtype` rule list based on `v4.6.x`
17
+ # Internal rules located in 'resources/eslint-rules'.
18
+ # See './resources/eslint-rules/README.md'
19
+ # #############################################################################
20
+
21
+ graphql-internal/no-dir-import : error
22
+
23
+ # #############################################################################
24
+ # `eslint-plugin-flowtype` rule list based on `v5.1.x`
15
25
# https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype
16
26
# #############################################################################
17
27
@@ -58,6 +68,66 @@ rules:
58
68
flowtype/space-before-type-colon : off
59
69
flowtype/union-intersection-spacing : off
60
70
71
+ # #############################################################################
72
+ # `eslint-plugin-istanbul` rule list based on `v0.1.1`
73
+ # https://github.com/istanbuljs/eslint-plugin-istanbul#rules
74
+ # #############################################################################
75
+
76
+ istanbul/no-ignore-file : error
77
+ istanbul/prefer-ignore-reason : error
78
+
79
+ # #############################################################################
80
+ # `eslint-plugin-node` rule list based on `v11.1.x`
81
+ # #############################################################################
82
+
83
+ # Possible Errors
84
+ # https://github.com/mysticatea/eslint-plugin-node#possible-errors
85
+
86
+ node/handle-callback-err : [error, error]
87
+ node/no-callback-literal : error
88
+ node/no-exports-assign : error
89
+ node/no-extraneous-import : error
90
+ node/no-extraneous-require : error
91
+ node/no-missing-import : error
92
+ node/no-missing-require : error
93
+ node/no-new-require : error
94
+ node/no-path-concat : error
95
+ node/no-process-exit : off
96
+ node/no-unpublished-bin : error
97
+ node/no-unpublished-import : error
98
+ node/no-unpublished-require : error
99
+ node/no-unsupported-features/es-builtins : error
100
+ node/no-unsupported-features/es-syntax : off # TODO enable
101
+ node/no-unsupported-features/node-builtins : off # TODO enable
102
+ node/process-exit-as-throw : error
103
+ node/shebang : error
104
+
105
+ # Best Practices
106
+ # https://github.com/mysticatea/eslint-plugin-node#best-practices
107
+ node/no-deprecated-api : error
108
+
109
+ # Stylistic Issues
110
+ # https://github.com/mysticatea/eslint-plugin-node#stylistic-issues
111
+
112
+ node/callback-return : error
113
+ node/exports-style : off # TODO consider
114
+ node/file-extension-in-import : off # TODO consider
115
+ node/global-require : error
116
+ node/no-mixed-requires : error
117
+ node/no-process-env : off
118
+ node/no-restricted-import : off
119
+ node/no-restricted-require : off
120
+ node/no-sync : error
121
+ node/prefer-global/buffer : error
122
+ node/prefer-global/console : error
123
+ node/prefer-global/process : error
124
+ node/prefer-global/text-decoder : error
125
+ node/prefer-global/text-encoder : error
126
+ node/prefer-global/url-search-params : error
127
+ node/prefer-global/url : error
128
+ node/prefer-promises/dns : off
129
+ node/prefer-promises/fs : off
130
+
61
131
# #############################################################################
62
132
# `eslint-plugin-import` rule list based on `v2.20.x`
63
133
# #############################################################################
@@ -68,7 +138,12 @@ rules:
68
138
import/named : error
69
139
import/default : error
70
140
import/namespace : error
71
- import/no-restricted-paths : off
141
+ import/no-restricted-paths :
142
+ - error
143
+ - basePath : ' ./'
144
+ zones :
145
+ - { target: './src', from: 'src/__testUtils__' }
146
+ - { target: './src', from: 'src/__fixtures__' }
72
147
import/no-absolute-path : error
73
148
import/no-dynamic-require : error
74
149
import/no-internal-modules : off
@@ -115,7 +190,7 @@ rules:
115
190
import/dynamic-import-chunkname : off
116
191
117
192
# #############################################################################
118
- # ESLint builtin rules list based on `v6.8 .x`
193
+ # ESLint builtin rules list based on `v7.1 .x`
119
194
# #############################################################################
120
195
121
196
# Possible Errors
@@ -144,6 +219,7 @@ rules:
144
219
no-inner-declarations : [error, both]
145
220
no-invalid-regexp : error
146
221
no-irregular-whitespace : error
222
+ no-loss-of-precision : error
147
223
no-misleading-character-class : error
148
224
no-obj-calls : error
149
225
no-prototype-builtins : error
@@ -154,6 +230,7 @@ rules:
154
230
no-unreachable : error
155
231
no-unsafe-finally : error
156
232
no-unsafe-negation : error
233
+ no-useless-backreference : error
157
234
require-atomic-updates : error
158
235
use-isnan : error
159
236
valid-typeof : error
@@ -169,8 +246,9 @@ rules:
169
246
consistent-return : off
170
247
curly : error
171
248
default-case : off
249
+ default-case-last : error
172
250
default-param-last : error
173
- dot-notation : off
251
+ dot-notation : error
174
252
eqeqeq : [error, smart]
175
253
grouped-accessor-pairs : error
176
254
guard-for-in : error
@@ -193,7 +271,7 @@ rules:
193
271
no-implicit-coercion : error
194
272
no-implicit-globals : off
195
273
no-implied-eval : error
196
- no-invalid-this : off
274
+ no-invalid-this : error
197
275
no-iterator : error
198
276
no-labels : error
199
277
no-lone-blocks : error
@@ -256,21 +334,6 @@ rules:
256
334
no-unused-vars : [error, { vars: all, args: all, argsIgnorePattern: '^_' }]
257
335
no-use-before-define : off
258
336
259
- # Node.js and CommonJS
260
- # https://eslint.org/docs/rules/#nodejs-and-commonjs
261
-
262
- callback-return : error
263
- global-require : error
264
- handle-callback-err : [error, error]
265
- no-buffer-constructor : error
266
- no-mixed-requires : error
267
- no-new-require : error
268
- no-path-concat : error
269
- no-process-env : off
270
- no-process-exit : off
271
- no-restricted-modules : off
272
- no-sync : error
273
-
274
337
# Stylistic Issues
275
338
# https://eslint.org/docs/rules/#stylistic-issues
276
339
@@ -336,6 +399,7 @@ rules:
336
399
no-dupe-class-members : error
337
400
no-duplicate-imports : error
338
401
no-new-symbol : error
402
+ no-restricted-exports : off
339
403
no-restricted-imports : off
340
404
no-this-before-super : error
341
405
no-useless-computed-key : error
@@ -429,27 +493,34 @@ overrides:
429
493
- ' @typescript-eslint'
430
494
extends :
431
495
- plugin:import/typescript
496
+ settings :
497
+ node :
498
+ tryExtensions : ['.js', '.json', '.node', '.ts', '.d.ts']
432
499
rules :
433
500
flowtype/require-valid-file-annotation : off
501
+ flowtype/no-types-missing-file-annotation : off
434
502
435
503
# #########################################################################
436
- # `@typescript-eslint/eslint-plugin` rule list based on `v2.21 .x`
504
+ # `@typescript-eslint/eslint-plugin` rule list based on `v3.0 .x`
437
505
# #########################################################################
438
506
439
507
# Supported Rules
440
508
# https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
441
509
' @typescript-eslint/adjacent-overload-signatures ' : error
442
510
' @typescript-eslint/array-type ' : [error, { default: generic }]
443
511
' @typescript-eslint/await-thenable ' : error
444
- ' @typescript-eslint/ban-ts-comment ' : error
512
+ ' @typescript-eslint/ban-ts-comment ' :
513
+ [error, { 'ts-expect-error' : ' allow-with-description' }]
445
514
' @typescript-eslint/ban-types ' : error
515
+ ' @typescript-eslint/class-literal-property-style ' : off
446
516
' @typescript-eslint/consistent-type-assertions ' :
447
517
[error, { assertionStyle : as, objectLiteralTypeAssertions: never }]
448
518
' @typescript-eslint/consistent-type-definitions ' : off # TODO consider
449
519
' @typescript-eslint/explicit-function-return-type ' : off # TODO consider
450
520
' @typescript-eslint/explicit-member-accessibility ' : off # TODO consider
451
521
' @typescript-eslint/explicit-module-boundary-types ' : off # TODO consider
452
522
' @typescript-eslint/member-ordering ' : off # TODO consider
523
+ ' @typescript-eslint/method-signature-style ' : error
453
524
' @typescript-eslint/naming-convention ' : off # TODO consider
454
525
' @typescript-eslint/no-base-to-string ' : error
455
526
' @typescript-eslint/no-dynamic-delete ' : off
@@ -468,6 +539,7 @@ overrides:
468
539
' @typescript-eslint/no-non-null-asserted-optional-chain ' : error
469
540
' @typescript-eslint/no-non-null-assertion ' : error
470
541
' @typescript-eslint/no-parameter-properties ' : error
542
+ ' @typescript-eslint/no-invalid-void-type ' : error
471
543
' @typescript-eslint/no-require-imports ' : error
472
544
' @typescript-eslint/no-this-alias ' : error
473
545
' @typescript-eslint/no-throw-literal ' : error
@@ -477,6 +549,10 @@ overrides:
477
549
' @typescript-eslint/no-unnecessary-qualifier ' : error
478
550
' @typescript-eslint/no-unnecessary-type-arguments ' : error
479
551
' @typescript-eslint/no-unnecessary-type-assertion ' : error
552
+ ' @typescript-eslint/no-unsafe-assignment ' : off # TODO consider
553
+ ' @typescript-eslint/no-unsafe-call ' : off # TODO consider
554
+ ' @typescript-eslint/no-unsafe-member-access ' : off # TODO consider
555
+ ' @typescript-eslint/no-unsafe-return ' : off # TODO consider
480
556
' @typescript-eslint/no-unused-vars-experimental ' : off
481
557
' @typescript-eslint/no-var-requires ' : error
482
558
' @typescript-eslint/prefer-as-const ' : off # TODO consider
@@ -487,8 +563,10 @@ overrides:
487
563
' @typescript-eslint/prefer-nullish-coalescing ' : error
488
564
' @typescript-eslint/prefer-optional-chain ' : error
489
565
' @typescript-eslint/prefer-readonly ' : error
490
- ' @typescript-eslint/prefer-readonly-parameter-types ' : off # FIXME: crash eslint
566
+ ' @typescript-eslint/prefer-readonly-parameter-types ' : off # TODO consider
567
+ ' @typescript-eslint/prefer-reduce-type-parameter ' : error
491
568
' @typescript-eslint/prefer-regexp-exec ' : error
569
+ ' @typescript-eslint/prefer-ts-expect-error ' : error
492
570
' @typescript-eslint/prefer-string-starts-ends-with ' : off # TODO switch to error after IE11 drop
493
571
' @typescript-eslint/promise-function-async ' : off
494
572
' @typescript-eslint/require-array-sort-compare ' : error
@@ -507,18 +585,25 @@ overrides:
507
585
508
586
# Disable conflicting ESLint rules and enable TS-compatible ones
509
587
default-param-last : off
588
+ dot-notation : off
589
+ lines-between-class-members : off
510
590
no-array-constructor : off
511
591
no-dupe-class-members : off
512
592
no-empty-function : off
593
+ no-invalid-this : off
513
594
no-unused-expressions : off
514
595
no-unused-vars : off
515
596
no-useless-constructor : off
516
597
require-await : off
517
598
no-return-await : off
518
599
' @typescript-eslint/default-param-last ' : error
519
- ' @typescript-eslint/no-dupe-class-members ' : error
600
+ ' @typescript-eslint/dot-notation ' : error
601
+ ' @typescript-eslint/lines-between-class-members ' :
602
+ [error, always, { exceptAfterSingleLine : true }]
520
603
' @typescript-eslint/no-array-constructor ' : error
604
+ ' @typescript-eslint/no-dupe-class-members ' : error
521
605
' @typescript-eslint/no-empty-function ' : error
606
+ ' @typescript-eslint/no-invalid-this ' : error
522
607
' @typescript-eslint/no-unused-expressions ' : error
523
608
' @typescript-eslint/no-unused-vars ' :
524
609
[error, { vars : all, args: all, argsIgnorePattern: '^_' }]
@@ -527,6 +612,7 @@ overrides:
527
612
' @typescript-eslint/return-await ' : error
528
613
529
614
# Disable for JS, Flow and TS
615
+ ' @typescript-eslint/init-declarations ' : off
530
616
' @typescript-eslint/no-magic-numbers ' : off
531
617
' @typescript-eslint/no-use-before-define ' : off
532
618
@@ -537,6 +623,7 @@ overrides:
537
623
' @typescript-eslint/comma-spacing ' : off
538
624
' @typescript-eslint/func-call-spacing ' : off
539
625
' @typescript-eslint/indent ' : off
626
+ ' @typescript-eslint/keyword-spacing ' : off
540
627
' @typescript-eslint/member-delimiter-style ' : off
541
628
' @typescript-eslint/no-extra-parens ' : off
542
629
' @typescript-eslint/no-extra-semi ' : off
@@ -545,19 +632,25 @@ overrides:
545
632
' @typescript-eslint/type-annotation-spacing ' : off
546
633
- files : ' **/__*__/**'
547
634
rules :
548
- import/no-extraneous-dependencies : off
635
+ node/no-unpublished-import : off
636
+ node/no-unpublished-require : off
637
+ import/no-restricted-paths : off
638
+ import/no-extraneous-dependencies : [error, { devDependencies: true }]
549
639
import/no-nodejs-modules : off
550
640
no-restricted-syntax : off
551
641
- files : ' resources/**'
552
642
parserOptions :
553
643
sourceType : script
554
644
rules :
645
+ node/no-unpublished-import : off
646
+ node/no-unpublished-require : off
647
+ node/no-missing-require : off
648
+ node/no-sync : off
649
+ node/global-require : off
555
650
import/no-dynamic-require : off
556
- import/no-extraneous-dependencies : off
651
+ import/no-extraneous-dependencies : [error, { devDependencies: true }]
557
652
import/no-nodejs-modules : off
558
653
import/no-commonjs : off
559
654
no-await-in-loop : off
560
655
no-restricted-syntax : off
561
656
no-console : off
562
- no-sync : off
563
- global-require : off
0 commit comments