Skip to content

Commit 29c913e

Browse files
authored
Tweak ESLint to better understand Flow (#261)
1 parent e2969b6 commit 29c913e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

config/eslint.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = {
2222
parser: 'babel-eslint',
2323

2424
// import plugin is termporarily disabled, scroll below to see why
25-
plugins: ['react'/*, 'import'*/, 'jsx-a11y'],
25+
plugins: [/*'import', */'flow-vars', 'jsx-a11y', 'react'],
2626

2727
env: {
2828
browser: true,
@@ -195,6 +195,10 @@ module.exports = {
195195
'jsx-a11y/aria-role': 'warn',
196196
'jsx-a11y/img-has-alt': 'warn',
197197
'jsx-a11y/img-redundant-alt': 'warn',
198-
'jsx-a11y/no-access-key': 'warn'
198+
'jsx-a11y/no-access-key': 'warn',
199+
200+
// https://github.com/zertosh/eslint-plugin-flow-vars
201+
'flow-vars/define-flow-type': 'warn',
202+
'flow-vars/use-flow-type': 'warn'
199203
}
200204
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"detect-port": "0.1.4",
4747
"eslint": "3.1.1",
4848
"eslint-loader": "1.4.1",
49+
"eslint-plugin-flow-vars": "0.5.0",
4950
"eslint-plugin-import": "1.12.0",
5051
"eslint-plugin-jsx-a11y": "2.0.1",
5152
"eslint-plugin-react": "5.2.2",

template/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ If you don’t need ESLint integration with your editor, you can safely delete t
257257
Finally, you will need to install some packages *globally*:
258258

259259
```sh
260-
npm install -g eslint babel-eslint eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y
260+
npm install -g eslint babel-eslint eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-flow-vars
261261
```
262262

263263
We recognize that this is suboptimal, but it is currently required due to the way we hide the ESLint dependency. The ESLint team is already [working on a solution to this](https://github.com/eslint/eslint/issues/3458) so this may become unnecessary in a couple of months.

0 commit comments

Comments
 (0)