diff --git a/config/eslint.js b/config/eslint.js index f7209c758ee871fa0f284a86b70147ba19320084..47c3064d2bce79a3eff8648815c47775dbacbeeb 100644 --- a/config/eslint.js +++ b/config/eslint.js @@ -22,7 +22,7 @@ module.exports = { parser: 'babel-eslint', // import plugin is termporarily disabled, scroll below to see why - plugins: ['react'/*, 'import'*/, 'jsx-a11y'], + plugins: [/*'import', */'flow-vars', 'jsx-a11y', 'react'], env: { browser: true, @@ -195,6 +195,10 @@ module.exports = { 'jsx-a11y/aria-role': 'warn', 'jsx-a11y/img-has-alt': 'warn', 'jsx-a11y/img-redundant-alt': 'warn', - 'jsx-a11y/no-access-key': 'warn' + 'jsx-a11y/no-access-key': 'warn', + + // https://github.com/zertosh/eslint-plugin-flow-vars + 'flow-vars/define-flow-type': 'warn', + 'flow-vars/use-flow-type': 'warn' } }; diff --git a/package.json b/package.json index e7e74d3c0f40ed0e762f292e2db9c65528f928ef..c4999d125583d4c1057576f281466e7572d49588 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "detect-port": "0.1.4", "eslint": "3.1.1", "eslint-loader": "1.4.1", + "eslint-plugin-flow-vars": "0.5.0", "eslint-plugin-import": "1.12.0", "eslint-plugin-jsx-a11y": "2.0.1", "eslint-plugin-react": "5.2.2", diff --git a/template/README.md b/template/README.md index ec428c475c9482234ec280e694f0e236480c0122..f41620b5941355339f0073b7467e161abeb969fd 100644 --- a/template/README.md +++ b/template/README.md @@ -257,7 +257,7 @@ If you don’t need ESLint integration with your editor, you can safely delete t Finally, you will need to install some packages *globally*: ```sh -npm install -g eslint babel-eslint eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y +npm install -g eslint babel-eslint eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-flow-vars ``` 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.