Shareable ESLint config for eslint-plugin-flowtype: recommended + more rules.
npm install eslint-config-flowtype-strict> ESLint [shareable config] for [eslint-plugin-flowtype]: [recommended] + more rules.



In addition to [plugin:flowtype/recommended][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]
Example of valid code:
``js
// @flow
import React, { Component } from "react";
type InputEvent = SyntheticInputEvent
type ActivatorProps = {|
what: string,
onClick: (event: InputEvent) => void
|};
class Activator extends Component
render() {
const { what, onClick } = this.props;
return ;
}
}
`
Example of invalid code:
`js
/ @flow / // <-- flowtype/require-valid-file-annotation
type ActivatorProps = { // <-- flowtype/require-exact-type
what: string,
onClick: function, // <-- flowtype/no-weak-types
};
`
See the [full config] for more details.
Prerequisites:
- [Node.js] 4+, npm 3+
- [ESLint] 4+
> 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 and babel-eslint@8.
`sh`
npm install --save-dev eslint
npm install --save-dev babel-eslint
npm install --save-dev eslint-plugin-flowtype
npm install --save-dev eslint-config-flowtype-strict



Add this to your .eslintrc.json:
`json``
{
"extends": ["flowtype-strict"]
}
Please read [guidelines for contributing].
> Note: this ESLint config was created using [eslint-config-template].
![License][license]
[shareable config]: https://eslint.org/docs/developer-guide/shareable-configs
[eslint-plugin-flowtype]: https://github.com/gajus/eslint-plugin-flowtype
[recommended]: https://github.com/gajus/eslint-plugin-flowtype#recommended
[flowtype/newline-after-flow-annotation]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-newline-after-flow-annotation
[flowtype/no-dupe-keys]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-no-dupe-keys
[flowtype/no-existential-type]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-no-existential-type
[flowtype/no-flow-fix-me-comments]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-no-flow-fix-me-comments
[flowtype/no-primitive-constructor-types]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-no-primitive-constructor-types
[flowtype/no-weak-types]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-no-weak-types
[flowtype/require-exact-type]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-require-exact-type
[flowtype/require-parameter-type]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-require-parameter-type
[flowtype/require-return-type]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-require-return-type
[flowtype/require-types-at-top]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-require-types-at-top
[flowtype/require-valid-file-annotation]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-require-valid-file-annotation
[flowtype/semi]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-semi
[flowtype/type-import-style]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-type-import-style
[full config]: index.json
[babel-eslint]: https://github.com/babel/babel-eslint
[peer dependencies]: https://nodejs.org/en/blog/npm/peer-dependencies/
[node.js]: https://nodejs.org/
[eslint]: https://eslint.org/
[guidelines for contributing]: CONTRIBUTING.md
[eslint-config-template]: https://github.com/amercier/eslint-config-template
[license]: LICENSE.md