-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
32 lines (29 loc) · 859 Bytes
/
eslint.config.mjs
File metadata and controls
32 lines (29 loc) · 859 Bytes
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
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginAstro from 'eslint-plugin-astro';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import fs from 'fs';
const folders = fs
.readdirSync('./', { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name);
folders.push('contentlayer');
export default [
...eslintPluginAstro.configs['flat/recommended'],
...eslintPluginAstro.configs['flat/jsx-a11y-recommended'],
eslintConfigPrettier,
{
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': [
'warn',
{
groups: [['^\\u0000', '^@?\\w'], [`^(${folders.join('|')})(/.*|$)`], ['^\\.'], ['^[^.]']].filter(
(rule) => rule
),
},
],
},
},
];