Skip to content

Commit 976297c

Browse files
author
lukaw3d
committed
Add react-refresh/only-export-components as a warning
Only as a warning so we can iteratively fix it and CI won't enforce it.
1 parent e93d19a commit 976297c

4 files changed

Lines changed: 11 additions & 0 deletions

File tree

.changelog/2296.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Detect hot-reload issues with eslint

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const config = {
99
'react-app', // https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/index.js
1010
'plugin:prettier/recommended', // See .prettierrc
1111
],
12+
plugins: ['react-refresh'],
13+
1214
parser: '@typescript-eslint/parser',
1315

1416
settings: {},
@@ -68,6 +70,8 @@ const config = {
6870
'react/display-name': 'off', // TODO: Maybe enable
6971
'react/self-closing-comp': ['error', { component: true, html: true }],
7072

73+
'react-refresh/only-export-components': ['warn', { allowConstantExport: true /* vite */ }],
74+
7175
'@typescript-eslint/no-empty-function': 'off', // Allow empty reducers for saga
7276
'@typescript-eslint/no-non-null-assertion': 'off',
7377
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"eslint-plugin-prettier": "5.2.6",
9999
"eslint-plugin-react": "7.37.4",
100100
"eslint-plugin-react-hooks": "4.6.2",
101+
"eslint-plugin-react-refresh": "^0.4.24",
101102
"events": "^3.1.0",
102103
"jsdom": "^26.1.0",
103104
"markdownlint-cli": "0.44.0",

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4376,6 +4376,11 @@ eslint-plugin-react-hooks@^4.3.0:
43764376
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3"
43774377
integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==
43784378

4379+
eslint-plugin-react-refresh@^0.4.24:
4380+
version "0.4.24"
4381+
resolved "https://registry.yarnpkg.com/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.24.tgz#6914e8757eb7d7ccc3efb9dbcc8a51feda71d89e"
4382+
integrity sha512-nLHIW7TEq3aLrEYWpVaJ1dRgFR+wLDPN8e8FpYAql/bMV2oBEfC37K0gLEGgv9fy66juNShSMV8OkTqzltcG/w==
4383+
43794384
eslint-plugin-react@7.37.4, eslint-plugin-react@^7.27.1:
43804385
version "7.37.4"
43814386
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.37.4.tgz#1b6c80b6175b6ae4b26055ae4d55d04c414c7181"

0 commit comments

Comments
 (0)