Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow: remove @flow strict annotations #308

Merged
merged 1 commit into from
Mar 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 57 additions & 54 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,20 @@
parser: babel-eslint
parserOptions:
sourceType: module
sourceType: script
ecmaVersion: 2020
env:
es6: true
node: true
reportUnusedDisableDirectives: true
plugins:
- flowtype
- node
- istanbul
- import
settings:
flowtype:
onlyFilesWithFlowAnnotation: true
node:
tryExtensions: ['.js', '.json', '.node', '.ts', '.d.ts']

rules:
##############################################################################
# `eslint-plugin-flowtype` rule list based on `v5.1.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.1`
# https://github.com/istanbuljs/eslint-plugin-istanbul#rules
Expand Down Expand Up @@ -470,17 +420,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.1.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.5.x`
##########################################################################
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/starWarsConnectionTests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { expect } from 'chai';
import { describe, it } from 'mocha';
import { graphqlSync } from 'graphql';
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/starWarsData.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

/**
* This defines a basic set of data for our Star Wars Schema.
*
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/starWarsMutationTests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { expect } from 'chai';
import { describe, it } from 'mocha';
import { graphqlSync } from 'graphql';
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/starWarsObjectIdentificationTests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { expect } from 'chai';
import { describe, it } from 'mocha';
import { graphqlSync } from 'graphql';
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/starWarsSchema.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import {
GraphQLID,
GraphQLNonNull,
Expand Down
2 changes: 0 additions & 2 deletions src/connection/__tests__/arrayconnection.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { describe, it } from 'mocha';
import { expect } from 'chai';

Expand Down
2 changes: 0 additions & 2 deletions src/connection/__tests__/connection.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { expect } from 'chai';
import { describe, it } from 'mocha';
import {
Expand Down
2 changes: 0 additions & 2 deletions src/connection/arrayconnection.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { base64, unbase64 } from '../utils/base64';

import type {
Expand Down
2 changes: 0 additions & 2 deletions src/connection/connection.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import {
GraphQLBoolean,
GraphQLInt,
Expand Down
2 changes: 0 additions & 2 deletions src/connection/connectiontypes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

/**
* An flow type alias for cursors in this implementation.
*/
Expand Down
2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

// Flow types for creating connection types in the schema
export type {
Connection,
Expand Down
2 changes: 0 additions & 2 deletions src/mutation/__tests__/mutation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { describe, it } from 'mocha';
import { expect } from 'chai';

Expand Down
2 changes: 0 additions & 2 deletions src/mutation/mutation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import {
GraphQLInputObjectType,
GraphQLNonNull,
Expand Down
2 changes: 0 additions & 2 deletions src/node/__tests__/global.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { describe, it } from 'mocha';
import { expect } from 'chai';

Expand Down
2 changes: 0 additions & 2 deletions src/node/__tests__/node.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { describe, it } from 'mocha';
import { expect } from 'chai';

Expand Down
2 changes: 0 additions & 2 deletions src/node/__tests__/nodeasync.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { describe, it } from 'mocha';
import { expect } from 'chai';

Expand Down
2 changes: 0 additions & 2 deletions src/node/__tests__/plural.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { describe, it } from 'mocha';
import { expect } from 'chai';

Expand Down
2 changes: 0 additions & 2 deletions src/node/node.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import {
GraphQLInterfaceType,
GraphQLList,
Expand Down
2 changes: 0 additions & 2 deletions src/node/plural.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { GraphQLList, GraphQLNonNull, getNullableType } from 'graphql';

import type {
Expand Down
2 changes: 0 additions & 2 deletions src/utils/__tests__/base64.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

import { describe, it } from 'mocha';
import { expect } from 'chai';

Expand Down
2 changes: 0 additions & 2 deletions src/utils/base64.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow strict

export type Base64String = string;

export function base64(i: string): Base64String {
Expand Down