-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
57 lines (55 loc) · 1.28 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
import eslint from "@eslint/js";
import prettier from "eslint-config-prettier";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import solid from "eslint-plugin-solid/configs/typescript.js";
import tseslint from "typescript-eslint";
/**
* this is for simple-import-sort plugin. imports will be grouped before sorting.
* it's the default plugin config, plus one custom group (project imports)
* @type {string[][]}
*/
const importGroups = [
[
// side effect imports
"^\\u0000",
// packages
"^@?\\w",
// project imports
"^(@|app|common)(/.*|$)",
// anything else
"^",
// relative imports
"^\\.",
],
];
/** @type { import('eslint').Linter.FlatConfig[] } */
export default tseslint.config(
{
ignores: ["dist/*", "node_modules/*"],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
prettier,
{
...solid,
files: ["{app,common}/*.{ts,tsx}"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: "tsconfig.json",
},
},
plugins: {
"simple-import-sort": simpleImportSort,
},
...eslint.configs.recommended,
rules: {
"simple-import-sort/imports": [
"error",
{
groups: importGroups,
},
],
},
},
);