|
1 |
| -import eslint from "@eslint/js"; |
2 |
| -import tseslint from "@typescript-eslint/eslint-plugin"; |
3 |
| -import typescript from "@typescript-eslint/parser"; |
4 |
| -import prettier from "eslint-config-prettier"; |
5 |
| -import vitest from "eslint-plugin-vitest"; // Add Vitest plugin |
| 1 | +import eslintGlobalConfig from "../../eslint.global.mjs"; |
6 | 2 |
|
7 |
| -export default [ |
8 |
| - // JavaScript and TypeScript files |
9 |
| - { |
10 |
| - files: ["src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "src/**/*.ts"], |
11 |
| - languageOptions: { |
12 |
| - parser: typescript, |
13 |
| - parserOptions: { |
14 |
| - ecmaVersion: "latest", |
15 |
| - sourceType: "module", |
16 |
| - project: "./tsconfig.json", // Make sure your tsconfig includes @types/node |
17 |
| - }, |
18 |
| - globals: { |
19 |
| - // Add Node.js globals |
20 |
| - NodeJS: "readonly", |
21 |
| - console: "readonly", |
22 |
| - process: "readonly", |
23 |
| - Buffer: "readonly", |
24 |
| - __dirname: "readonly", |
25 |
| - __filename: "readonly", |
26 |
| - module: "readonly", |
27 |
| - require: "readonly", |
28 |
| - }, |
29 |
| - }, |
30 |
| - plugins: { |
31 |
| - "@typescript-eslint": tseslint, |
32 |
| - }, |
33 |
| - rules: { |
34 |
| - ...eslint.configs.recommended.rules, |
35 |
| - ...tseslint.configs.recommended.rules, |
36 |
| - "prefer-const": "warn", |
37 |
| - "no-constant-binary-expression": "error", |
38 |
| - |
39 |
| - // Disable no-undef as TypeScript handles this better |
40 |
| - "no-undef": "off", |
41 |
| - "@typescript-eslint/no-unsafe-function-type": "off", |
42 |
| - // Customize TypeScript rules |
43 |
| - "@typescript-eslint/no-explicit-any": "off", |
44 |
| - "@typescript-eslint/no-unused-vars": [ |
45 |
| - "error", |
46 |
| - { |
47 |
| - argsIgnorePattern: "^_", |
48 |
| - varsIgnorePattern: "^_", |
49 |
| - ignoreRestSiblings: true, |
50 |
| - }, |
51 |
| - ], |
52 |
| - }, |
53 |
| - }, |
54 |
| - // Vitest configuration |
55 |
| - { |
56 |
| - files: [ |
57 |
| - "src/**/*.test.js", |
58 |
| - "src/**/*.test.ts", |
59 |
| - "src/**/*.spec.js", |
60 |
| - "src/**/*.spec.ts", |
61 |
| - ], |
62 |
| - plugins: { |
63 |
| - vitest, // Register Vitest plugin |
64 |
| - }, |
65 |
| - rules: { |
66 |
| - ...vitest.configs.recommended.rules, |
67 |
| - }, |
68 |
| - }, |
69 |
| - // Add prettier as the last config to override other formatting rules |
70 |
| - prettier, |
71 |
| -]; |
| 3 | +export default [...eslintGlobalConfig]; |
0 commit comments