Skip to content

Commit

Permalink
fix(eslint): restrict react-refresh rule to pages directory only
Browse files Browse the repository at this point in the history
- Disable react-refresh/only-export-components rule globally
- Configure the rule specifically for pages/**/*.tsx files
- Resolve Fast Refresh warnings in components directory
  • Loading branch information
TinsFox committed Nov 3, 2024
1 parent 0e10336 commit c240686
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default defineConfig(
lessOpinionated: true,
preferESM: false,
ignores: [
"public/mockServiceWorker.js",
"src/components/ui",
"pnpm-lock.yaml",
],
Expand All @@ -23,10 +22,16 @@ export default defineConfig(
whitelist: ["center"],
},
},
rules: {
"react-refresh/only-export-components": "off",
},
},
{
files: ["**/pages/**/*.tsx"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowExportNames: ["loader"] },
{ allowExportNames: ["loader", "Component", "action"] },
],
},
},
Expand Down

0 comments on commit c240686

Please sign in to comment.