Skip to content

Commit

Permalink
feat: enable basic jsx stylistic rules, close #185
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Oct 9, 2023
1 parent a267aa5 commit 2dfb5fd
Show file tree
Hide file tree
Showing 17 changed files with 648 additions and 46 deletions.
16 changes: 16 additions & 0 deletions fixtures/input/tsx.tsx
@@ -0,0 +1,16 @@
export function Component1() {
return <div/>;
}

export function jsx2() {
const props = {a:1,
b:2}
return < a foo= 'bar' bar={`foo` } >
<div {...props }
a={1}
b="2">Inline Text</div>
<Component1>
Block Text
</Component1>
</ a >
}
17 changes: 17 additions & 0 deletions fixtures/output/all/tsx.tsx
@@ -0,0 +1,17 @@
export function Component1() {
return <div />
}

export function jsx2() {
const props = { a: 1, b: 2 }
return (<a foo="bar" bar={`foo`} >
<div
{...props}
a={1}
b="2"
>Inline Text</div>
<Component1>
Block Text
</Component1>
</a >)
}
1 change: 1 addition & 0 deletions fixtures/output/js/tsx.tsx
@@ -0,0 +1 @@
// unchanged
2 changes: 1 addition & 1 deletion fixtures/output/js/typescript.ts
@@ -1 +1 @@
// unchanged
// unchanged
2 changes: 1 addition & 1 deletion fixtures/output/js/vue-ts.vue
@@ -1 +1 @@
// unchanged
// unchanged
2 changes: 1 addition & 1 deletion fixtures/output/js/vue.vue
@@ -1 +1 @@
// unchanged
// unchanged
1 change: 1 addition & 0 deletions fixtures/output/no-style/tsx.tsx
@@ -0,0 +1 @@
// unchanged
17 changes: 17 additions & 0 deletions fixtures/output/tab-double-quotes/tsx.tsx
@@ -0,0 +1,17 @@
export function Component1() {
return <div />
}

export function jsx2() {
const props = { a: 1, b: 2 }
return (<a foo="bar" bar={`foo`} >
<div
{...props}
a={1}
b="2"
>Inline Text</div>
<Component1>
Block Text
</Component1>
</a >)
}
17 changes: 17 additions & 0 deletions fixtures/output/ts-override/tsx.tsx
@@ -0,0 +1,17 @@
export function Component1() {
return <div />
}

export function jsx2() {
const props = { a: 1, b: 2 }
return (<a foo="bar" bar={`foo`} >
<div
{...props}
a={1}
b="2"
>Inline Text</div>
<Component1>
Block Text
</Component1>
</a >)
}
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"@antfu/eslint-define-config": "^1.23.0-1",
"@stylistic/eslint-plugin": "0.0.6",
"@stylistic/eslint-plugin": "0.0.8",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"eslint-config-flat-gitignore": "^0.1.0",
Expand All @@ -64,7 +64,7 @@
"devDependencies": {
"@antfu/eslint-config": "workspace:*",
"@antfu/ni": "^0.21.8",
"@stylistic/eslint-plugin-migrate": "^0.0.6",
"@stylistic/eslint-plugin-migrate": "^0.0.8",
"@types/eslint": "^8.44.3",
"@types/fs-extra": "^11.0.2",
"@types/node": "^20.8.3",
Expand Down

0 comments on commit 2dfb5fd

Please sign in to comment.