Skip to content

Commit 9f2cf1c

Browse files
authored
chore(deps): upgrade Rslint to 0.9.1 (#459)
1 parent 5734073 commit 9f2cf1c

7 files changed

Lines changed: 65 additions & 71 deletions

File tree

packages/rstack/src/fmt/yukuPlugin.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -558,12 +558,7 @@ const parseJavaScript = (
558558
);
559559
const { program, comments } = tryCombinations(combinations);
560560

561-
return postprocess(
562-
program as unknown as AstNode,
563-
comments as PrettierComment[],
564-
text,
565-
'yuku-js',
566-
);
561+
return postprocess(program as unknown as AstNode, comments, text, 'yuku-js');
567562
};
568563

569564
const parseTypeScript = (
@@ -581,12 +576,7 @@ const parseTypeScript = (
581576
);
582577
const { program, comments } = tryCombinations(combinations);
583578

584-
return postprocess(
585-
program as unknown as AstNode,
586-
comments as PrettierComment[],
587-
text,
588-
'yuku-ts',
589-
);
579+
return postprocess(program as unknown as AstNode, comments, text, 'yuku-ts');
590580
};
591581

592582
const createParser = (

packages/rstack/tests/fmt/cacheIdentity.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import type { ResolvedFmtOptions } from '../../src/fmt/types.ts';
1515

1616
const rootPath = path.join(import.meta.dirname, 'project');
1717

18-
const asOptions = (value: Record<string, unknown>): ResolvedFmtOptions =>
19-
value as ResolvedFmtOptions;
18+
const asOptions = (value: Record<string, unknown>): ResolvedFmtOptions => value;
2019

2120
test('creates stable SHA-256-derived option hashes', () => {
2221
const hashOptions = createOptionsHasher();

packages/rstack/tests/fmt/yukuPlugin.test.ts

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -332,24 +332,20 @@ test('matches the official hashbang AST shape', async () => {
332332
});
333333

334334
test('reports Yuku diagnostics with Prettier locations', async () => {
335-
try {
336-
await formatWithYuku('\n\nconst = 1', { parser: 'yuku-ts' });
337-
throw new Error('Expected Yuku to report a syntax error.');
338-
} catch (error) {
339-
if (!(error instanceof SyntaxError)) {
340-
throw error;
341-
}
335+
const error = await formatWithYuku('\n\nconst = 1', {
336+
parser: 'yuku-ts',
337+
}).catch((error: unknown) => error);
338+
expect(error).toBeInstanceOf(SyntaxError);
342339

343-
const parseError = error as SyntaxError & {
344-
loc: {
345-
end: { column: number; line: number };
346-
start: { column: number; line: number };
347-
};
340+
const parseError = error as SyntaxError & {
341+
loc: {
342+
end: { column: number; line: number };
343+
start: { column: number; line: number };
348344
};
349-
expect(Object.keys(parseError.loc)).toEqual(['start', 'end']);
350-
expect(parseError.loc).toEqual({
351-
start: { column: 7, line: 3 },
352-
end: { column: 8, line: 3 },
353-
});
354-
}
345+
};
346+
expect(Object.keys(parseError.loc)).toEqual(['start', 'end']);
347+
expect(parseError.loc).toEqual({
348+
start: { column: 7, line: 3 },
349+
end: { column: 8, line: 3 },
350+
});
355351
});

packages/rstack/tests/setup/install.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ test('installs generated hooks and configures the repository', () => {
3838
const filePath = path.join(directory, name);
3939
expect(readFileSync(filePath, 'utf8')).toBe(content);
4040
if (process.platform !== 'win32') {
41+
// The platform guard intentionally skips POSIX permissions on Windows.
42+
// rslint-disable-next-line rstest/no-conditional-expect
4143
expect(statSync(filePath).mode & 0o777).toBe(0o755);
4244
}
4345
}

pnpm-lock.yaml

Lines changed: 38 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ catalog:
1717
'@rsbuild/plugin-react': '^2.1.0'
1818
'@rsbuild/plugin-sass': '^2.0.1'
1919
'@rslib/core': '~1.0.0'
20-
'@rslint/core': '0.9.0'
20+
'@rslint/core': '0.9.1'
2121
'@rspress/core': '^2.0.21'
2222
'@rspress/plugin-client-redirects': '^2.0.21'
2323
'@rspress/plugin-sitemap': '^2.0.21'

rstack.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ define.lint(({ globals, js, ts, rstestPlugin }) => {
2121
{
2222
files: ['**/*.test.{ts,tsx}'],
2323
...rstestPlugin.configs.recommended,
24+
rules: {
25+
'rstest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }],
26+
'rstest/no-standalone-expect': [
27+
'error',
28+
{ additionalTestBlockFunctions: ['test'] },
29+
],
30+
},
2431
},
2532
// Source imports use .ts for Node.js native TypeScript execution; builds rewrite them to .js.
2633
{

0 commit comments

Comments
 (0)