File tree Expand file tree Collapse file tree 5 files changed +52
-1
lines changed Expand file tree Collapse file tree 5 files changed +52
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 0.4.21
4+
5+ - Add Next config (fixes [ #85 ] ( https://github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/85 ) )
6+
7+ This allows exports like ` fetchCache ` and ` revalidate ` which are used in Page or Layout components and don't trigger a full page reload.
8+
9+ ``` js
10+ import reactRefresh from " eslint-plugin-react-refresh" ;
11+
12+ export default [
13+ /* Main config */
14+ reactRefresh .configs .next ,
15+ ];
16+ ```
17+
318## 0.4.20
419
520- Don't warn on nested HOC calls (fixes [ #79 ] ( https://github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/79 ) )
Original file line number Diff line number Diff line change @@ -54,6 +54,19 @@ export default [
5454];
5555```
5656
57+ ### Next config
58+
59+ This allows exports like ` fetchCache ` and ` revalidate ` which are used in Page or Layout components and don't trigger a full page reload.
60+
61+ ``` js
62+ import reactRefresh from " eslint-plugin-react-refresh" ;
63+
64+ export default [
65+ /* Main config */
66+ reactRefresh .configs .next ,
67+ ];
68+ ```
69+
5770### Without config
5871
5972``` js
Original file line number Diff line number Diff line change 11{
22 "name" : " eslint-plugin-react-refresh" ,
3- "version" : " 0.4.20 " ,
3+ "version" : " 0.4.21 " ,
44 "type" : " module" ,
55 "license" : " MIT" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -22,6 +22,28 @@ export const configs = {
2222 ] ,
2323 } ,
2424 } ,
25+ next : {
26+ name : "react-refresh/vite" ,
27+ plugins : { "react-refresh" : plugin } ,
28+ rules : {
29+ "react-refresh/only-export-components" : [
30+ "error" ,
31+ {
32+ // from https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
33+ allowExportNames : [
34+ "experimental_ppr" ,
35+ "dynamic" ,
36+ "dynamicParams" ,
37+ "revalidate" ,
38+ "fetchCache" ,
39+ "runtime" ,
40+ "preferredRegion" ,
41+ "maxDuration" ,
42+ ] ,
43+ } ,
44+ ] ,
45+ } ,
46+ } ,
2547} ;
2648
2749// Probably not needed, but keep for backwards compatibility
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ declare const _default: {
88 configs : {
99 recommended : Config ;
1010 vite : Config ;
11+ next : Config ;
1112 } ;
1213} ;
1314
You can’t perform that action at this time.
0 commit comments