Skip to content

Commit

Permalink
chore(widgets): add react and react hooks eslint config (#4838)
Browse files Browse the repository at this point in the history
### Description

Add react and react hooks eslint rules for better linting in the widgets
project

### Drive-by changes

No

### Backward compatibility

Yes

### Testing

Manual testing
  • Loading branch information
Xaroz authored Nov 7, 2024
1 parent 5f41b11 commit bf4c779
Show file tree
Hide file tree
Showing 3 changed files with 714 additions and 11 deletions.
14 changes: 13 additions & 1 deletion typescript/widgets/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"prettier"
],
"plugins": ["react", "react-hooks", "@typescript-eslint"],
"rules": {
// TODO use utils rootLogger in widgets lib
"no-console": ["off"]
"no-console": ["off"],
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
}
2 changes: 2 additions & 0 deletions typescript/widgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"babel-loader": "^8.3.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-storybook": "^0.6.15",
"postcss": "^8.4.21",
"prettier": "^2.8.8",
Expand Down
Loading

0 comments on commit bf4c779

Please sign in to comment.