Skip to content

Commit 3df948d

Browse files
polish oxlint follow-up tooling
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
1 parent f3804f5 commit 3df948d

4 files changed

Lines changed: 71 additions & 8 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
body:
2+
- type: markdown
3+
attributes:
4+
value: |-
5+
Thank you for helping to improve `@epic-web/config`!
6+
7+
Please fill out the details below.
8+
9+
Keep in mind you can always extend the built-in configuration with your own config.
10+
- type: textarea
11+
attributes:
12+
label: Search Terms Used
13+
description: >-
14+
Please list the search terms you used to search the discussions, issues,
15+
and PRs before submitting this issue.
16+
validations:
17+
required: true
18+
- type: input
19+
attributes:
20+
label: Rule or Config Docs
21+
description: >-
22+
Link to the Oxlint rule or configuration docs you're suggesting
23+
changing
24+
placeholder: https://oxc.rs/docs/guide/usage/linter/rules/
25+
validations:
26+
required: true
27+
- type: textarea
28+
attributes:
29+
label: Suggested Change
30+
description: >-
31+
Write out the suggested change in configuration. If the rule or config is
32+
already present, explain why it should be removed or changed. If it's not
33+
present, explain why it should be added. And provide the final
34+
configuration for the option.
35+
validations:
36+
required: true
37+
- type: textarea
38+
attributes:
39+
label: Issues without the change
40+
description: >-
41+
Convince me why life is better with this change.
42+
validations:
43+
required: true
44+
- type: textarea
45+
attributes:
46+
label: Severity of inaction
47+
description: Convince me why not doing anything is bad.
48+
validations:
49+
required: true
50+
- type: textarea
51+
attributes:
52+
label: Additional Context
53+
description: Any other context that could be helpful.
54+
validations:
55+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ contact_links:
55
about:
66
If you can't get something to work the way you expect, open a question in
77
the discussions.
8+
- name: 🐂 Oxlint Rule Suggestion
9+
url: https://github.com/epicweb-dev/config/discussions/new?category=oxlint-suggestion
10+
about:
11+
We appreciate you taking the time to improve `@epic-web/config` with your
12+
ideas, but we use Discussions for config suggestions instead of the issues
13+
tab.
814
- name: 💬 Epic Web Discord Server
915
url: https://kcd.im/discord
1016
about: Interact with other Epic Web developers

lint-rules/oxlint-test-utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export async function writeOxlintFixture({
5858
directory,
5959
filePath,
6060
typeAware,
61-
async cleanup() {
62-
await cleanupTemporaryDirectory(directory)
61+
[Symbol.asyncDispose]() {
62+
return cleanupTemporaryDirectory(directory)
6363
},
6464
}
6565
}

lint-rules/prefer-dispose-in-tests.test.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import {
55
writeOxlintFixture,
66
} from './oxlint-test-utils.js'
77

8+
async function cleanupFixture(fixture) {
9+
// oxlint-disable-next-line epic-web/no-manual-dispose
10+
await fixture[Symbol.asyncDispose]()
11+
}
12+
813
describe('epic-web/prefer-dispose-in-tests', () => {
914
it('reports lifecycle hooks that can move into a test body', async () => {
1015
const fixture = await writeOxlintFixture({
@@ -24,7 +29,6 @@ describe('epic-web/prefer-dispose-in-tests', () => {
2429
'epic-web/prefer-dispose-in-tests': 'warn',
2530
},
2631
})
27-
2832
try {
2933
const result = await runOxlint(fixture)
3034
expect(result.diagnostics).toHaveLength(1)
@@ -34,7 +38,7 @@ describe('epic-web/prefer-dispose-in-tests', () => {
3438
})
3539
expect(result.diagnostics[0].message).toContain('instead of beforeEach')
3640
} finally {
37-
await fixture.cleanup()
41+
await cleanupFixture(fixture)
3842
}
3943
})
4044

@@ -68,12 +72,11 @@ describe('epic-web/prefer-dispose-in-tests', () => {
6872
'epic-web/prefer-dispose-in-tests': 'warn',
6973
},
7074
})
71-
7275
try {
7376
const result = await runOxlint(fixture)
7477
expect(result.diagnostics).toHaveLength(0)
7578
} finally {
76-
await fixture.cleanup()
79+
await cleanupFixture(fixture)
7780
}
7881
})
7982

@@ -98,13 +101,12 @@ describe('epic-web/prefer-dispose-in-tests', () => {
98101
],
99102
},
100103
})
101-
102104
try {
103105
const result = await runOxlint(fixture)
104106
expect(result.diagnostics).toHaveLength(1)
105107
expect(result.diagnostics[0].message).toContain('instead of beforeEach')
106108
} finally {
107-
await fixture.cleanup()
109+
await cleanupFixture(fixture)
108110
}
109111
})
110112
})

0 commit comments

Comments
 (0)