https://github.com/amercier/eslint-config-flowtype-strict
Shareable ESLint config for Flow type (eslint-plugin-flowtype): recommended + more rules.
https://github.com/amercier/eslint-config-flowtype-strict
config eslint eslint-config recommended strict
Last synced: 4 months ago
JSON representation
Shareable ESLint config for Flow type (eslint-plugin-flowtype): recommended + more rules.
- Host: GitHub
- URL: https://github.com/amercier/eslint-config-flowtype-strict
- Owner: amercier
- License: isc
- Created: 2018-12-19T11:12:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-29T04:24:53.000Z (about 6 years ago)
- Last Synced: 2025-10-08T20:23:09.103Z (8 months ago)
- Topics: config, eslint, eslint-config, recommended, strict
- Language: JavaScript
- Size: 142 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# eslint-config-flowtype-strict
> ESLint [shareable config] for [eslint-plugin-flowtype]: [recommended] + more rules.
[](https://www.npmjs.com/package/eslint-config-flowtype-strict)
[](https://travis-ci.org/amercier/eslint-config-flowtype-strict)
[](https://github.com/amercier/eslint-config-flowtype-strict/issues?q=label%3Agreenkeeper)
## 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]
## Examples
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 Activate {what};
}
}
```
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.
## Installation
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
```
[](https://david-dm.org/amercier/eslint-config-flowtype-strict)
[](https://david-dm.org/amercier/eslint-config-flowtype-strict#info=devDependencies)
[](https://david-dm.org/amercier/eslint-config-flowtype-strict#info=devDependencies)
## Usage
Add this to your `.eslintrc.json`:
```json
{
"extends": ["flowtype-strict"]
}
```
## Contributing
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