Skip to content

Commit f9b7ed8

Browse files
authored
chore: run prettier during lint (#128)
1 parent b0ab524 commit f9b7ed8

9 files changed

Lines changed: 71 additions & 59 deletions

File tree

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": ["github>rstackjs/renovate"]
44
}
5-

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
# Run `npm run bump` to bump the version and create a git tag.
66
push:
77
tags:
8-
- "v*"
8+
- 'v*'
99

1010
workflow_dispatch:
1111

@@ -47,4 +47,4 @@ jobs:
4747
- name: Create GitHub Release
4848
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1
4949
with:
50-
generateReleaseNotes: "true"
50+
generateReleaseNotes: 'true'

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
2828
with:
2929
node-version: 24.14.1
30-
cache: "pnpm"
30+
cache: 'pnpm'
3131

3232
- name: Install Dependencies
3333
run: pnpm install && npx playwright install

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
22
"search.useIgnoreFiles": true,
3-
"cSpell.words": [
4-
"rslint"
5-
],
3+
"cSpell.words": ["rslint"]
64
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"scripts": {
2727
"build": "rslib",
2828
"dev": "rslib --watch",
29-
"lint": "rslint",
29+
"lint": "rslint && prettier . --check",
30+
"lint:fix": "rslint --fix && prettier . --write",
3031
"prepare": "simple-git-hooks && rslib",
3132
"test": "rstest",
3233
"bump": "npx bumpp"

test/agents.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ test('should generate AGENTS.md with no tools selected', async () => {
4646
## Development
4747
4848
### Common Development
49+
4950
- Common development instructions
5051
- Available in all templates
5152
5253
## Tools
5354
5455
### Common Tools
56+
5557
- Tools that apply to all templates
5658
5759
### Rstest
@@ -100,12 +102,14 @@ test('should generate AGENTS.md with single tool selected', async () => {
100102
## Development
101103
102104
### Common Development
105+
103106
- Common development instructions
104107
- Available in all templates
105108
106109
## Tools
107110
108111
### Common Tools
112+
109113
- Tools that apply to all templates
110114
111115
### Rstest
@@ -163,12 +167,14 @@ test('should generate AGENTS.md with eslint tool and template mapping', async ()
163167
## Development
164168
165169
### Common Development
170+
166171
- Common development instructions
167172
- Available in all templates
168173
169174
## Tools
170175
171176
### Common Tools
177+
172178
- Tools that apply to all templates
173179
174180
### Rstest
@@ -212,12 +218,14 @@ test('should merge top-level sections from AGENTS.md files', async () => {
212218
## Development
213219
214220
### Common Development
221+
215222
- Common development instructions
216223
- Available in all templates
217224
218225
## Tools
219226
220227
### Common Tools
228+
221229
- Tools that apply to all templates
222230
223231
### Rstest

test/custom-tools.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ const mocks = rs.hoisted(() => {
2626
stderr: '',
2727
exitCode: 0,
2828
};
29+
// rslint-disable-next-line @typescript-eslint/no-explicit-any
2930
}) as any,
31+
// rslint-disable-next-line @typescript-eslint/no-explicit-any
3032
xSync: rs.fn(() => ({ stdout: '', stderr: '', exitCode: 0 })) as any,
3133
};
3234
});

test/fixtures/agents-md/template-common/AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ This section provides common guidance for all templates.
55
## Development
66

77
### Common Development
8+
89
- Common development instructions
910
- Available in all templates
1011

1112
## Tools
1213

1314
### Common Tools
15+
1416
- Tools that apply to all templates

test/skills.test.ts

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ const mocks = rs.hoisted(() => {
3434
xCalls: [] as ExecCall[],
3535
taskLogEvents: [] as TaskLogEvent[],
3636
commandLogs: [] as string[],
37-
promptOptions: [] as Array<{ value: string; label?: string; hint?: string }>,
37+
promptOptions: [] as Array<{
38+
value: string;
39+
label?: string;
40+
hint?: string;
41+
}>,
3842
};
3943

4044
function createExecStream(result: ExecResult, lines: string[] = []) {
@@ -60,6 +64,7 @@ const mocks = rs.hoisted(() => {
6064
stderr: '',
6165
exitCode: 0,
6266
});
67+
// rslint-disable-next-line @typescript-eslint/no-explicit-any
6368
}) as any;
6469

6570
const xSync = rs.fn((command: string, args: string[], options: unknown) => {
@@ -68,6 +73,7 @@ const mocks = rs.hoisted(() => {
6873
stderr: '',
6974
exitCode: 0,
7075
};
76+
// rslint-disable-next-line @typescript-eslint/no-explicit-any
7177
}) as any;
7278

7379
const spinner = (() => ({
@@ -98,19 +104,21 @@ const mocks = rs.hoisted(() => {
98104
return taskLog({ title });
99105
};
100106

101-
const multiselect = rs.fn(async (options: {
102-
message?: string;
103-
options?: Array<{ value: unknown; label?: string; hint?: string }>;
104-
}) => {
105-
if (options.message?.includes('Select optional skills')) {
106-
state.promptOptions = (options.options ?? []) as Array<{
107-
value: string;
108-
label?: string;
109-
hint?: string;
110-
}>;
111-
}
112-
return [];
113-
}) as typeof promptsActual.multiselect;
107+
const multiselect = rs.fn(
108+
async (options: {
109+
message?: string;
110+
options?: Array<{ value: unknown; label?: string; hint?: string }>;
111+
}) => {
112+
if (options.message?.includes('Select optional skills')) {
113+
state.promptOptions = (options.options ?? []) as Array<{
114+
value: string;
115+
label?: string;
116+
hint?: string;
117+
}>;
118+
}
119+
return [];
120+
},
121+
) as typeof promptsActual.multiselect;
114122

115123
return {
116124
state,
@@ -199,7 +207,10 @@ function createExecCommand(
199207
if ('then' in Object(output)) {
200208
const promise = Promise.resolve(output).then((resolvedOutput) =>
201209
'result' in resolvedOutput
202-
? mocks.createExecStream(resolvedOutput.result, resolvedOutput.lines)
210+
? mocks.createExecStream(
211+
resolvedOutput.result,
212+
resolvedOutput.lines,
213+
)
203214
: mocks.createExecStream(resolvedOutput),
204215
);
205216

@@ -209,9 +220,13 @@ function createExecCommand(
209220
finally: promise.finally.bind(promise),
210221
async *[Symbol.asyncIterator]() {
211222
const resolvedOutput = await output;
212-
const stream = 'result' in resolvedOutput
213-
? mocks.createExecStream(resolvedOutput.result, resolvedOutput.lines)
214-
: mocks.createExecStream(resolvedOutput);
223+
const stream =
224+
'result' in resolvedOutput
225+
? mocks.createExecStream(
226+
resolvedOutput.result,
227+
resolvedOutput.lines,
228+
)
229+
: mocks.createExecStream(resolvedOutput);
215230
for await (const line of stream) {
216231
yield line;
217232
}
@@ -655,14 +670,7 @@ test('should skip skill installation when --dir and --template are used without
655670
source: 'vercel-labs/agent-skills',
656671
},
657672
],
658-
argv: [
659-
'node',
660-
'test',
661-
'--dir',
662-
projectDir,
663-
'--template',
664-
'vanilla',
665-
],
673+
argv: ['node', 'test', '--dir', projectDir, '--template', 'vanilla'],
666674
});
667675

668676
expect(calls).toHaveLength(0);
@@ -695,15 +703,7 @@ test('should prove --skill skips the skills prompt even without --dir and --temp
695703
source: 'vercel-labs/agent-skills',
696704
},
697705
],
698-
argv: [
699-
'node',
700-
'test',
701-
projectDir,
702-
'--tools',
703-
'',
704-
'--skill',
705-
'git-url',
706-
],
706+
argv: ['node', 'test', projectDir, '--tools', '', '--skill', 'git-url'],
707707
});
708708

709709
expect(skillsPromptReached).toBe(false);
@@ -1297,23 +1297,25 @@ test('should stream install output and show the command error in the task log wh
12971297

12981298
test('should order skill prompt options using pre, default, and post order', async () => {
12991299
const projectDir = path.join(testDir, 'skills-ordering-proof');
1300-
rs.mocked(mocks.multiselect).mockImplementation(async <Value,>({
1301-
message,
1302-
options,
1303-
}: {
1304-
message?: string;
1305-
options?: Array<{ value: Value; label?: string; hint?: string }>;
1306-
}) => {
1307-
if (message?.includes('Select optional skills')) {
1308-
mocks.state.promptOptions = (options ?? []) as Array<{
1309-
value: string;
1310-
label?: string;
1311-
hint?: string;
1312-
}>;
1300+
rs.mocked(mocks.multiselect).mockImplementation(
1301+
async <Value>({
1302+
message,
1303+
options,
1304+
}: {
1305+
message?: string;
1306+
options?: Array<{ value: Value; label?: string; hint?: string }>;
1307+
}) => {
1308+
if (message?.includes('Select optional skills')) {
1309+
mocks.state.promptOptions = (options ?? []) as Array<{
1310+
value: string;
1311+
label?: string;
1312+
hint?: string;
1313+
}>;
1314+
return [];
1315+
}
13131316
return [];
1314-
}
1315-
return [];
1316-
});
1317+
},
1318+
);
13171319

13181320
await create({
13191321
name: 'test',

0 commit comments

Comments
 (0)