@@ -11,7 +11,8 @@ const legacyBaseContent = `/*
1111 * This file has been automatically generated,
1212 * in order to update its content execute "pnpm run update"
1313 */
14- export = {
14+ import type { Linter } from 'eslint'
15+ const config: Linter.Config = {
1516 plugins: ["svelte"],
1617 overrides: [
1718 {
@@ -36,6 +37,7 @@ export = {
3637 },
3738 ],
3839}
40+ export = config
3941` ;
4042
4143const legacyBaseFilePath = path . resolve ( __dirname , '../src/configs/base.ts' ) ;
@@ -48,11 +50,12 @@ const legacyRecommendedContent = `/*
4850 * This file has been automatically generated,
4951 * in order to update its content execute "pnpm run update"
5052 */
51- import path from "path"
53+ import type { Linter } from 'eslint'
54+ import path from "node:path"
5255const base = require.resolve("./base")
5356const baseExtend =
5457 path.extname(\`\${base}\`) === ".ts" ? "plugin:svelte/base" : base
55- export = {
58+ const config: Linter.Config = {
5659 extends: [baseExtend],
5760 rules: {
5861 // eslint-plugin-svelte rules
@@ -65,6 +68,7 @@ export = {
6568 . join ( ',\n ' ) } ,
6669 },
6770}
71+ export = config
6872` ;
6973
7074const legacyRecommendedFilePath = path . resolve ( __dirname , '../src/configs/recommended.ts' ) ;
@@ -77,11 +81,12 @@ const legacyPrettierContent = `/*
7781 * This file has been automatically generated,
7882 * in order to update its content execute "pnpm run update"
7983 */
80- import path from "path"
84+ import type { Linter } from 'eslint'
85+ import path from "node:path"
8186const base = require.resolve("./base")
8287const baseExtend =
8388 path.extname(\`\${base}\`) === ".ts" ? "plugin:svelte/base" : base
84- export = {
89+ const config: Linter.Config = {
8590 extends: [baseExtend],
8691 rules: {
8792 // eslint-plugin-svelte rules
@@ -91,6 +96,7 @@ export = {
9196 . join ( ',\n ' ) } ,
9297 },
9398}
99+ export = config
94100` ;
95101
96102const legacyPrettierFilePath = path . resolve ( __dirname , '../src/configs/prettier.ts' ) ;
@@ -107,8 +113,8 @@ const baseContent = `/*
107113 * This file has been automatically generated,
108114 * in order to update its content execute "pnpm run update"
109115 */
110- import type { ESLint } from 'eslint';
111- export default [
116+ import type { ESLint, Linter } from 'eslint';
117+ const config: Linter.FlatConfig[] = [
112118 {
113119 name: 'svelte:base:setup-plugin',
114120 plugins: {
@@ -144,6 +150,7 @@ export default [
144150 processor: 'svelte/svelte'
145151 },
146152]
153+ export default config
147154` ;
148155
149156const baseFilePath = path . resolve ( __dirname , '../src/configs/flat/base.ts' ) ;
@@ -156,8 +163,9 @@ const recommendedContent = `/*
156163 * This file has been automatically generated,
157164 * in order to update its content execute "pnpm run update"
158165 */
166+ import type { Linter } from 'eslint';
159167import base from "./base"
160- export default [
168+ const config: Linter.FlatConfig[] = [
161169 ...base,
162170 {
163171 name: 'svelte:recommended:rules',
@@ -173,6 +181,7 @@ export default [
173181 },
174182 }
175183]
184+ export default config
176185` ;
177186
178187const recommendedFilePath = path . resolve ( __dirname , '../src/configs/flat/recommended.ts' ) ;
@@ -185,8 +194,9 @@ const prettierContent = `/*
185194 * This file has been automatically generated,
186195 * in order to update its content execute "pnpm run update"
187196 */
197+ import type { Linter } from 'eslint';
188198import base from "./base"
189- export default [
199+ const config: Linter.FlatConfig[] = [
190200 ...base,
191201 {
192202 name: 'svelte:prettier:turn-off-rules',
@@ -199,6 +209,7 @@ export default [
199209 },
200210 }
201211]
212+ export default config
202213` ;
203214
204215const prettierFilePath = path . resolve ( __dirname , '../src/configs/flat/prettier.ts' ) ;
0 commit comments