-
-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy patheslint.config.ts
More file actions
83 lines (82 loc) · 2.03 KB
/
Copy patheslint.config.ts
File metadata and controls
83 lines (82 loc) · 2.03 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
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
import {
GLOB_CONFIGS,
GLOB_SCRIPTS,
GLOB_TESTS,
GLOB_TS,
buildIgnoreConfig,
disableProblematicEslintJsRules,
disableTypeChecked,
strictTypeChecked,
} from "@local/configs/eslint";
import packageJson from "eslint-plugin-package-json";
import { defineConfig } from "eslint/config";
import importIntegrityPlugin from "import-integrity-lint";
import path from "node:path";
import tseslint from "typescript-eslint";
export default defineConfig(
...buildIgnoreConfig(path.join(import.meta.dirname, ".gitignore"), [
"**/*.d.ts",
"apps",
"docs",
"examples",
"testing",
...GLOB_TESTS,
]),
{
// Skip checks for rules ported directly from upstream
ignores: [
"plugins/eslint-plugin-react-x/src/rules/exhaustive-deps",
"plugins/eslint-plugin-react-x/src/rules/rules-of-hooks",
],
},
// TypeScript Configuration (Main)
{
extends: [
strictTypeChecked,
// @ts-expect-error - TODO: remove when type issue is resolved
importIntegrityPlugin.configs.recommended,
],
files: GLOB_TS,
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"import-integrity/no-test-only-imports": "off",
"import-integrity/no-unresolved-imports": "off",
"import-integrity/no-unused-exports": "off",
},
settings: {
"import-integrity": {
packageRootDir: import.meta.dirname,
},
},
},
// Scripts and Configs (Relaxed, No Type Checking)
{
extends: [
disableTypeChecked,
],
files: [
...GLOB_CONFIGS,
...GLOB_SCRIPTS,
],
languageOptions: {
parserOptions: {
project: false,
projectService: false,
},
},
rules: {
"@typescript-eslint/no-non-null-assertion": "off",
"no-console": "off",
"perfectionist/sort-objects": "off",
},
},
// Other Presets
packageJson.configs["recommended-publishable"],
disableProblematicEslintJsRules,
);