|
16 | 16 |
|
17 | 17 | import js from "@eslint/js";
|
18 | 18 | import prettier from "eslint-config-prettier";
|
| 19 | +import tseslint from "@typescript-eslint/eslint-plugin"; |
| 20 | +import tsparser from "@typescript-eslint/parser"; |
19 | 21 |
|
20 | 22 | export default [
|
21 |
| - { ignores: ["**/dist/**", "**/node_modules/**", "**/releases/**", "**/.angular/**"] }, |
| 23 | + { |
| 24 | + ignores: [ |
| 25 | + "dist/**", |
| 26 | + "node_modules/**", |
| 27 | + "releases/**", |
| 28 | + "*.tgz", |
| 29 | + "**/dist/**", |
| 30 | + "**/node_modules/**", |
| 31 | + "**/build/**", |
| 32 | + "**/.next/**", |
| 33 | + "**/coverage/**", |
| 34 | + "**/.angular/**", |
| 35 | + "**/cache/**", |
| 36 | + "**/.cache/**", |
| 37 | + ], |
| 38 | + }, |
22 | 39 | js.configs.recommended,
|
23 | 40 | prettier,
|
24 | 41 | {
|
25 |
| - files: ["**/*.{js,jsx,ts,tsx}"], |
| 42 | + files: ["**/*.{js,jsx}"], |
26 | 43 | languageOptions: {
|
27 | 44 | ecmaVersion: 2022,
|
28 | 45 | sourceType: "module",
|
| 46 | + globals: { |
| 47 | + window: "readonly", |
| 48 | + console: "readonly", |
| 49 | + document: "readonly", |
| 50 | + process: "readonly", |
| 51 | + Buffer: "readonly", |
| 52 | + __dirname: "readonly", |
| 53 | + __filename: "readonly", |
| 54 | + global: "readonly", |
| 55 | + module: "readonly", |
| 56 | + require: "readonly", |
| 57 | + exports: "readonly", |
| 58 | + setImmediate: "readonly", |
| 59 | + clearImmediate: "readonly", |
| 60 | + URL: "readonly", |
| 61 | + clearInterval: "readonly", |
| 62 | + clearTimeout: "readonly", |
| 63 | + setTimeout: "readonly", |
| 64 | + setInterval: "readonly", |
| 65 | + }, |
| 66 | + }, |
| 67 | + rules: { |
| 68 | + "no-unused-vars": "off", |
| 69 | + "no-console": "warn", |
| 70 | + "prefer-const": "error", |
| 71 | + "no-var": "error", |
| 72 | + "no-undef": "off", |
| 73 | + }, |
| 74 | + }, |
| 75 | + { |
| 76 | + files: ["**/*.{ts,tsx}"], |
| 77 | + languageOptions: { |
| 78 | + ecmaVersion: 2022, |
| 79 | + sourceType: "module", |
| 80 | + parser: tsparser, |
29 | 81 | parserOptions: {
|
30 | 82 | ecmaFeatures: {
|
31 | 83 | jsx: true,
|
32 | 84 | },
|
33 | 85 | },
|
| 86 | + globals: { |
| 87 | + window: "readonly", |
| 88 | + console: "readonly", |
| 89 | + document: "readonly", |
| 90 | + process: "readonly", |
| 91 | + Buffer: "readonly", |
| 92 | + __dirname: "readonly", |
| 93 | + __filename: "readonly", |
| 94 | + global: "readonly", |
| 95 | + module: "readonly", |
| 96 | + require: "readonly", |
| 97 | + exports: "readonly", |
| 98 | + setImmediate: "readonly", |
| 99 | + clearImmediate: "readonly", |
| 100 | + URL: "readonly", |
| 101 | + clearInterval: "readonly", |
| 102 | + clearTimeout: "readonly", |
| 103 | + setTimeout: "readonly", |
| 104 | + setInterval: "readonly", |
| 105 | + React: "readonly", |
| 106 | + describe: "readonly", |
| 107 | + it: "readonly", |
| 108 | + expect: "readonly", |
| 109 | + beforeEach: "readonly", |
| 110 | + afterEach: "readonly", |
| 111 | + beforeAll: "readonly", |
| 112 | + afterAll: "readonly", |
| 113 | + vi: "readonly", |
| 114 | + test: "readonly", |
| 115 | + jest: "readonly", |
| 116 | + }, |
| 117 | + }, |
| 118 | + plugins: { |
| 119 | + "@typescript-eslint": tseslint, |
34 | 120 | },
|
35 | 121 | rules: {
|
36 |
| - // Core JavaScript rules |
37 |
| - "no-unused-vars": ["error", { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }], |
| 122 | + "no-unused-vars": "off", |
| 123 | + "no-undef": "off", |
38 | 124 | "no-console": "warn",
|
39 | 125 | "prefer-const": "error",
|
40 | 126 | "no-var": "error",
|
41 |
| - |
42 |
| - // Security and best practices |
43 |
| - "no-debugger": "error", |
44 |
| - "no-eval": "error", |
45 |
| - "no-implied-eval": "error", |
46 |
| - "no-new-func": "error", |
47 |
| - "no-script-url": "error", |
48 |
| - "no-with": "error", |
49 |
| - |
50 |
| - // Modern JavaScript preferences |
51 |
| - "prefer-arrow-callback": "error", |
52 |
| - "prefer-template": "error", |
53 |
| - "prefer-destructuring": ["error", { object: true, array: false }], |
54 |
| - |
55 |
| - // Code quality |
56 |
| - eqeqeq: ["error", "always"], |
57 |
| - "no-duplicate-imports": "error", |
58 |
| - "no-useless-return": "error", |
59 |
| - "no-useless-concat": "error", |
| 127 | + "@typescript-eslint/no-unused-vars": [ |
| 128 | + "error", |
| 129 | + { varsIgnorePattern: "^_", argsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" }, |
| 130 | + ], |
| 131 | + "@typescript-eslint/no-explicit-any": "warn", |
60 | 132 | },
|
61 | 133 | },
|
62 | 134 | ];
|
0 commit comments