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 1
1
# Changelog
2
2
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
+
3
18
## 0.4.20
4
19
5
20
- 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 [
54
54
];
55
55
```
56
56
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
+
57
70
### Without config
58
71
59
72
``` js
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " eslint-plugin-react-refresh" ,
3
- "version" : " 0.4.20 " ,
3
+ "version" : " 0.4.21 " ,
4
4
"type" : " module" ,
5
5
"license" : " MIT" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -22,6 +22,28 @@ export const configs = {
22
22
] ,
23
23
} ,
24
24
} ,
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
+ } ,
25
47
} ;
26
48
27
49
// 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: {
8
8
configs : {
9
9
recommended : Config ;
10
10
vite : Config ;
11
+ next : Config ;
11
12
} ;
12
13
} ;
13
14
You can’t perform that action at this time.
0 commit comments