eslint-config-flowtype-strict
ESLint shareable config for eslint-plugin-flowtype: recommended + more rules.
Rules
In addition to plugin:flowtype/recommended, the following rules are in effect:
- flowtype/newline-after-flow-annotation
- flowtype/no-dupe-keys
- flowtype/no-existential-type
- flowtype/no-flow-fix-me-comments
- flowtype/no-primitive-constructor-types
- flowtype/no-weak-types
- flowtype/require-exact-type
- flowtype/require-parameter-type
- flowtype/require-return-type
- flowtype/require-types-at-top
- flowtype/require-valid-file-annotation
- flowtype/semi
- flowtype/type-import-style
Examples
Example of valid code:
// @flow ; type InputEvent = SyntheticInputEvent<HTMLInputElement>; type ActivatorProps = | what: string void|; <AppProps {}> { const what onClick = thisprops; return <button onclick=onClick>Activate what</button>; }
Example of invalid code:
/* @flow */ // <-- flowtype/require-valid-file-annotation type ActivatorProps = // <-- flowtype/require-exact-type what: string
See the full config for more details.
Installation
Prerequisites:
Important: please note ESLint, babel-eslint and eslint-plugin-flowtype need to be installed alongside this module. Latest versions are recommended. This is because this module uses peer dependencies to be more flexible. For Node 4 and 5, use
eslint@4
andbabel-eslint@8
.
npm install --save-dev eslintnpm install --save-dev babel-eslintnpm install --save-dev eslint-plugin-flowtypenpm install --save-dev eslint-config-flowtype-strict
Usage
Add this to your .eslintrc.json
:
Contributing
Please read guidelines for contributing.
Note: this ESLint config was created using eslint-config-template.