Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

cleaner: add a rule against the void operator

Aperta Adatta ai principianti
#16 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@AnushreeKasturi ci sta già lavorando.

Dal 11/10/2026.

  • #38 di @AnushreeKasturi — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Inizia in scripts/cleaner.mjs all'array RULES e copia la struttura della voce no-types-in-components (id, description, fix, appliesTo, check). In check, usa ts.isVoidExpression(node) per trovare l'operatore void, e limita appliesTo ai file .ts e .tsx sotto src/renderer/src. Aggiungi un blocco describe in tests/cleaner.test.ts che copra un void load() segnalato e un tipo di ritorno (): void non segnalato. Fatto quando pnpm test passa, pnpm cleaner non riporta ancora nulla sul codice corrente, e l'elenco dei controlli in CONTRIBUTING.md riporta la nuova regola.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

chore good first issue

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 of no-types-in-components: an id, a one-line description, a fix, appliesTo and check
  • ts.isVoidExpression(node) finds the operator. The void type is a different node, so it won't be flagged
  • appliesTo gets every file under src/renderer/src, including .css and .html, so limit it to .ts and .tsx
  • tests/cleaner.test.ts: add a describe for the rule next to the existing one
Done when
  • void something() anywhere in a renderer .ts/.tsx file is reported with its line and column
  • The void type in annotations isn't
  • pnpm cleaner still reports no problems on the current code, and pnpm test passes
  • The line in CONTRIBUTING.md that lists what pnpm cleaner checks 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

Lingua principale
TypeScript
Stelle
0
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di alexsilver8/openpaste

Tutte le issue di alexsilver8/openpaste

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.