-
-
Notifications
You must be signed in to change notification settings - Fork 157
/
eslint.config.js
75 lines (73 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
// @ts-check
import path from 'path';
import { fileURLToPath } from 'url';
import js from '@eslint/js';
import ts from 'typescript-eslint';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import eslintPluginAstro from 'eslint-plugin-astro';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default ts.config(
js.configs.recommended,
ts.configs.eslintRecommended,
...ts.configs.strict,
...eslintPluginAstro.configs.recommended,
eslintPluginPrettierRecommended,
{
name: 'Ignore patterns',
ignores: ['.astro', '.vscode', 'chart', 'dist', 'minecolonies', 'node_modules', 'public', 'pnpm-lock.yaml']
},
{
name: 'Application rules (Astro)',
files: ['**/*.astro'],
plugins: {
'@typescript-eslint': ts.plugin,
'simple-import-sort': simpleImportSort
},
rules: {
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_'
}
]
}
},
{
name: 'Application rules (Typescript)',
files: ['**/*.ts'],
languageOptions: {
parser: ts.parser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname
}
},
plugins: {
'@typescript-eslint': ts.plugin,
'simple-import-sort': simpleImportSort
},
rules: {
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_'
}
]
}
},
{
name: 'Disable triple slash reference for auto-generated env.d.ts',
files: ['src/env.d.ts'],
rules: {
'@typescript-eslint/triple-slash-reference': 'off'
}
}
);