-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy patheslint.config.js
More file actions
48 lines (38 loc) · 1.43 KB
/
eslint.config.js
File metadata and controls
48 lines (38 loc) · 1.43 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
48
import js from "@eslint/js"
import ts from "typescript-eslint"
import prettier from "eslint-plugin-prettier/recommended"
import imports from "eslint-plugin-import-x"
/** @type {import('typescript-eslint').Config} */
const config = [
{ ignores: ["dist", "docs", "coverage"] },
{ ignores: ["eslint.config.js", "vitest.config.ts", "tsdown.config.ts"] },
js.configs.recommended,
...ts.configs.recommendedTypeChecked,
{ languageOptions: { parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname } } },
imports.flatConfigs.recommended,
imports.flatConfigs.typescript,
prettier,
{
rules: {
"sort-imports": ["warn", { allowSeparatedGroups: true, ignoreDeclarationSort: true }],
"import-x/no-default-export": "error",
"import-x/no-duplicates": ["error", { "prefer-inline": true }],
"import-x/newline-after-import": "error",
"import-x/no-named-as-default-member": "off",
"import-x/order": [
"error",
{
"newlines-between": "always",
"groups": ["builtin", "external", "internal", "parent", "sibling"],
"pathGroupsExcludedImportTypes": [],
"alphabetize": { order: "asc", orderImportKind: "desc", caseInsensitive: true },
},
],
},
},
{
files: ["src/index.ts", "src/rules/*/*.ts"],
rules: { "import-x/no-default-export": "off", "import-x/prefer-default-export": "error" },
},
]
export default config