-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
68 lines (65 loc) · 1.94 KB
/
eslint.config.mjs
File metadata and controls
68 lines (65 loc) · 1.94 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
import tsPlugin from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import prettierPlugin from "eslint-plugin-prettier";
/**
* ESLint flat config.
* - TypeScript parser + plugin for typed linting
* - Prettier plugin to keep formatting enforced by ESLint
* - Basic overrides for test files and generated or output folders
*/
export default [
// ignore common build/artifact folders
{
ignores: ["dist/**", "node_modules/**", "coverage/**"],
},
// General JS/TS settings
{
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.cjs", "**/*.mjs"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: ["./tsconfig.json"],
tsconfigRootDir: new URL(".", import.meta.url).pathname,
ecmaVersion: "latest",
sourceType: "module",
},
globals: {
// Runtime-specific globals (e.g., Bun for Bun runtime)
Bun: "readonly",
},
},
plugins: {
"@typescript-eslint": tsPlugin,
prettier: prettierPlugin,
},
rules: {
"prettier/prettier": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/no-unused-private-class-members": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
},
},
// Test files configuration
{
files: ["**/*.test.ts", "**/*.spec.ts"],
languageOptions: {
globals: {
describe: "readonly",
it: "readonly",
test: "readonly",
expect: "readonly",
beforeAll: "readonly",
afterAll: "readonly",
beforeEach: "readonly",
afterEach: "readonly",
},
},
rules: {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
},
},
];