-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
66 lines (64 loc) · 1.53 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
import jseslint from '@eslint/js'
import tsEslintParser from '@typescript-eslint/parser'
import eslintAstroPlugin from 'eslint-plugin-astro'
import eslintSimpleImportSortPlugin from 'eslint-plugin-simple-import-sort'
import globals from 'globals'
import tseslint from 'typescript-eslint'
const sharedConfigs = {
quotes: 'single',
semicolon: false,
}
export default [
{
ignores: ['.gitignore', '.astro/**', 'dist/**', '.history/**'],
plugins: {
'simple-import-sort': eslintSimpleImportSortPlugin,
},
languageOptions: {
sourceType: 'module',
ecmaVersion: 2023,
globals: {
...globals.browser,
...globals.node
}
},
rules: {
'comma-spacing': [
'error',
{
'before': false,
'after': true
}
],
'quotes': ['error', sharedConfigs.quotes],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
},
{
files: ['src/**/*.astro'],
plugins: {
'astro': eslintAstroPlugin,
},
...tseslint.configs.eslintRecommended,
...{ rules: eslintAstroPlugin.configs.recommended.rules },
languageOptions: {
parser: tsEslintParser,
},
rules: {
'astro/semi': ['error', sharedConfigs.semicolon ? 'always' : 'never'],
}
},
{
files: ['*.ts'],
...jseslint.configs.recommended,
...tseslint.configs.eslintRecommended,
languageOptions: {
parser: tsEslintParser,
}
},
{
files: ['*.mjs'],
...jseslint.configs.recommended,
},
]