-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
85 lines (84 loc) · 2.42 KB
/
eslint.config.js
File metadata and controls
85 lines (84 loc) · 2.42 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
import { defineESLintConfig } from '@ocavue/eslint-config'
export default defineESLintConfig(
{
react: true,
markdown: false,
},
{
ignores: [
'**/*.md',
'**/*.json',
'**/dist/**',
'**/node_modules/**',
'docs/**',
'packages/**/*.md',
// Additional ignores for memory optimization
'**/*.d.ts',
'**/*.min.js',
'**/coverage/**',
'**/.turbo/**',
'**/.trigger/**',
'**/.next/**',
'**/.astro/**',
'**/*.config.js',
'**/postcss.config.js',
'**/tailwind.config.js',
'**/next.config.js',
// Ignore bin directory files (executable scripts)
'**/bin/**',
],
},
{
rules: {
// Require curly braces for all control statements
curly: ['error', 'all'],
// Ignore import ordering
'import/order': 'off',
'sort-imports': 'off',
// Disable unicorn explicit length check rule
'unicorn/explicit-length-check': 'off',
// Disable TypeScript unsafe assignment and call rules
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
},
},
{
// Prevent importing server-side code in client-side code
files: [
'apps/web/components/**/*.{ts,tsx}',
'apps/web/hooks/**/*.{ts,tsx}',
'apps/web/lib/**/*.{ts,tsx}',
],
ignores: [
// These files legitimately need to import from @app/api
'apps/web/components/providers/trpc-provider.tsx',
'apps/web/client/trpc.ts',
// Server-side files that legitimately need to import from @app/api and @app/db
'apps/web/lib/trpc-server.ts',
'apps/web/lib/auth.ts',
'apps/web/app/api/**/*.ts',
'apps/web/middleware.ts',
],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['@app/api', '@app/api/*'],
message:
'Do not import from @app/api in client-side code. Use @app/utils for shared constants and types, or use TRPC hooks for data fetching.',
allowTypeImports: true, // Allow type-only imports
},
{
group: ['@app/db', '@app/db/*'],
message:
'Do not import from @app/db in client-side code. Use TRPC for database access.',
allowTypeImports: true, // Allow type-only imports
},
],
},
],
},
},
)