Skip to content

Commit

Permalink
Remove Flow file annotations & add missing 3rd-party typings (graphql…
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov authored Jul 27, 2020
1 parent 7f38a5b commit 7b32413
Show file tree
Hide file tree
Showing 284 changed files with 706 additions and 629 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
/npm
/deno

# Ignore Flow typings for 3rd-party libraries
/flow-typed
# Ignore TS files inside integration test
/integrationTests/ts/*.ts
116 changes: 57 additions & 59 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
parser: babel-eslint
parserOptions:
sourceType: module
sourceType: script
ecmaVersion: 2020
env:
es6: true
node: true
reportUnusedDisableDirectives: true
plugins:
- internal-rules
- flowtype
- node
- istanbul
- import
settings:
flowtype:
onlyFilesWithFlowAnnotation: true
node:
tryExtensions: ['.js', '.json', '.node', '.ts', '.d.ts']

Expand All @@ -25,54 +22,6 @@ rules:

internal-rules/no-dir-import: error

##############################################################################
# `eslint-plugin-flowtype` rule list based on `v5.2.x`
# https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype
##############################################################################

flowtype/array-style-complex-type: error
flowtype/array-style-simple-type: error
flowtype/define-flow-type: error
flowtype/newline-after-flow-annotation: error
flowtype/no-dupe-keys: error
flowtype/no-existential-type: off # checked by Flow
flowtype/no-flow-fix-me-comments: off
flowtype/no-mixed: off
flowtype/no-mutable-array: off
flowtype/no-primitive-constructor-types: error
flowtype/no-types-missing-file-annotation: error
flowtype/no-unused-expressions: off
flowtype/no-weak-types: [error, { any: false }]
flowtype/require-compound-type-alias: off
flowtype/require-exact-type: off
flowtype/require-indexer-name: error
flowtype/require-inexact-type: off # checked by Flow
flowtype/require-parameter-type: off
flowtype/require-readonly-react-props: off
flowtype/require-return-type: off
flowtype/require-types-at-top: off
flowtype/require-valid-file-annotation:
[error, always, { annotationStyle: line, strict: true }]
flowtype/require-variable-type: off
flowtype/sort-keys: off
flowtype/spread-exact-type: off
flowtype/type-id-match: [error, '^[A-Z]']
flowtype/type-import-style: [error, declaration]
flowtype/use-flow-type: error

# Bellow rules are disabled because coflicts with Prettier, see:
# https://github.com/prettier/eslint-config-prettier/blob/master/flowtype.js
flowtype/arrow-parens: off
flowtype/boolean-style: off
flowtype/delimiter-dangle: off
flowtype/generic-spacing: off
flowtype/object-type-delimiter: off
flowtype/semi: off
flowtype/space-after-type-colon: off
flowtype/space-before-generic-bracket: off
flowtype/space-before-type-colon: off
flowtype/union-intersection-spacing: off

##############################################################################
# `eslint-plugin-istanbul` rule list based on `v0.1.2`
# https://github.com/istanbuljs/eslint-plugin-istanbul#rules
Expand Down Expand Up @@ -491,17 +440,70 @@ rules:
yield-star-spacing: off

overrides:
- files: 'src/**/*.js'
parser: babel-eslint
parserOptions:
sourceType: module
plugins:
- flowtype

rules:
##############################################################################
# `eslint-plugin-flowtype` rule list based on `v5.2.x`
# https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype
##############################################################################

flowtype/array-style-complex-type: error
flowtype/array-style-simple-type: error
flowtype/define-flow-type: error
flowtype/newline-after-flow-annotation: error
flowtype/no-dupe-keys: error
flowtype/no-existential-type: off # checked by Flow
flowtype/no-flow-fix-me-comments: off
flowtype/no-mixed: off
flowtype/no-mutable-array: off
flowtype/no-primitive-constructor-types: error
flowtype/no-types-missing-file-annotation: off
flowtype/no-unused-expressions: off
flowtype/no-weak-types: [error, { any: false }]
flowtype/require-compound-type-alias: off
flowtype/require-exact-type: off
flowtype/require-indexer-name: error
flowtype/require-inexact-type: off # checked by Flow
flowtype/require-parameter-type: off
flowtype/require-readonly-react-props: off
flowtype/require-return-type: off
flowtype/require-types-at-top: off
flowtype/require-valid-file-annotation: off
flowtype/require-variable-type: off
flowtype/sort-keys: off
flowtype/spread-exact-type: off
flowtype/type-id-match: [error, '^[A-Z]']
flowtype/type-import-style: [error, declaration]
flowtype/use-flow-type: error

# Bellow rules are disabled because coflicts with Prettier, see:
# https://github.com/prettier/eslint-config-prettier/blob/master/flowtype.js
flowtype/arrow-parens: off
flowtype/boolean-style: off
flowtype/delimiter-dangle: off
flowtype/generic-spacing: off
flowtype/object-type-delimiter: off
flowtype/semi: off
flowtype/space-after-type-colon: off
flowtype/space-before-generic-bracket: off
flowtype/space-before-type-colon: off
flowtype/union-intersection-spacing: off
- files: '**/*.ts'
parser: '@typescript-eslint/parser'
parserOptions:
sourceType: module
project: ['tsconfig.json']
plugins:
- '@typescript-eslint'
extends:
- plugin:import/typescript
rules:
flowtype/no-types-missing-file-annotation: off

##########################################################################
# `@typescript-eslint/eslint-plugin` rule list based on `v3.7.x`
##########################################################################
Expand Down Expand Up @@ -645,8 +647,6 @@ overrides:
import/no-nodejs-modules: off
no-restricted-syntax: off
- files: 'integrationTests/**'
parserOptions:
sourceType: script
rules:
node/no-unpublished-import: off
node/no-unpublished-require: off
Expand All @@ -655,8 +655,6 @@ overrides:
import/no-nodejs-modules: off
no-console: off
- files: 'resources/**'
parserOptions:
sourceType: script
rules:
node/no-unpublished-import: off
node/no-unpublished-require: off
Expand Down
10 changes: 4 additions & 6 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
[ignore]
.*
!<PROJECT_ROOT>/src
!<PROJECT_ROOT>/node_modules/chai
!<PROJECT_ROOT>/node_modules/mocha

[include]

[libs]

[lints]
sketchy-null-bool=error
sketchy-null-string=error
Expand All @@ -16,7 +12,7 @@ sketchy-null-mixed=error
sketchy-number=error
untyped-type-import=error
nonstrict-import=off
untyped-import=off
untyped-import=error
unclear-type=off
deprecated-type=error
deprecated-utility=error
Expand All @@ -37,10 +33,12 @@ mixed-import-and-require=error
export-renamed-default=error

[options]
include_warnings=true
all=true
module.use_strict=true
babel_loose_array_spread=true
esproposal.optional_chaining=enable
experimental.const_params=true
include_warnings=true

[version]
^0.130.0
Loading

0 comments on commit 7b32413

Please sign in to comment.