Skip to content

Commit 3d4c2e3

Browse files
committed
feat: support latest eslint
1 parent be6f2f4 commit 3d4c2e3

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

eslint.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import eslintPluginSvelte from 'eslint-plugin-svelte';
2+
import * as svelteParser from 'svelte-eslint-parser';
3+
import * as typescriptParser from '@typescript-eslint/parser';
4+
import svelteConfig from './svelte.config.js';
5+
6+
export default [
7+
// add more generic rule sets here, such as:
8+
//js.configs.recommended,
9+
...eslintPluginSvelte.configs['flat/recommended'],
10+
{
11+
ignores: ['.svelte-kit/*', 'build/*', 'eslint.config.js', 'svelte.config.js']
12+
},
13+
{
14+
languageOptions: {
15+
parser: typescriptParser,
16+
parserOptions: {
17+
project: 'tsconfig.json',
18+
extraFileExtensions: ['.svelte'] // This is a required setting in `@typescript-eslint/parser` v4.24.0.
19+
}
20+
}
21+
},
22+
{
23+
files: ['**/*.svelte', '*.svelte'],
24+
languageOptions: {
25+
parser: svelteParser,
26+
parserOptions: {
27+
parser: typescriptParser,
28+
// Specify the `svelte.config.js`.
29+
svelteConfig
30+
}
31+
}
32+
}
33+
];

0 commit comments

Comments
 (0)