Skip to content

Commit e6082c6

Browse files
committed
add news eslint rules for examples to ensure that components import does not break hmr
1 parent 624d80d commit e6082c6

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

eslint.config.mjs

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import jsdoc from "eslint-plugin-jsdoc";
22
import globals from "globals";
33
import tseslint from "typescript-eslint";
44
import eslint from "@eslint/js";
5+
import reactRefresh from "eslint-plugin-react-refresh";
56

67
const jsDocConfig = jsdoc.configs["flat/recommended-typescript-error"];
78

@@ -158,6 +159,10 @@ export default tseslint.config(
158159
{
159160
...jsDocConfig,
160161
files: ["**/*.{ts,tsx,mts,cts}"],
162+
plugins: {
163+
jsdoc,
164+
"react-refresh": reactRefresh,
165+
},
161166
rules: {
162167
"no-undef": "off",
163168
"no-unused-vars": "off",
@@ -183,6 +188,7 @@ export default tseslint.config(
183188
"jsdoc/require-jsdoc": "off",
184189
"jsdoc/no-defaults": "off",
185190
"jsdoc/require-returns": "off",
191+
"react-refresh/only-export-components": "warn",
186192
},
187193
languageOptions: {
188194
parserOptions: {

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"vitest": "^2.0.5"
3333
},
3434
"devDependencies": {
35+
"eslint-plugin-react-refresh": "^0.4.11",
3536
"playwright": "^1.46.0"
3637
}
3738
}

pnpm-lock.yaml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)