Skip to content

Commit 9746dab

Browse files
committed
Enable React Hooks eslint plugin
1 parent 2a16839 commit 9746dab

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

packages/app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
"debug": "^2.6.8",
154154
"downshift": "^1.0.0-rc.14",
155155
"eslint-config-react-app": "^1.0.5",
156+
"eslint-plugin-react-hooks": "^0.0.0",
156157
"eslint-plugin-vue": "^4.2.2",
157158
"file-saver": "^1.3.3",
158159
"fontfaceobserver": "^2.0.13",

packages/app/src/app/components/CodeEditor/Monaco/workers/linter/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ const allRules = {
3939
'jsx-a11y/role-has-required-aria-props': require('eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props'),
4040
'jsx-a11y/role-supports-aria-props': require('eslint-plugin-jsx-a11y/lib/rules/role-supports-aria-props'),
4141
'jsx-a11y/scope': require('eslint-plugin-jsx-a11y/lib/rules/scope'),
42+
'react-hooks/rules-of-hooks': require('eslint-plugin-react-hooks').rules[
43+
'rules-of-hooks'
44+
],
4245
};
4346
/* eslint-enable global-require */
4447

@@ -282,6 +285,7 @@ const defaultConfig = {
282285
// 'react/react-in-jsx-scope': 'error',
283286
'react/require-render-return': 'error',
284287
'react/style-prop-object': 'warn',
288+
'react-hooks/rules-of-hooks': 'error',
285289

286290
// https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
287291
'jsx-a11y/accessible-emoji': 'warn',

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8981,6 +8981,11 @@ eslint-plugin-jsx-a11y@^5.0.3:
89818981
emoji-regex "^6.1.0"
89828982
jsx-ast-utils "^1.4.0"
89838983

8984+
eslint-plugin-react-hooks@^0.0.0:
8985+
version "0.0.0"
8986+
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-0.0.0.tgz#9988f14082a159931c3dfa9ba699130457da927a"
8987+
integrity sha512-SXyU7C3E8AJbXKMdb10P/zHazcxzfuWR5OFwAVZKXVU7P/H56NLszVG6WdQBo9Pt80FfnPXtUGGbWhs3/98N4w==
8988+
89848989
eslint-plugin-react@~7.4.0:
89858990
version "7.4.0"
89868991
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.4.0.tgz#300a95861b9729c087d362dd64abcc351a74364a"

0 commit comments

Comments
 (0)