Skip to content

Commit 1da93e9

Browse files
authored
chore(lint): enable Rstest rules (#371)
1 parent 0b77744 commit 1da93e9

5 files changed

Lines changed: 8 additions & 5 deletions

File tree

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"mdx.validate.validateFileLinks": "ignore",
1616
"editor.defaultFormatter": "esbenp.prettier-vscode",
1717
// Temporary workaround until we switch to the Rstack VS Code extension.
18-
"prettier.printWidth": 100,
1918
"prettier.singleQuote": true,
2019
"js/ts.tsdk.path": "node_modules/typescript/lib",
2120
"[typescript]": {

examples/app-vanilla/tests/dom.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect, test } from 'rstack/test';
22
import { screen } from '@testing-library/dom';
33

4-
test('test dom', () => {
4+
test('renders content', () => {
55
document.body.innerHTML = `
66
<span data-testid="not-empty"><span data-testid="empty"></span></span>
77
<div data-testid="visible">Visible Example</div>

packages/create-rstack/template-app-vanilla-ts/tests/dom.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect, test } from 'rstack/test';
22
import { screen } from '@testing-library/dom';
33

4-
test('test dom', () => {
4+
test('renders content', () => {
55
document.body.innerHTML = `
66
<span data-testid="not-empty"><span data-testid="empty"></span></span>
77
<div data-testid="visible">Visible Example</div>

packages/create-rstack/template-app-vanilla/tests/dom.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect, test } from 'rstack/test';
22
import { screen } from '@testing-library/dom';
33

4-
test('test dom', () => {
4+
test('renders content', () => {
55
document.body.innerHTML = `
66
<span data-testid="not-empty"><span data-testid="empty"></span></span>
77
<div data-testid="visible">Visible Example</div>

rstack.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Configuration guide: https://rstack.rs/config
22
import { define } from 'rstack';
33

4-
define.lint(async ({ js, ts }) => {
4+
define.lint(async ({ js, ts, rstestPlugin }) => {
55
const { default: globals } = await import('globals');
66
return [
77
js.configs.recommended,
@@ -18,6 +18,10 @@ define.lint(async ({ js, ts }) => {
1818
},
1919
},
2020
},
21+
{
22+
files: ['**/*.test.{ts,tsx}'],
23+
...rstestPlugin.configs.recommended,
24+
},
2125
// Source imports use .ts for Node.js native TypeScript execution; builds rewrite them to .js.
2226
{
2327
files: ['packages/rstack/src/**/*.ts'],

0 commit comments

Comments
 (0)