-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
50 lines (45 loc) · 1.34 KB
/
Copy patheslint.config.mjs
File metadata and controls
50 lines (45 loc) · 1.34 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
import tsParser from "@typescript-eslint/parser";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import nPlugin from "eslint-plugin-n";
export default [
{
ignores: ["**/node_modules/**", "**/dist/**", "**/.squad/**"],
},
// Source packages — type-aware rules enabled via tsconfig project service
{
files: ["packages/**/*.ts", "packages/**/*.tsx"],
languageOptions: {
parser: tsParser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
"@typescript-eslint": tsPlugin,
n: nPlugin,
},
rules: {
// Catch fire-and-forget promises and missing awaits
"@typescript-eslint/no-floating-promises": "warn",
// Flag synchronous I/O inside functions (allowAtRootLevel
// permits sync calls in module-level config/setup code)
"n/no-sync": ["warn", { allowAtRootLevel: true }],
// Prevent console.log in production; allow warn/error
"no-console": ["warn", { allow: ["warn", "error"] }],
},
},
// Test files — no tsconfig coverage, so only non-type-aware rules
{
files: ["test/**/*.ts"],
languageOptions: {
parser: tsParser,
},
plugins: {
"@typescript-eslint": tsPlugin,
},
rules: {
"no-console": ["warn", { allow: ["warn", "error"] }],
},
},
];