Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fixtures/input/tsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function Component1() {
return <div/>;
}

export function jsx2() {
export function Component2() {
const props = {a:1,
b:2}
return < a foo= 'bar' bar={`foo` } >
Expand Down
2 changes: 1 addition & 1 deletion fixtures/output/all/tsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function Component1() {
return <div />
}

export function jsx2() {
export function Component2() {
const props = { a: 1, b: 2 }
return (
<a foo="bar" bar="foo">
Expand Down
2 changes: 1 addition & 1 deletion fixtures/output/js/tsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function Component1() {
return <div />
}

export function jsx2() {
export function Component2() {
const props = { a: 1, b: 2 }
return (
<a foo="bar" bar="foo">
Expand Down
2 changes: 1 addition & 1 deletion fixtures/output/no-markdown-with-formatters/tsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function Component1() {
return <div/>
}

export function jsx2() {
export function Component2() {
const props = { a: 1, b: 2 }
return < a foo= 'bar' bar={`foo` } >
<div {...props } a={1} b="2">Inline Text</div>
Expand Down
10 changes: 5 additions & 5 deletions fixtures/output/tab-double-quotes/toml.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
comma = [
1,
2,
3,
1,
2,
3,
]

[foo]
b = 1
c = "hello"
a = { answer = 42 }
indent = [
1,
2
1,
2
]

[a-table]
Expand Down
2 changes: 1 addition & 1 deletion fixtures/output/tab-double-quotes/tsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function Component1() {
return <div />
}

export function jsx2() {
export function Component2() {
const props = { a: 1, b: 2 }
return (
<a foo="bar" bar="foo">
Expand Down
2 changes: 1 addition & 1 deletion fixtures/output/ts-override/tsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function Component1() {
return <div />
}

export function jsx2() {
export function Component2() {
const props = { a: 1, b: 2 }
return (
<a foo="bar" bar="foo">
Expand Down
2 changes: 1 addition & 1 deletion fixtures/output/ts-strict-with-react/tsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function Component1() {
return <div />
}

export function jsx2() {
export function Component2() {
const props = { a: 1, b: 2 }
return (
<a foo="bar" bar="foo">
Expand Down
2 changes: 1 addition & 1 deletion fixtures/output/ts-strict/tsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function Component1() {
return <div />
}

export function jsx2() {
export function Component2() {
const props = { a: 1, b: 2 }
return (
<a foo="bar" bar="foo">
Expand Down
2 changes: 1 addition & 1 deletion fixtures/output/with-formatters/tsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function Component1() {
return <div />
}

export function jsx2() {
export function Component2() {
const props = { a: 1, b: 2 }
return (
<a foo="bar" bar="foo">
Expand Down
11 changes: 9 additions & 2 deletions src/configs/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,25 +191,32 @@ export async function react(

// preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
'react-refresh/only-export-components': [
'warn',
'error',
{
allowConstantExport: isAllowConstantExport,
allowExportNames: [
...(isUsingNext
? [
// https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
'dynamic',
'dynamicParams',
'revalidate',
'fetchCache',
'runtime',
'preferredRegion',
'maxDuration',
'config',
// https://nextjs.org/docs/app/api-reference/functions/generate-static-params
'generateStaticParams',
// https://nextjs.org/docs/app/api-reference/functions/generate-metadata
'metadata',
'generateMetadata',
// https://nextjs.org/docs/app/api-reference/functions/generate-viewport
'viewport',
'generateViewport',
// https://nextjs.org/docs/app/api-reference/functions/generate-image-metadata
'generateImageMetadata',
// https://nextjs.org/docs/app/api-reference/functions/generate-sitemaps
'generateSitemaps',
]
: []),
...(isUsingRemix || isUsingReactRouter
Expand Down