Skip to content

Commit

Permalink
🐛 add react-hooks specific file
Browse files Browse the repository at this point in the history
this fix a problem that required project using this config to define
the react hook plugin
  • Loading branch information
Yoann Fleury committed Jun 22, 2020
1 parent 7b7bb16 commit a46551a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/@saagie/eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ module.exports = {
extends: [
'eslint-config-airbnb',
'./rules/override',
].map(require.resolve),
'./rules/react-hooks'
].map(require.resolve)
};
2 changes: 1 addition & 1 deletion packages/@saagie/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Saagie's ESLint config",
"main": "index.js",
"dependencies": {
"eslint-config-airbnb": "18.1.0"
"eslint-config-airbnb": "18.2.0"
},
"devDependencies": {
"eslint-plugin-import": "2.20.2",
Expand Down
5 changes: 0 additions & 5 deletions packages/@saagie/eslint-config/rules/override.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,5 @@ module.exports = {
// Enforce that a label tag has a text label and an associated control.
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-associated-control.md
"jsx-a11y/label-has-associated-control": ["error"],

// Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class.
// https://reactjs.org/docs/hooks-rules.html
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
}
};
11 changes: 11 additions & 0 deletions packages/@saagie/eslint-config/rules/react-hooks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
plugins: [
"react-hooks"
],
rules: {
// Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class.
// https://reactjs.org/docs/hooks-rules.html
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
};

0 comments on commit a46551a

Please sign in to comment.