aprimoração de ia
This commit is contained in:
parent
1177e31e56
commit
4a9f5f70ff
109 changed files with 8835 additions and 55 deletions
65
global/rules/tsconfig-ignore-deprecations.md
Normal file
65
global/rules/tsconfig-ignore-deprecations.md
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
type: rule
|
||||
name: tsconfig-ignore-deprecations
|
||||
description: Workaround obrigatório para tsup v8.5.0 que injeta baseUrl depreciado no TS 6.0
|
||||
scope: global
|
||||
trigger: file_match
|
||||
globs:
|
||||
- "**/tsconfig.json"
|
||||
updatedAt: "2026-07-01"
|
||||
---
|
||||
|
||||
# Regra: ignoreDeprecations no tsconfig.json
|
||||
|
||||
## Contexto
|
||||
|
||||
O `tsup` v8.5.0 injeta internamente `baseUrl: "."` no `rollup-dts-plugin` durante a geração de arquivos `.d.ts` (DTS Build). O TypeScript 6.0 trata `baseUrl` como depreciado (erro TS5101), causando falha fatal no build DTS.
|
||||
|
||||
## Regra
|
||||
|
||||
Todo `tsconfig.json` de pacotes que usam `tsup` **DEVE** incluir:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"ignoreDeprecations": "6.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Isso silencia todas as deprecações da era 5.x/6.0 sem efeito colateral.
|
||||
|
||||
## Quando remover
|
||||
|
||||
Esta regra é um **workaround temporário**. Deve ser removida quando o `tsup` lançar uma versão que não injete `baseUrl` automaticamente. Monitorar releases do tsup para deprecar esta rule.
|
||||
|
||||
## Exemplos
|
||||
|
||||
```json
|
||||
// ✅ Correto — com workaround
|
||||
{
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "bundler",
|
||||
"module": "ESNext",
|
||||
"ignoreDeprecations": "6.0"
|
||||
}
|
||||
}
|
||||
|
||||
// ❌ Incorreto — build DTS falhará
|
||||
{
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "bundler",
|
||||
"module": "ESNext"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Impacto
|
||||
|
||||
Sem `ignoreDeprecations`, o comando `pnpm run build` falhará com erro TS5101 em qualquer pacote que gere arquivos `.d.ts` via tsup.
|
||||
|
||||
## Referências
|
||||
|
||||
- Memória Azteca: código 53
|
||||
- Rule: `global/rules/typescript-module-resolution`
|
||||
- Código responsável: `node_modules/tsup/dist/rollup.js`
|
||||
Loading…
Add table
Add a link
Reference in a new issue