Skip to content

Commit

Permalink
eslint-plugin-react-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
inker committed Jan 15, 2024
1 parent c76adef commit 5786543
Show file tree
Hide file tree
Showing 14 changed files with 438 additions and 20 deletions.
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {

plugins: [
// 'import',
'react-hooks',
'@typescript-eslint',
],

Expand Down Expand Up @@ -176,6 +177,22 @@ module.exports = {
},
],

'react-hooks/rules-of-hooks': 2,
'react-hooks/exhaustive-deps': [
2,
{
disabledHooks: ['useEffect', 'useLayoutEffect'],
staticHooks: {
useDrawId: [false, true],
useFastDraw: [false, true],
usePopup: [false, true],
useStore: [false, true],
useTheme: [false, true],
useXRay: [false, true],
},
},
],

'@typescript-eslint/array-type': 2,
'@typescript-eslint/await-thenable': 2,
'@typescript-eslint/ban-ts-ignore': 0,
Expand Down
282 changes: 282 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"url": "git+https://github.com/inker/draw.git"
},
"scripts": {
"prepare": "husky install",
"prepare": "patch-package && husky install",
"pre-commit": "lint-staged --allow-empty",
"lint:js": "eslint --ext .ts,.tsx --max-warnings=0 src",
"lint:css": "stylelint './src/**/*.{ts,tsx}'",
Expand Down Expand Up @@ -87,6 +87,7 @@
"lint-staged": "^15.1.0",
"mini-css-extract-plugin": "^2.6.0",
"npm-run-all": "^4.1.5",
"patch-package": "^8.0.0",
"postcss-styled-syntax": "^0.6.1",
"style-loader": "^3.3.1",
"stylelint": "^16.0.2",
Expand Down
Loading

0 comments on commit 5786543

Please sign in to comment.