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

chore: begin adding strict flow types to lint rule #34

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"extends": ["eslint-config-bzc"],
"parser": "hermes-eslint",
"rules": {
"global-require": 0,
"import/no-dynamic-require": 0,
"no-restricted-syntax": 0
"no-restricted-syntax": 0,
"ft-flow/define-flow-type": 0,
"ft-flow/use-flow-type": 0,
"no-undef": 0,
"no-use-before-define": 0
}
}
20 changes: 19 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
!.*node_modules/tiny-invariant/.*
!.*node_modules/key-commander/.*
!.*node_modules/react-ld/.*
!.*node_modules/hermes-eslint/.*
!.*node_modules/hermes-estree/.*
!.*node_modules/hermes-parser/.*

[include]

Expand All @@ -18,8 +21,17 @@
[lints]
deprecated-type=error
deprecated-utility=error
untyped-type-import=error
unclear-type=error
unnecessary-optional-chain=error
ambiguous-object-type=error

; ES6 module lints
invalid-import-star-use=error
non-const-var-export=error
this-in-exported-function=error
mixed-import-and-require=error
export-renamed-default=error
default-import-access=error

[options]
enums=true
Expand All @@ -28,7 +40,13 @@ format.single_quotes=true
exact_by_default=true
include_warnings=true

# this is a dirty hack to allow us to declare "libs" that reference non "libs" types
module.name_mapper='^eslint$' -> '<PROJECT_ROOT>/flow-typed-local/ESLint.js.flow'

[strict]
nonstrict-import
sketchy-null
untyped-import

[version]

Expand Down
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"javascript.validate.enable": false,
"flow.enabled": true
}