-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
54 lines (49 loc) · 1.23 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import globals from 'globals';
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import svelte from 'eslint-plugin-svelte';
import svelteParser from 'svelte-eslint-parser';
const tsconfig = tseslint.config({
files: ['**/*.js', '**/*.ts', '**/*.svelte'],
extends: [
js.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
...svelte.configs['flat/recommended']
],
ignores: ['svelte.config.js'],
languageOptions: {
globals: globals.browser,
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
extraFileExtensions: ['.svelte']
}
}
});
const svelteConfig = tseslint.config({
files: ['**/*.svelte'],
extends: [...svelte.configs['flat/recommended']],
languageOptions: {
parser: svelteParser,
parserOptions: { parser: tseslint.parser }
}
});
const jsConfig = {
files: ['**/*.js'],
rules: { '@typescript-eslint/explicit-function-return-type': 'off' }
};
const configConfig = {
files: ['**/*.config.*'],
rules: { '@typescript-eslint/naming-convention': 'off' }
};
export default [
{
ignores: ['.svelte-kit/*', '.vercel/*', 'node_modules']
},
...tsconfig,
...svelteConfig,
jsConfig,
configConfig
];