-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
124 lines (123 loc) · 3.08 KB
/
eslint.config.js
File metadata and controls
124 lines (123 loc) · 3.08 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import eslint from "@eslint/js";
import unicorn from "eslint-plugin-unicorn";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";
export default defineConfig([
{
// config with just ignores is separate object
ignores: [
"node_modules/**",
"dist/**",
"build/**",
".firebase/**",
".angular/**",
"members/**",
"firebase-debug.log",
"firestore-debug.log",
"functions/lib/**",
"hugo/public/**",
],
},
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
plugins: {
unicorn,
},
rules: {
...unicorn.configs.recommended.rules,
// Allow arrow functions in computed signals and similar reactive contexts
"unicorn/consistent-function-scoping": [
"error",
{
checkArrowFunctions: false,
},
],
"unicorn/no-useless-undefined": ["error", { checkArguments: false }],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowNumber: true,
allowBoolean: true,
},
],
},
},
{
files: ["**/*.{js,jsx,ts,tsx}"],
ignores: [".angular/**", "members/.angular/**", "eslint.config.js"],
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
// {
// files: ["eslint.config.js"],
// rules: {
// "unicorn/filename-case": ["error", { case: "kebabCase" }],
// },
// },
{
files: ["functions/**/*.{js,jsx,ts,tsx}"],
languageOptions: {
globals: {
// Node.js globals for Firebase Functions
console: "readonly",
process: "readonly",
Buffer: "readonly",
__dirname: "readonly",
__filename: "readonly",
global: "readonly",
module: "readonly",
require: "readonly",
exports: "readonly",
},
},
rules: {
// Allow bracket notation for index signature properties (e.g., process.env["KEY"])
"@typescript-eslint/dot-notation": [
"error",
{ allowIndexSignaturePropertyAccess: true },
],
},
},
{
files: ["functions/src/**/*.test.ts", "functions/src/test-utils/**/*.ts"],
languageOptions: {
parserOptions: {
project: "functions/tsconfig.test.json",
},
},
rules: {
// Allow null in test files for SIFERS pattern (explicit opt-out of defaults)
"unicorn/no-null": "off",
},
},
{
files: ["members/**/*.spec.ts", "members/**/*.integration.spec.ts"],
languageOptions: {
parserOptions: {
project: "members/tsconfig.spec.json",
},
},
},
{
files: ["members/e2e/**/*.ts"],
languageOptions: {
parserOptions: {
project: "members/tsconfig.e2e.json",
},
},
},
{
files: ["**/*.{js,jsx}"],
ignores: [".angular/**", "members/.angular/**", "**/.angular/**"],
rules: {
// Disable TypeScript-specific rules for JS files
...tseslint.configs.disableTypeChecked.rules,
},
},
]);