File tree 5 files changed +31
-1
lines changed
5 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 9
9
javascript ,
10
10
jsdoc ,
11
11
jsonc ,
12
+ jsx ,
12
13
node ,
13
14
perfectionist ,
14
15
react ,
@@ -38,6 +39,7 @@ const configs = await combine(
38
39
javascript ( ) ,
39
40
jsdoc ( ) ,
40
41
jsonc ( ) ,
42
+ jsx ( ) ,
41
43
node ( ) ,
42
44
perfectionist ( ) ,
43
45
react ( ) ,
Original file line number Diff line number Diff line change @@ -19,3 +19,4 @@ export * from './svelte'
19
19
export * from './tailwindcss'
20
20
export * from './command'
21
21
export * from './regexp'
22
+ export * from './jsx'
Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ export async function javascript(
36
36
linterOptions : {
37
37
reportUnusedDisableDirectives : true ,
38
38
} ,
39
+ name : 'coderwyd/javascript/setup' ,
40
+ } ,
41
+ {
39
42
name : 'coderwyd/javascript/rules' ,
40
43
plugins : {
41
44
'unused-imports' : pluginUnusedImports ,
Original file line number Diff line number Diff line change
1
+ import { GLOB_JSX , GLOB_TSX } from '../constants/glob'
2
+ import type { TypedFlatConfigItem } from '../types'
3
+
4
+ export async function jsx ( ) : Promise < TypedFlatConfigItem [ ] > {
5
+ return [
6
+ {
7
+ files : [ GLOB_JSX , GLOB_TSX ] ,
8
+ languageOptions : {
9
+ parserOptions : {
10
+ ecmaFeatures : {
11
+ jsx : true ,
12
+ } ,
13
+ } ,
14
+ } ,
15
+ name : 'coderwyd/jsx/setup' ,
16
+ } ,
17
+ ]
18
+ }
Original file line number Diff line number Diff line change 8
8
javascript ,
9
9
jsdoc ,
10
10
jsonc ,
11
+ jsx ,
11
12
node ,
12
13
perfectionist ,
13
14
react ,
@@ -89,6 +90,7 @@ export async function defineConfig(
89
90
} ,
90
91
gitignore : enableGitignore = true ,
91
92
isInEditor = defaultIsInEditor ,
93
+ jsx : enableJsx = true ,
92
94
react : enableReact = false ,
93
95
regexp : enableRegexp = true ,
94
96
svelte : enableSvelte = false ,
@@ -106,7 +108,7 @@ export async function defineConfig(
106
108
: { }
107
109
108
110
if ( stylisticOptions && ! ( 'jsx' in stylisticOptions ) )
109
- stylisticOptions . jsx = options . jsx ?? true
111
+ stylisticOptions . jsx = enableJsx
110
112
111
113
const configs : Awaitable < TypedFlatConfigItem [ ] > [ ] = [ ]
112
114
@@ -157,6 +159,10 @@ export async function defineConfig(
157
159
if ( enableVue )
158
160
componentExts . push ( 'vue' )
159
161
162
+ if ( enableJsx ) {
163
+ configs . push ( jsx ( ) )
164
+ }
165
+
160
166
if ( enableTypeScript ) {
161
167
configs . push (
162
168
typescript ( {
You can’t perform that action at this time.
0 commit comments