Skip to content

Commit 4881a33

Browse files
committed
Merge branch 'master' into ts-extensions
2 parents 1135020 + 056a6e4 commit 4881a33

File tree

187 files changed

+20755
-8979
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+20755
-8979
lines changed

.babelrc.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
],
77
"overrides": [
88
{
9-
"exclude": ["**/__tests__/**/*", "**/__fixtures__/**/*"],
9+
"exclude": [
10+
"src/__testUtils__/**/*",
11+
"**/__tests__/**/*",
12+
"**/__fixtures__/**/*"
13+
],
1014
"presets": ["@babel/preset-env"],
1115
"plugins": [
1216
["@babel/plugin-transform-classes", { "loose": true }],

.eslintrc.yml

Lines changed: 121 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,22 @@ env:
66
node: true
77
reportUnusedDisableDirectives: true
88
plugins:
9+
- graphql-internal
910
- flowtype
11+
- node
12+
- istanbul
1013
- import
1114

1215
rules:
1316
##############################################################################
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`
1525
# https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype
1626
##############################################################################
1727

@@ -58,6 +68,66 @@ rules:
5868
flowtype/space-before-type-colon: off
5969
flowtype/union-intersection-spacing: off
6070

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+
61131
##############################################################################
62132
# `eslint-plugin-import` rule list based on `v2.20.x`
63133
##############################################################################
@@ -68,7 +138,12 @@ rules:
68138
import/named: error
69139
import/default: error
70140
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__' }
72147
import/no-absolute-path: error
73148
import/no-dynamic-require: error
74149
import/no-internal-modules: off
@@ -115,7 +190,7 @@ rules:
115190
import/dynamic-import-chunkname: off
116191

117192
##############################################################################
118-
# ESLint builtin rules list based on `v6.8.x`
193+
# ESLint builtin rules list based on `v7.1.x`
119194
##############################################################################
120195

121196
# Possible Errors
@@ -144,6 +219,7 @@ rules:
144219
no-inner-declarations: [error, both]
145220
no-invalid-regexp: error
146221
no-irregular-whitespace: error
222+
no-loss-of-precision: error
147223
no-misleading-character-class: error
148224
no-obj-calls: error
149225
no-prototype-builtins: error
@@ -154,6 +230,7 @@ rules:
154230
no-unreachable: error
155231
no-unsafe-finally: error
156232
no-unsafe-negation: error
233+
no-useless-backreference: error
157234
require-atomic-updates: error
158235
use-isnan: error
159236
valid-typeof: error
@@ -169,8 +246,9 @@ rules:
169246
consistent-return: off
170247
curly: error
171248
default-case: off
249+
default-case-last: error
172250
default-param-last: error
173-
dot-notation: off
251+
dot-notation: error
174252
eqeqeq: [error, smart]
175253
grouped-accessor-pairs: error
176254
guard-for-in: error
@@ -193,7 +271,7 @@ rules:
193271
no-implicit-coercion: error
194272
no-implicit-globals: off
195273
no-implied-eval: error
196-
no-invalid-this: off
274+
no-invalid-this: error
197275
no-iterator: error
198276
no-labels: error
199277
no-lone-blocks: error
@@ -256,21 +334,6 @@ rules:
256334
no-unused-vars: [error, { vars: all, args: all, argsIgnorePattern: '^_' }]
257335
no-use-before-define: off
258336

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-
274337
# Stylistic Issues
275338
# https://eslint.org/docs/rules/#stylistic-issues
276339

@@ -336,6 +399,7 @@ rules:
336399
no-dupe-class-members: error
337400
no-duplicate-imports: error
338401
no-new-symbol: error
402+
no-restricted-exports: off
339403
no-restricted-imports: off
340404
no-this-before-super: error
341405
no-useless-computed-key: error
@@ -429,27 +493,34 @@ overrides:
429493
- '@typescript-eslint'
430494
extends:
431495
- plugin:import/typescript
496+
settings:
497+
node:
498+
tryExtensions: ['.js', '.json', '.node', '.ts', '.d.ts']
432499
rules:
433500
flowtype/require-valid-file-annotation: off
501+
flowtype/no-types-missing-file-annotation: off
434502

435503
##########################################################################
436-
# `@typescript-eslint/eslint-plugin` rule list based on `v2.21.x`
504+
# `@typescript-eslint/eslint-plugin` rule list based on `v3.0.x`
437505
##########################################################################
438506

439507
# Supported Rules
440508
# https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
441509
'@typescript-eslint/adjacent-overload-signatures': error
442510
'@typescript-eslint/array-type': [error, { default: generic }]
443511
'@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' }]
445514
'@typescript-eslint/ban-types': error
515+
'@typescript-eslint/class-literal-property-style': off
446516
'@typescript-eslint/consistent-type-assertions':
447517
[error, { assertionStyle: as, objectLiteralTypeAssertions: never }]
448518
'@typescript-eslint/consistent-type-definitions': off # TODO consider
449519
'@typescript-eslint/explicit-function-return-type': off # TODO consider
450520
'@typescript-eslint/explicit-member-accessibility': off # TODO consider
451521
'@typescript-eslint/explicit-module-boundary-types': off # TODO consider
452522
'@typescript-eslint/member-ordering': off # TODO consider
523+
'@typescript-eslint/method-signature-style': error
453524
'@typescript-eslint/naming-convention': off # TODO consider
454525
'@typescript-eslint/no-base-to-string': error
455526
'@typescript-eslint/no-dynamic-delete': off
@@ -468,6 +539,7 @@ overrides:
468539
'@typescript-eslint/no-non-null-asserted-optional-chain': error
469540
'@typescript-eslint/no-non-null-assertion': error
470541
'@typescript-eslint/no-parameter-properties': error
542+
'@typescript-eslint/no-invalid-void-type': error
471543
'@typescript-eslint/no-require-imports': error
472544
'@typescript-eslint/no-this-alias': error
473545
'@typescript-eslint/no-throw-literal': error
@@ -477,6 +549,10 @@ overrides:
477549
'@typescript-eslint/no-unnecessary-qualifier': error
478550
'@typescript-eslint/no-unnecessary-type-arguments': error
479551
'@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
480556
'@typescript-eslint/no-unused-vars-experimental': off
481557
'@typescript-eslint/no-var-requires': error
482558
'@typescript-eslint/prefer-as-const': off # TODO consider
@@ -487,8 +563,10 @@ overrides:
487563
'@typescript-eslint/prefer-nullish-coalescing': error
488564
'@typescript-eslint/prefer-optional-chain': error
489565
'@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
491568
'@typescript-eslint/prefer-regexp-exec': error
569+
'@typescript-eslint/prefer-ts-expect-error': error
492570
'@typescript-eslint/prefer-string-starts-ends-with': off # TODO switch to error after IE11 drop
493571
'@typescript-eslint/promise-function-async': off
494572
'@typescript-eslint/require-array-sort-compare': error
@@ -507,18 +585,25 @@ overrides:
507585

508586
# Disable conflicting ESLint rules and enable TS-compatible ones
509587
default-param-last: off
588+
dot-notation: off
589+
lines-between-class-members: off
510590
no-array-constructor: off
511591
no-dupe-class-members: off
512592
no-empty-function: off
593+
no-invalid-this: off
513594
no-unused-expressions: off
514595
no-unused-vars: off
515596
no-useless-constructor: off
516597
require-await: off
517598
no-return-await: off
518599
'@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 }]
520603
'@typescript-eslint/no-array-constructor': error
604+
'@typescript-eslint/no-dupe-class-members': error
521605
'@typescript-eslint/no-empty-function': error
606+
'@typescript-eslint/no-invalid-this': error
522607
'@typescript-eslint/no-unused-expressions': error
523608
'@typescript-eslint/no-unused-vars':
524609
[error, { vars: all, args: all, argsIgnorePattern: '^_' }]
@@ -527,6 +612,7 @@ overrides:
527612
'@typescript-eslint/return-await': error
528613

529614
# Disable for JS, Flow and TS
615+
'@typescript-eslint/init-declarations': off
530616
'@typescript-eslint/no-magic-numbers': off
531617
'@typescript-eslint/no-use-before-define': off
532618

@@ -537,6 +623,7 @@ overrides:
537623
'@typescript-eslint/comma-spacing': off
538624
'@typescript-eslint/func-call-spacing': off
539625
'@typescript-eslint/indent': off
626+
'@typescript-eslint/keyword-spacing': off
540627
'@typescript-eslint/member-delimiter-style': off
541628
'@typescript-eslint/no-extra-parens': off
542629
'@typescript-eslint/no-extra-semi': off
@@ -545,19 +632,25 @@ overrides:
545632
'@typescript-eslint/type-annotation-spacing': off
546633
- files: '**/__*__/**'
547634
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 }]
549639
import/no-nodejs-modules: off
550640
no-restricted-syntax: off
551641
- files: 'resources/**'
552642
parserOptions:
553643
sourceType: script
554644
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
555650
import/no-dynamic-require: off
556-
import/no-extraneous-dependencies: off
651+
import/no-extraneous-dependencies: [error, { devDependencies: true }]
557652
import/no-nodejs-modules: off
558653
import/no-commonjs: off
559654
no-await-in-loop: off
560655
no-restricted-syntax: off
561656
no-console: off
562-
no-sync: off
563-
global-require: off

.flowconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
!<PROJECT_ROOT>/src
44
!<PROJECT_ROOT>/node_modules/chai
55
!<PROJECT_ROOT>/node_modules/mocha
6-
!<PROJECT_ROOT>/node_modules/iterall
76

87
[include]
98

@@ -40,4 +39,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)?)\\)
4039
suppress_comment=\\(.\\|\n\\)*\\$DisableFlowOnNegativeTest
4140

4241
[version]
43-
^0.120.0
42+
^0.126.0

0 commit comments

Comments
 (0)