-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.js
89 lines (87 loc) · 2.29 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// @ts-check
import eslint from "@eslint/js";
// @ts-expect-error eslint-plugin-import does indeed have a default export
import importPlugin from "eslint-plugin-import";
import importSortPlugin from "eslint-plugin-simple-import-sort";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
ignores: ["**/dist/**"],
},
{
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
},
languageOptions: {
globals: {
process: "readonly",
},
},
},
{
files: [".changeset/commit.cjs"],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
plugins: {
import: importPlugin,
"simple-import-sort": importSortPlugin,
},
rules: {
"@typescript-eslint/consistent-type-imports": [
"error",
{ prefer: "type-imports", disallowTypeAnnotations: true },
],
"import/consistent-type-specifier-style": "error",
"import/extensions": ["error", "ignorePackages"],
"import/first": "error",
"import/newline-after-import": "error",
"import/no-absolute-path": "error",
"import/no-amd": "error",
"import/no-default-export": "error",
"import/no-duplicates": "error",
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: true,
peerDependencies: true,
optionalDependencies: false,
},
],
"import/no-mutable-exports": "error",
"import/no-named-default": "error",
"import/no-named-export": "off", // we want everything to be a named export
"import/no-self-import": "error",
"import/prefer-default-export": "off", // we want everything to be named
"simple-import-sort/imports": "error",
},
},
{
files: ["packages/react/**/*"],
rules: {
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: true,
peerDependencies: true,
optionalDependencies: false,
packageDir: "packages/react",
},
],
},
},
);