-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
131 lines (121 loc) · 3.27 KB
/
eslint.config.js
File metadata and controls
131 lines (121 loc) · 3.27 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
125
126
127
128
129
130
131
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import solid from 'eslint-plugin-solid/configs/typescript';
import globals from 'globals';
export default tseslint.config(
// Global ignores
{
ignores: [
'dist/',
'apps/*/dist/',
'packages/*/dist/',
'crates/',
'.planning/',
'*.config.js',
'*.config.ts',
],
},
// Base JS recommended rules
js.configs.recommended,
// TypeScript recommended (non-type-checked for speed)
...tseslint.configs.recommended,
// SolidJS rules for app TS/TSX files and UI package
{
files: [
'apps/catune/src/**/*.{ts,tsx}',
'apps/carank/src/**/*.{ts,tsx}',
'packages/ui/src/**/*.{ts,tsx}',
],
...solid,
},
// Browser globals for app src/ and UI package
{
files: [
'apps/catune/src/**/*.{ts,tsx}',
'apps/carank/src/**/*.{ts,tsx}',
'packages/ui/src/**/*.{ts,tsx}',
],
languageOptions: {
globals: {
...globals.browser,
},
},
},
// Worker globals for app workers/
{
files: ['apps/catune/src/workers/**/*.ts'],
languageOptions: {
globals: {
...globals.worker,
},
},
},
// Node globals for build scripts
{
files: ['scripts/**/*.{js,mjs,cjs,ts}'],
languageOptions: {
globals: {
...globals.node,
},
},
},
// Import boundaries (merged into one block so flat-config doesn't silently override)
// (community-store uses type imports for User/Session — allowed since it's in the community boundary)
{
files: ['apps/**/*.{ts,tsx}', 'packages/**/*.ts'],
ignores: [
'packages/core/src/wasm-adapter.ts',
'packages/community/src/supabase.ts',
'packages/community/src/auth.ts',
'packages/community/src/submission-service.ts',
],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['**/crates/solver/pkg/*'],
message: 'Import from @calab/core instead of the WASM pkg directly.',
},
{
group: ['@supabase/supabase-js'],
message: 'Import from @calab/community instead of @supabase/supabase-js directly.',
},
{
group: ['@calab/*/src/*'],
message:
'Import from the package barrel (@calab/<pkg>) instead of reaching into src/.',
},
],
},
],
},
},
// Pragmatic rule overrides
{
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-explicit-any': 'error',
},
},
// SolidJS-specific rule overrides (scoped to files where solid plugin is loaded)
{
files: [
'apps/catune/src/**/*.{ts,tsx}',
'apps/carank/src/**/*.{ts,tsx}',
'packages/ui/src/**/*.{ts,tsx}',
],
rules: {
// .map() is fine for small static arrays; <For> migration is incremental
'solid/prefer-for': 'off',
// String style props work and are more concise for simple cases
'solid/style-prop': 'off',
// Early returns in components are sometimes intentional (loading guards)
'solid/components-return-once': 'warn',
},
},
);