-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
122 lines (121 loc) · 3.75 KB
/
Copy patheslint.config.js
File metadata and controls
122 lines (121 loc) · 3.75 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
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: [
'**/dist/**',
'**/node_modules/**',
'**/coverage/**',
'.claude/worktrees/**',
'examples/**',
'example-design/**',
'apps/server/scripts/**',
'apps/plugin/*',
'!apps/plugin/bin',
'apps/plugin/*/**',
'!apps/plugin/bin/**',
'!apps/plugin/mcp-bridge',
'!apps/plugin/mcp-bridge/**',
'!apps/plugin/.*-plugin',
'!apps/plugin/.*-plugin/*.ts',
// Client test files stay out, as apps/plugin/test/'s do: nothing there
// ships, and the projectService cannot resolve their vitest types.
'apps/plugin/.*-plugin/*.test.ts',
'apps/plugin/mcp-bridge/*.test.ts',
'plugin/**',
'openspec/**',
'apps/server/src/dashboard/public/**',
'apps/landing/public/**',
'**/*.d.ts',
'**/*.d.mts',
],
},
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: [
'eslint.config.js',
'commitlint.config.js',
'apps/server/drizzle.config.ts',
'apps/server/vitest.config.ts',
'install.test.ts',
'scripts/*.test.ts',
],
},
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
import: importPlugin,
},
rules: {
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'import/order': [
'error',
{
'newlines-between': 'always',
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
},
},
{
files: ['**/*.test.ts', '**/*.spec.ts', '**/__tests__/**'],
rules: {
'@typescript-eslint/no-floating-promises': 'off',
},
},
{
// Root-level config files use the projectService default project; the
// type-checked rule set doesn't have full type info for them after the
// monorepo restructure (tsconfig.json moved to apps/server/). Disable
// type-checked rules for these files.
files: ['eslint.config.js', 'commitlint.config.js', 'install.test.ts', 'scripts/*.test.ts'],
extends: [tseslint.configs.disableTypeChecked],
},
{
// Per-client plugin entrypoints, matched by shape so a new client is linted
// the day it lands. Shipped TS that lives outside the TS projectService, so
// the TS parser runs without type information.
files: ['apps/plugin/.*-plugin/*.ts'],
extends: [tseslint.configs.disableTypeChecked],
languageOptions: {
parserOptions: { projectService: false },
},
},
{
// Shipped runtime bridges. They live outside the TS projectService, so
// lint them with recommended (non-type-checked) rules only.
files: [
'apps/plugin/bin/**/*.mjs',
'apps/plugin/mcp-bridge/**/*.mjs',
'apps/landing/build.mjs',
'scripts/*.mjs',
],
extends: [js.configs.recommended, tseslint.configs.disableTypeChecked],
languageOptions: {
globals: {
process: 'readonly',
fetch: 'readonly',
AbortSignal: 'readonly',
TextDecoder: 'readonly',
console: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
},
parserOptions: { projectService: false },
},
},
prettier,
);