|
1 | 1 | import eslint from "@eslint/js"; |
2 | | -import tseslint from "typescript-eslint"; |
3 | 2 | import unicorn from "eslint-plugin-unicorn"; |
| 3 | +import tseslint from "typescript-eslint"; |
4 | 4 |
|
5 | 5 | export default tseslint.config( |
6 | | - { |
7 | | - // config with just ignores is separate object |
8 | | - ignores: [ |
9 | | - "node_modules/**", |
10 | | - "dist/**", |
11 | | - "build/**", |
12 | | - ".firebase/**", |
13 | | - "firebase-debug.log", |
14 | | - "firestore-debug.log", |
15 | | - "functions/lib/**", |
16 | | - ], |
17 | | - }, |
18 | | - eslint.configs.recommended, |
19 | | - ...tseslint.configs.strictTypeChecked, |
20 | | - ...tseslint.configs.stylisticTypeChecked, |
21 | | - unicorn.configs.recommended, |
22 | | - { |
23 | | - plugins: { |
24 | | - unicorn, |
25 | | - }, |
26 | | - }, |
27 | | - { |
28 | | - files: ["**/*.{js,jsx,ts,tsx}"], |
29 | | - languageOptions: { |
30 | | - parserOptions: { |
31 | | - project: true, |
32 | | - tsconfigRootDir: import.meta.dirname, |
33 | | - }, |
34 | | - }, |
35 | | - }, |
36 | | - // { |
37 | | - // files: ["eslint.config.js"], |
38 | | - // rules: { |
39 | | - // "unicorn/filename-case": ["error", { case: "kebabCase" }], |
40 | | - // }, |
41 | | - // }, |
42 | | - { |
43 | | - files: ["functions/**/*.{js,jsx,ts,tsx}"], |
44 | | - languageOptions: { |
45 | | - globals: { |
46 | | - // Node.js globals for Firebase Functions |
47 | | - console: "readonly", |
48 | | - process: "readonly", |
49 | | - Buffer: "readonly", |
50 | | - __dirname: "readonly", |
51 | | - __filename: "readonly", |
52 | | - global: "readonly", |
53 | | - module: "readonly", |
54 | | - require: "readonly", |
55 | | - exports: "readonly", |
56 | | - }, |
57 | | - }, |
58 | | - }, |
59 | | - { |
60 | | - files: ["**/*.{js,jsx}"], |
61 | | - rules: { |
62 | | - // Disable TypeScript-specific rules for JS files |
63 | | - ...tseslint.configs.disableTypeChecked.rules, |
64 | | - }, |
65 | | - }, |
| 6 | + { |
| 7 | + // config with just ignores is separate object |
| 8 | + ignores: [ |
| 9 | + "node_modules/**", |
| 10 | + "dist/**", |
| 11 | + "build/**", |
| 12 | + ".firebase/**", |
| 13 | + "firebase-debug.log", |
| 14 | + "firestore-debug.log", |
| 15 | + "functions/lib/**", |
| 16 | + ], |
| 17 | + }, |
| 18 | + eslint.configs.recommended, |
| 19 | + ...tseslint.configs.strictTypeChecked, |
| 20 | + ...tseslint.configs.stylisticTypeChecked, |
| 21 | + { |
| 22 | + plugins: { |
| 23 | + unicorn, |
| 24 | + }, |
| 25 | + ...unicorn.configs.recommended, |
| 26 | + }, |
| 27 | + { |
| 28 | + files: ["**/*.{js,jsx,ts,tsx}"], |
| 29 | + languageOptions: { |
| 30 | + parserOptions: { |
| 31 | + project: true, |
| 32 | + tsconfigRootDir: import.meta.dirname, |
| 33 | + }, |
| 34 | + }, |
| 35 | + }, |
| 36 | + // { |
| 37 | + // files: ["eslint.config.js"], |
| 38 | + // rules: { |
| 39 | + // "unicorn/filename-case": ["error", { case: "kebabCase" }], |
| 40 | + // }, |
| 41 | + // }, |
| 42 | + { |
| 43 | + files: ["functions/**/*.{js,jsx,ts,tsx}"], |
| 44 | + languageOptions: { |
| 45 | + globals: { |
| 46 | + // Node.js globals for Firebase Functions |
| 47 | + console: "readonly", |
| 48 | + process: "readonly", |
| 49 | + Buffer: "readonly", |
| 50 | + __dirname: "readonly", |
| 51 | + __filename: "readonly", |
| 52 | + global: "readonly", |
| 53 | + module: "readonly", |
| 54 | + require: "readonly", |
| 55 | + exports: "readonly", |
| 56 | + }, |
| 57 | + }, |
| 58 | + }, |
| 59 | + { |
| 60 | + files: ["**/*.{js,jsx}"], |
| 61 | + rules: { |
| 62 | + // Disable TypeScript-specific rules for JS files |
| 63 | + ...tseslint.configs.disableTypeChecked.rules, |
| 64 | + }, |
| 65 | + }, |
66 | 66 | ); |
0 commit comments