cleaner: add a rule against the void operator
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- developer-experience
Research direction
Start in scripts/cleaner.mjs at the RULES array and copy the shape of the no-types-in-components entry (id, description, fix, appliesTo, check). In check, use ts.isVoidExpression(node) to find the void operator, and restrict appliesTo to .ts and .tsx files under src/renderer/src. Add a describe block in tests/cleaner.test.ts covering a flagged void load() and an unflagged (): void return type. Done when pnpm test passes, pnpm cleaner still reports nothing on the current code, and the CONTRIBUTING.md list of checks names the new rule.
Written by the indexing model from the issue text.
Description
pnpm cleaner checks the conventions in CONTRIBUTING.md that Prettier and TypeScript don't. It has one rule so far, and new ones get added one at a time. This issue adds the next: don't use the void operator (from the Code style section).
void load() // ✖ flagged
load() // ✔
const f = (): void => {} // ✔ the void *type* is fine
The renderer already follows this, so the new rule should pass on the current code.
Where to look
scripts/cleaner.mjs:RULES. Copy the shape ofno-types-in-components: anid, a one-linedescription, afix,appliesToandcheckts.isVoidExpression(node)finds the operator. Thevoidtype is a different node, so it won't be flaggedappliesTogets every file undersrc/renderer/src, including.cssand.html, so limit it to.tsand.tsxtests/cleaner.test.ts: add adescribefor the rule next to the existing one
Done when
void something()anywhere in a renderer.ts/.tsxfile is reported with its line and column- The
voidtype in annotations isn't pnpm cleanerstill reports no problems on the current code, andpnpm testpasses- The line in CONTRIBUTING.md that lists what
pnpm cleanerchecks mentions the new rule
Suggested pull request title: chore(cleaner): flag the void operator
New to OpenPaste? CONTRIBUTING.md covers setup, the code conventions and the checks to run before a pull request (pnpm typecheck, pnpm test, pnpm format, pnpm cleaner). Leave a comment if you're picking this up so nobody doubles up.
Generated by Claude Code
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from alexsilver8/openpaste
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
alexsilver8/openpaste#31 ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
alexsilver8/openpaste#32 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
alexsilver8/openpaste#30 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
alexsilver8/openpaste#29 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
alexsilver8/openpaste#27 ·
All issues in alexsilver8/openpaste
Similar issues
-
documentation good first issue
Difficulty 2/5 Half a day Newbie friendliness 72/100
sujithputta02/Esapay#13 ·
-
Share dialog: the address book's contact count reads "1 contacts" (no singular form in any language)Possibly taken @chibenwa claimed this today. Openai-driven-qa bug claude Cosmetic
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
linagora/twake-contacts-frontend#271 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Koenkk/zigbee2mqtt#33402 ·
Maintainers usually reply within 1 day
-
dx P2 platform Stellar Wave Wave 10
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
winsznx/routedock#579 · 1 comment ·
Maintainers usually reply within 1 day
-
area:ui effort:S enhancement priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day