-
-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy patheslint.config.ts
More file actions
83 lines (81 loc) · 2.13 KB
/
eslint.config.ts
File metadata and controls
83 lines (81 loc) · 2.13 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";
const ignoreConfig = buildIgnoreConfig(path.join(import.meta.dirname, ".gitignore"), [
".*/**",
"apps",
"docs",
"test",
"examples",
"**/*.d.ts",
...GLOB_TESTS,
]);
export default defineConfig(
...ignoreConfig,
// Skip ESLint 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",
],
},
// Main TypeScript configuration with strict type checking
{
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,
},
},
},
// Relaxed config for scripts and config files (no type checking)
{
extends: [
disableTypeChecked,
],
files: [...GLOB_SCRIPTS, ...GLOB_CONFIGS],
languageOptions: {
parserOptions: {
project: false,
projectService: false,
},
},
rules: {
"no-console": "off",
"perfectionist/sort-objects": "off",
},
},
// package.json linting (recommended-publishable preset)
packageJson.configs["recommended-publishable"],
// Disable ESLint core rules that conflict with TypeScript
disableProblematicEslintJsRules,
);