fix(ci): downgrade eslint para v9 até eslint-plugin-react suportar v10#2
Merged
Merged
Conversation
O ESLint v10.3.0 removeu APIs do RuleContext que o eslint-plugin-react@7.37.5 ainda usa. Sem versao estavel do plugin compativel com v10 ate upstream shipar fixes (PRs #3979 e #4006 abertos). Solucao: fixar eslint em ^9.39.4 (mesma linha que eslint-config-next usa como peer). Quando eslint-plugin-react@8 sair com suporte a v10, podemos voltar. Tambem adiciona .agents/** e .kiro/skills/** aos ignores do lint (sao diretorios de skills externos, nao codigo do projeto). Validacao: - bunx eslint .: 0 errors 0 warnings - bunx tsc --noEmit: ok - bun run build: ok (6 rotas geradas) Refs: jsx-eslint/eslint-plugin-react#3977
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problema
ESLint v10 (disponível no projeto como
10.3.0) removeu APIs doRuleContext(getFilename,getScope,getSourceCode) que oeslint-plugin-react@7.37.5(peer dependency deeslint-config-next) ainda usa internamente. Resultado:Por que não dá para pinar o plugin
Nenhuma release estável do
eslint-plugin-reacté compatível com ESLint 10. PRs de correção upstream abertos mas ainda não mergeados:Issue de referência: jsx-eslint/eslint-plugin-react#3977
Solução
Fix cirúrgico em 3 arquivos:
package.json9.39.4é o par estável queeslint-config-nextsuporta (mesma linha que o ecosystem — remeda, DIM, Trezor Suite — está usando enquanto aguarda upstream).eslint.config.mjsAdiciona ignores para diretórios de skills de terceiros:
globalIgnores([ ".next/**", "out/**", "build/**", "next-env.d.ts", + ".agents/**", + ".kiro/skills/**", ])Esses diretórios contêm templates de skills externas, não código do projeto.
bun.lockRegenerado pelo
bun add -d eslint@^9.39.4.Validação
bunx eslint .→ 0 errors, 0 warningsbunx tsc --noEmit→ 0 errorsbun run build→ 6 rotas geradas (/,/_not-found, 2×/api/draft-mode/*,/studio/[[...tool]])Quando reverter
Monitorar a issue #3977. Quando
eslint-plugin-reactv8 (ou v7 com fix retroativo) shipar compat com ESLint 10, atualizar o pacote e subireslintde volta para^10.