-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.js
83 lines (80 loc) · 1.99 KB
/
eslint.config.js
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import globals from 'globals';
import pluginJs from '@eslint/js';
import tsEslint from 'typescript-eslint';
import eslintPluginSvelte from 'eslint-plugin-svelte';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import eslintConfigPrettier from 'eslint-config-prettier';
import svelteConfig from './svelte.config.mjs';
const extraFileExtensions = ['.svelte'];
/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ['**/*.{ts}'] },
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
// ts
...tsEslint.configs.recommended,
{
languageOptions: {
parserOptions: {
extraFileExtensions,
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
// svelte
...eslintPluginSvelte.configs['flat/recommended'],
{
files: ['src/**/*.svelte'],
languageOptions: {
parserOptions: {
extraFileExtensions,
parser: tsEslint.parser,
svelteConfig: svelteConfig,
},
},
},
// prettier
eslintConfigPrettier,
...eslintPluginSvelte.configs['flat/prettier'],
// other
{
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/strict-boolean-expressions': ['error', { allowNullableBoolean: true }],
'@typescript-eslint/no-unnecessary-condition': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
},
{
ignores: [
'.git/',
'.DS_Store/',
'.vite',
'node_modules/',
'src-tauri/',
'out/',
'dist/',
'build/',
'scripts/',
'resources/',
'examples/',
'patches/',
'package-lock.json',
// config files
'tailwind.config.ts',
'eslint.config.js',
'vite.config.ts',
'postcss.config.cjs',
'electron.vite.config.ts',
'svelte.config.mjs',
'commitlint.config.cjs',
],
},
];