-
-
Notifications
You must be signed in to change notification settings - Fork 156
/
eslint.config.js
77 lines (73 loc) · 2.01 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
// @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';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default ts.config(
js.configs.recommended,
eslintPluginPrettierRecommended,
...ts.configs.strict,
...eslintPluginAstro.configs.recommended,
{
name: 'Ignore patterns',
ignores: ['.astro', '.vscode', 'dist', 'minecolonies', 'node_modules', 'public']
},
{
name: 'Application rules (Astro)',
files: ['**/*.astro'],
plugins: {
'@typescript-eslint': typescriptPlugin,
'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': typescriptPlugin,
'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'
}
}
);