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

ESLint 9 Migration

Aperta
#3,863 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
eslint, nodejs, typescript
Ambito
ci-cd, tooling

Direzione di ricerca

Leggi la guida alla migrazione di ESLint, quindi confronta .eslintrc.json e .eslintignore con i file richiesti eslint.config.js e eslint.ignores.js. Esegui i controlli di linting e i test dopo la migrazione, quindi risolvi o configura intenzionalmente i problemi elencati per sbloccare l’aggiornamento a gts v7 e fare in modo che CI passi.

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

Descrizione

size: m type: process

The Pull Request chore(deps): update dependency gts to v7 #3856 is currently blocked due to CI failures.

The core of the issue is that gts v7 upgrades the linter to ESLint v9, which introduces a breaking change by switching to a new "Flat Config" system. The existing configuration infrastructure is incompatible with this new version.

Resolving this requires a two-step approach.


Step 1: Infrastructure Migration (ESLint 9 Flat Config)

ESLint 9 drops support for .eslintrc.json and .eslintignore. The project must migrate to eslint.config.js and eslint.ignores.js.

Findings & Reference

In Flat Config, ignore patterns are strictly relative to the configuration file, and global variables (like process or module in Node.js) must be explicitly declared in the config for JavaScript files.

Required Technical Changes
  1. Create eslint.ignores.js: Export the array of ignore patterns (migrated from .eslintignore).
  2. Create eslint.config.js:
    • Extend gts.
    • Import ignore patterns.
    • Declare globals.node for **/*.js files to prevent no-undef errors.
  3. Clean up: Delete .eslintrc.json and .eslintignore.

Step 2: Code Compliance (New Linting Findings)

After migrating to ESLint v9, the new linter identifies several violations in the existing codebase that were previously ignored or not checked with the same intensity. We need to determine the best path forward for these findings, whether is to mute the findings, fix the findings, or come up with a hybrid approach.

Findings

The following rules are failing across multiple files (many of which are autogenerated):

  • @typescript-eslint/no-unused-vars
  • @typescript-eslint/no-explicit-any
  • @typescript-eslint/no-unused-expressions
Open Questions:
  1. Mute the findings (Short-term): Should we disable these rules in eslint.config.js to unblock the gts v7 upgrade? This would maintain the current state of the codebase while adopting the new tooling.
  2. Fix the findings (Long-term): Since many of these files are autogenerated, should we block the upgrade until the generator logic is updated to produce compliant code?
  3. Hybrid Approach: Mute them now but create a follow-up task to address the generator's output?

NOTE: muting these rules in the new eslint.config.js allowed all linting checks and tests to pass successfully when testing this changes locally.

Lingua principale
TypeScript
Stelle
12.3k
Fork
2k
Merge medio
23h 24m
PR unite (30g)
16

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 googleapis/google-api-nodejs-client

Tutte le issue di googleapis/google-api-nodejs-client

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.