Skip to content

Commit 1d436ff

Browse files
committed
More allowExportNames in Next config (fixes #90) [publish]
1 parent 3395dda commit 1d436ff

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.4.23
4+
5+
- Add `"metadata"`, `"generateMetadata"` & `"generateViewport"` to `allowExportNames` in Next config
6+
37
## 0.4.22
48

59
- Add `"viewport"` to `allowExportNames` in Next config ([#89](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/pull/89))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-react-refresh",
3-
"version": "0.4.22",
3+
"version": "0.4.23",
44
"type": "module",
55
"license": "MIT",
66
"scripts": {

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export const configs = {
2929
"react-refresh/only-export-components": [
3030
"error",
3131
{
32-
// from https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
3332
allowExportNames: [
33+
// https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
3434
"experimental_ppr",
3535
"dynamic",
3636
"dynamicParams",
@@ -39,7 +39,12 @@ export const configs = {
3939
"runtime",
4040
"preferredRegion",
4141
"maxDuration",
42+
// https://nextjs.org/docs/app/api-reference/functions/generate-metadata
43+
"metadata",
44+
"generateMetadata",
45+
// https://nextjs.org/docs/app/api-reference/functions/generate-viewport
4246
"viewport",
47+
"generateViewport",
4348
],
4449
},
4550
],

src/only-export-components.test.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env tnode
2-
import { test } from "bun:test";
31
import parser from "@typescript-eslint/parser";
42
import { RuleTester } from "eslint";
53
import { onlyExportComponents } from "./only-export-components.ts";
@@ -334,14 +332,12 @@ const invalid = [
334332
];
335333

336334
const it = (name: string, cases: Parameters<typeof ruleTester.run>[2]) => {
337-
test(name, () => {
338-
ruleTester.run(
339-
"only-export-components",
340-
// @ts-expect-error Mismatch between typescript-eslint and eslint
341-
onlyExportComponents,
342-
cases,
343-
);
344-
});
335+
ruleTester.run(
336+
name,
337+
// @ts-expect-error Mismatch between typescript-eslint and eslint
338+
onlyExportComponents,
339+
cases,
340+
);
345341
};
346342

347343
for (const { name, code, filename, options = [] } of valid) {

0 commit comments

Comments
 (0)