-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy patheslint.config.mjs
More file actions
69 lines (68 loc) · 1.62 KB
/
eslint.config.mjs
File metadata and controls
69 lines (68 loc) · 1.62 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
import globals from "globals";
import js from "@eslint/js";
import typescriptParser from "@typescript-eslint/parser";
import typescriptPlugin from "@typescript-eslint/eslint-plugin";
/** @type {import('eslint').Linter.Config[]} */
export default [
// Base config for all files
{
files: ["**/*.{js,mjs,cjs,ts}"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
},
// JavaScript-specific config
js.configs.recommended,
// TypeScript-specific config for source files (excluding tests)
{
files: ["src/**/*.ts"],
ignores: ["**/*.test.ts"],
languageOptions: {
parser: typescriptParser,
parserOptions: {
project: "./tsconfig.json",
},
},
plugins: {
"@typescript-eslint": typescriptPlugin,
},
rules: {
...typescriptPlugin.configs.recommended.rules,
},
},
// TypeScript-specific config for test files
{
files: ["**/*.test.ts"],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2022,
},
globals: {
...globals.jest,
describe: "readonly",
it: "readonly",
test: "readonly",
expect: "readonly",
beforeEach: "readonly",
afterEach: "readonly",
beforeAll: "readonly",
afterAll: "readonly",
jest: "readonly",
fail: "readonly",
},
},
plugins: {
"@typescript-eslint": typescriptPlugin,
},
rules: {
...typescriptPlugin.configs.recommended.rules,
},
},
];