Skip to content

Commit de64188

Browse files
committed
feat: implement Rslint CLI command
1 parent 9e5f34c commit de64188

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎packages/rstack/src/cli/commands.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,15 @@ async function runRslibCLI(args: string[]): Promise<void> {
129129
runCLI({ argv });
130130
}
131131

132-
async function runRslintCLI(): Promise<void> {
133-
// TODO
132+
async function runRslintCLI(args: string[]): Promise<void> {
133+
const argv = [
134+
process.execPath,
135+
'rslint',
136+
...insertConfigArg(args, '--config', join(import.meta.dirname, 'rslintConfig.js')),
137+
];
138+
139+
const { runCLI } = await import('@rslint/core');
140+
await runCLI({ argv });
134141
}
135142

136143
export async function setupCommands(): Promise<void> {
@@ -159,7 +166,7 @@ export async function setupCommands(): Promise<void> {
159166
}
160167

161168
if (command === 'lint') {
162-
await runRslintCLI();
169+
await runRslintCLI(args.slice(1));
163170
return;
164171
}
165172

0 commit comments

Comments
 (0)