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:
Examples
Example of valid code:
import React, { Component } from "react";
type InputEvent = SyntheticInputEvent<HTMLInputElement>;
type ActivatorProps = {|
what: string,
onClick: (event: InputEvent) => void
|};
class Activator extends Component<AppProps, {}> {
render() {
const { what, onClick } = this.props;
return <button onclick={onClick}>Activate {what}</button>;
}
}
Example of invalid code:
type ActivatorProps = {
what: string,
onClick: function,
};
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
and babel-eslint@8
.
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
Usage
Add this to your .eslintrc.json
:
{
"extends": ["flowtype-strict"]
}
Contributing
Please read guidelines for contributing.
Note: this ESLint config was created using eslint-config-template.
License