-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrstack.config.ts
More file actions
90 lines (87 loc) · 2.82 KB
/
Copy pathrstack.config.ts
File metadata and controls
90 lines (87 loc) · 2.82 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
// Rstack configuration guide: https://rstack.rs/config
import { define } from 'rstack';
define.lint(async () => {
const { ts } = await import('rstack/lint');
return [
{
ignores: [
'**/dist/**',
'**/tests-dist/**',
'**/.vscode-test/**',
// Fixture projects are user-land sample code, not extension source.
'packages/vscode/e2e/fixtures/**',
'packages/vscode/e2e/rstest/fixtures/**',
'packages/vscode/e2e/lint/fixtures/**',
],
},
ts.configs.recommended,
{
rules: {
// The copied upstream extension code relies on these patterns
// (`nodeRequire`, ambient anys around the VS Code test APIs).
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-require-imports': 'off',
},
},
{
// Resolve-from-project (packages/vscode/AGENTS.md, adaptation #3): the
// extension ships no tool packages, so extension source may only take
// *types* from them at compile time. Runtime modules come from the
// user's project through explicit paths — a static value import would
// bundle or `require()` the wrong copy.
files: ['packages/vscode/src/**/*.ts'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: [
{
group: [
'@rslint/core',
'@rslint/core/*',
'@rstest/core',
'@rstest/core/*',
'rstack',
'rstack/*',
'jiti',
'jiti/*',
],
allowTypeImports: true,
message:
'Extension source may only import types from tool packages; load the runtime module from the project (see AGENTS.md, resolve-from-project).',
},
],
},
],
},
},
{
languageOptions: {
parserOptions: {
project: ['./packages/vscode/tsconfig.json'],
},
},
},
];
});
define.fmt({
singleQuote: true,
sortPackageJson: true,
proseWrap: 'never',
ignorePatterns: [
// E2E fixture sources are asserted on byte-for-byte (diagnostic ranges,
// autofix results, AST-collected line numbers) — formatting breaks them.
'packages/vscode/e2e/fixtures/**',
'packages/vscode/e2e/rstest/fixtures/**',
'packages/vscode/e2e/lint/fixtures/**',
// Vendored agent skills mirror mattpocock/skills byte-for-byte;
// skills-lock.json hashes them, so formatting causes update churn.
'.agents/**',
'.claude/skills/**',
],
});
define.staged({
'*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}': ['rs lint --fix', 'rs fmt'],
'*.{json,jsonc,md,mdx,css,html,yml,yaml}': 'rs fmt',
});