-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
84 lines (83 loc) · 2.14 KB
/
eslint.config.js
File metadata and controls
84 lines (83 loc) · 2.14 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
export default [
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/build/**',
'**/.next/**',
'**/.vite/**',
'**/coverage/**',
'client/public/**',
'prisma/migrations/**',
'scripts/**',
'client/scripts/**',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
],
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/consistent-type-imports': 'warn',
'no-console': 'off',
eqeqeq: ['error', 'always', { null: 'ignore' }],
},
},
{
files: ['client/src/**/*.{ts,tsx}'],
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': 'warn',
},
},
{
files: ['server/src/**/*.ts'],
ignores: ['server/src/services/ai/**'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@anthropic-ai/sdk',
message:
'Import the AI SDK only via server/src/services/ai/ai-client. Direct imports are forbidden outside services/ai/.',
},
],
},
],
},
},
{
files: ['**/*.test.ts', '**/*.test.tsx', '**/__tests__/**/*.ts', '**/__tests__/**/*.tsx'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
{
files: ['*.config.{js,ts}', '*.config.*.{js,ts}', 'eslint.config.js'],
rules: {
'no-console': 'off',
},
},
];