-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
47 lines (46 loc) · 1.46 KB
/
eslint.config.js
File metadata and controls
47 lines (46 loc) · 1.46 KB
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
import tsParser from '@typescript-eslint/parser';
import eslintPluginAstro from 'eslint-plugin-astro';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
export default [
{ ignores: ['.astro/**', 'node_modules/**', 'dist/**'] },
...eslintPluginAstro.configs.recommended,
{
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
},
},
{
files: ['**/*.{js,jsx,ts,tsx,astro}'],
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': [
'error',
{
groups: [
// 1. Astro and third-party packages
['^astro$', '^astro[/:]', '^@?\\w'],
// 2. Absolute imports and other imports such as Vue-style `@/foo`.
// Anything not matched in another group. (also relative imports starting with "../")
['^@', '^'],
// 3. relative imports from same folder "./"
['^\\./'],
// 4. Side effect imports. Example: import reset.css and global styles.
['^\\u0000'],
// 5. style module imports always come last, this helps to avoid CSS order issues
['^.+\\.(module.css|module.scss)$'],
// 6. media imports
['^.+\\.(gif|png|svg|jpg)$'],
],
},
],
'simple-import-sort/exports': 'error',
},
},
];