Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
77 lines (69 loc) · 1.72 KB
/
Copy patheslint.config.js
File metadata and controls
77 lines (69 loc) · 1.72 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
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import globals from "globals";
import eslintPluginPrettier from "eslint-plugin-prettier/recommended";
export default tseslint.config(
// Global ignores
{
ignores: [
"**/dist/",
"**/out/",
"**/node_modules/",
"**/*.d.ts",
"**/coverage/",
"packages/tree-sitter-blueprint/",
"**/.vscode-test/",
],
},
// Base ESLint recommended config
eslint.configs.recommended,
// TypeScript ESLint recommended configs
...tseslint.configs.recommended,
// Global settings for all files
{
languageOptions: {
globals: {
...globals.node,
},
},
},
// TypeScript-specific settings
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// Allow unused vars prefixed with underscore
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
// Allow explicit any in some cases (can be tightened later)
"@typescript-eslint/no-explicit-any": "warn",
},
},
// Test files - more relaxed rules
{
files: ["**/*.test.ts", "**/*.spec.ts"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
},
// JavaScript files - disable type-checked rules
{
files: ["**/*.js", "**/*.mjs", "**/*.cjs"],
...tseslint.configs.disableTypeChecked,
},
// Prettier must be last to override other formatting rules
eslintPluginPrettier
);