Skip to content

Commit

Permalink
Style(web-react): Warn about fast refresh problems for Storybook spee…
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Jun 26, 2024
1 parent cbcf419 commit 0926b92
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/web-react/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,20 @@ module.exports = {
project: './config/tsconfig.eslint.json',
},

plugins: ['promise', 'react', 'prettier'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.md'],
},
},
},

plugins: ['promise', 'react', '@typescript-eslint', 'prettier', 'react-refresh'],
rules: {
// @see: https://github.com/ArnaudBarre/eslint-plugin-react-refresh
'react-refresh/only-export-components': 'warn',
// @TODO: add to typescript config
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
// we like to use props spreading for additional props in this case
'react/jsx-props-no-spreading': 'off', // Used inside HOC, that is fine.
// prefer arrow function over function expression
Expand Down
1 change: 1 addition & 0 deletions packages/web-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"eslint-plugin-promise": "6.2.0",
"eslint-plugin-react": "7.34.3",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"eslint-plugin-standard": "5.0.0",
"glob": "10.4.2",
"jest": "29.7.0",
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3725,6 +3725,7 @@ __metadata:
eslint-plugin-promise: "npm:6.2.0"
eslint-plugin-react: "npm:7.34.3"
eslint-plugin-react-hooks: "npm:4.6.2"
eslint-plugin-react-refresh: "npm:^0.4.7"
eslint-plugin-standard: "npm:5.0.0"
glob: "npm:10.4.2"
html-dom-parser: "npm:5.0.8"
Expand Down Expand Up @@ -14623,6 +14624,15 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-react-refresh@npm:^0.4.7":
version: 0.4.7
resolution: "eslint-plugin-react-refresh@npm:0.4.7"
peerDependencies:
eslint: ">=7"
checksum: 10/acbbe24e40b2b6fe96656e9407e275fdda6db031814674117e7a65d49a7a713f05b0d79dc6426d927b7622ce310a261cff385821c80b2e97089068dcd30bda52
languageName: node
linkType: hard

"eslint-plugin-react@npm:7.34.3":
version: 7.34.3
resolution: "eslint-plugin-react@npm:7.34.3"
Expand Down

0 comments on commit 0926b92

Please sign in to comment.