@@ -8,13 +8,13 @@ module.exports = defineConfig({
88 'eslint:recommended' ,
99 'plugin:node/recommended' ,
1010 'plugin:@typescript-eslint/recommended' ,
11- 'plugin:regexp/recommended'
11+ 'plugin:regexp/recommended' ,
1212 ] ,
1313 plugins : [ 'import' , 'regexp' ] ,
1414 parser : '@typescript-eslint/parser' ,
1515 parserOptions : {
1616 sourceType : 'module' ,
17- ecmaVersion : 2021
17+ ecmaVersion : 2021 ,
1818 } ,
1919 rules : {
2020 eqeqeq : [ 'warn' , 'always' , { null : 'never' } ] ,
@@ -25,36 +25,36 @@ module.exports = defineConfig({
2525 'prefer-const' : [
2626 'warn' ,
2727 {
28- destructuring : 'all'
29- }
28+ destructuring : 'all' ,
29+ } ,
3030 ] ,
3131
3232 'node/no-missing-import' : [
3333 'error' ,
3434 {
3535 allowModules : [ 'types' , 'estree' , 'less' , 'sass' , 'stylus' ] ,
36- tryExtensions : [ '.ts' , '.js' , '.jsx' , '.tsx' , '.d.ts' ]
37- }
36+ tryExtensions : [ '.ts' , '.js' , '.jsx' , '.tsx' , '.d.ts' ] ,
37+ } ,
3838 ] ,
3939 'node/no-missing-require' : [
4040 'error' ,
4141 {
4242 // for try-catching yarn pnp
4343 allowModules : [ 'pnpapi' , 'vite' ] ,
44- tryExtensions : [ '.ts' , '.js' , '.jsx' , '.tsx' , '.d.ts' ]
45- }
44+ tryExtensions : [ '.ts' , '.js' , '.jsx' , '.tsx' , '.d.ts' ] ,
45+ } ,
4646 ] ,
4747 'node/no-extraneous-import' : [
4848 'error' ,
4949 {
50- allowModules : [ 'vite' , 'less' , 'sass' , 'vitest' ]
51- }
50+ allowModules : [ 'vite' , 'less' , 'sass' , 'vitest' ] ,
51+ } ,
5252 ] ,
5353 'node/no-extraneous-require' : [
5454 'error' ,
5555 {
56- allowModules : [ 'vite' ]
57- }
56+ allowModules : [ 'vite' ] ,
57+ } ,
5858 ] ,
5959 'node/no-deprecated-api' : 'off' ,
6060 'node/no-unpublished-import' : 'off' ,
@@ -65,11 +65,11 @@ module.exports = defineConfig({
6565 '@typescript-eslint/ban-types' : 'off' , // TODO: we should turn this on in a new PR
6666 '@typescript-eslint/explicit-module-boundary-types' : [
6767 'error' ,
68- { allowArgumentsExplicitlyTypedAsAny : true }
68+ { allowArgumentsExplicitlyTypedAsAny : true } ,
6969 ] ,
7070 '@typescript-eslint/no-empty-function' : [
7171 'error' ,
72- { allow : [ 'arrowFunctions' ] }
72+ { allow : [ 'arrowFunctions' ] } ,
7373 ] ,
7474 '@typescript-eslint/no-empty-interface' : 'off' ,
7575 '@typescript-eslint/no-explicit-any' : 'off' , // maybe we should turn this on in a new PR
@@ -80,12 +80,12 @@ module.exports = defineConfig({
8080 '@typescript-eslint/no-var-requires' : 'off' ,
8181 '@typescript-eslint/consistent-type-imports' : [
8282 'error' ,
83- { prefer : 'type-imports' }
83+ { prefer : 'type-imports' } ,
8484 ] ,
8585
8686 'import/no-nodejs-modules' : [
8787 'error' ,
88- { allow : builtinModules . map ( ( mod ) => `node:${ mod } ` ) }
88+ { allow : builtinModules . map ( ( mod ) => `node:${ mod } ` ) } ,
8989 ] ,
9090 'import/no-duplicates' : 'error' ,
9191 'import/order' : 'error' ,
@@ -96,56 +96,61 @@ module.exports = defineConfig({
9696 ignoreDeclarationSort : true ,
9797 ignoreMemberSort : false ,
9898 memberSyntaxSortOrder : [ 'none' , 'all' , 'multiple' , 'single' ] ,
99- allowSeparatedGroups : false
100- }
99+ allowSeparatedGroups : false ,
100+ } ,
101101 ] ,
102102
103- 'regexp/no-contradiction-with-assertion' : 'error'
103+ 'regexp/no-contradiction-with-assertion' : 'error' ,
104104 } ,
105105 overrides : [
106106 {
107107 files : [ 'packages/**' ] ,
108108 excludedFiles : '**/__tests__/**' ,
109109 rules : {
110- 'no-restricted-globals' : [ 'error' , 'require' , '__dirname' , '__filename' ]
111- }
110+ 'no-restricted-globals' : [
111+ 'error' ,
112+ 'require' ,
113+ '__dirname' ,
114+ '__filename' ,
115+ ] ,
116+ } ,
112117 } ,
113118 {
114119 files : 'packages/vite/**/*.*' ,
115120 rules : {
116121 'node/no-restricted-require' : [
117122 'error' ,
118123 Object . keys (
119- require ( './packages/vite/package.json' ) . devDependencies
124+ require ( './packages/vite/package.json' ) . devDependencies ,
120125 ) . map ( ( d ) => ( {
121126 name : d ,
122127 message :
123128 `devDependencies can only be imported using ESM syntax so ` +
124129 `that they are included in the rollup bundle. If you are trying to ` +
125- `lazy load a dependency, use (await import('dependency')).default instead.`
126- } ) )
127- ]
128- }
130+ `lazy load a dependency, use (await import('dependency')).default instead.` ,
131+ } ) ) ,
132+ ] ,
133+ } ,
129134 } ,
130135 {
131136 files : [ 'packages/vite/src/node/**' ] ,
132137 rules : {
133- 'no-console' : [ 'error' ]
134- }
138+ 'no-console' : [ 'error' ] ,
139+ } ,
135140 } ,
136141 {
137142 files : [ 'packages/vite/src/types/**' , '*.spec.ts' ] ,
138143 rules : {
139- 'node/no-extraneous-import' : 'off'
140- }
144+ 'node/no-extraneous-import' : 'off' ,
145+ } ,
141146 } ,
142147 {
143148 files : [ 'packages/create-vite/template-*/**' , '**/build.config.ts' ] ,
144149 rules : {
145150 'no-undef' : 'off' ,
146151 'node/no-missing-import' : 'off' ,
147- '@typescript-eslint/explicit-module-boundary-types' : 'off'
148- }
152+ '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
153+ } ,
149154 } ,
150155 {
151156 files : [ 'playground/**' ] ,
@@ -158,17 +163,17 @@ module.exports = defineConfig({
158163 'node/no-unsupported-features/es-builtins' : [
159164 'error' ,
160165 {
161- version : '^14.18.0 || >=16.0.0'
162- }
166+ version : '^14.18.0 || >=16.0.0' ,
167+ } ,
163168 ] ,
164169 'node/no-unsupported-features/node-builtins' : [
165170 'error' ,
166171 {
167- version : '^14.18.0 || >=16.0.0'
168- }
172+ version : '^14.18.0 || >=16.0.0' ,
173+ } ,
169174 ] ,
170- '@typescript-eslint/explicit-module-boundary-types' : 'off'
171- }
175+ '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
176+ } ,
172177 } ,
173178 {
174179 files : [ 'playground/**' ] ,
@@ -177,21 +182,21 @@ module.exports = defineConfig({
177182 'no-undef' : 'off' ,
178183 'no-empty' : 'off' ,
179184 'no-constant-condition' : 'off' ,
180- '@typescript-eslint/no-empty-function' : 'off'
181- }
185+ '@typescript-eslint/no-empty-function' : 'off' ,
186+ } ,
182187 } ,
183188 {
184189 files : [ '*.js' , '*.mjs' , '*.cjs' ] ,
185190 rules : {
186- '@typescript-eslint/explicit-module-boundary-types' : 'off'
187- }
191+ '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
192+ } ,
188193 } ,
189194 {
190195 files : [ '*.d.ts' ] ,
191196 rules : {
192- '@typescript-eslint/triple-slash-reference' : 'off'
193- }
194- }
197+ '@typescript-eslint/triple-slash-reference' : 'off' ,
198+ } ,
199+ } ,
195200 ] ,
196- reportUnusedDisableDirectives : true
201+ reportUnusedDisableDirectives : true ,
197202} )
0 commit comments