convez.ai
SkillProdutividadeIntermediário
sethlivingston

The TypeScript Narrows

sethlivingston/the-typescript-narrows

Elimina ambiguidade do TypeScript com opiniões unificadas para IA e linters

Ver no GitHub
InicialPluginScore · de 0 a 100

Skill para Claude e plugin ESLint que elimina armadilhas do TypeScript ao impor um conjunto coeso de boas práticas. Combina análise de IA com linting automático para padronizar type safety, tratamento de erros e padrões assíncronos, reduzindo ambiguidade e inconsistência na escrita de código TypeScript.

Instalação

$npx convez-ai sethlivingston/the-typescript-narrows

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
57%
Último commit
há 2 meses
Versão
eslint-plugin/v1.3.3
Issues abertas
7
Contribuidores
3

Casos de uso

  • Garantir type safety rigoroso em bases de código TypeScript
  • Padronizar padrões de tratamento de erros e promises
  • Automatizar revisões de código contra boas práticas TypeScript
  • Complementar desenvolvimento assistido por IA com regras de lint consistentes

Veredito

Ferramenta bem estruturada que une dois mundos: assistência de IA via skill e automação via ESLint. Excelente para times que querem opinião consistente sobre TypeScript, eliminando o 'qual é a melhor forma?' do dia a dia. Requer adoção de suas preferências, o que é proposital.

README

A tradução para o português deste README ainda está na fila.

The TypeScript Narrows

The TypeScript Narrows is a Claude Skill and an ESLint plugin that complement each other. Together they help AI agents narrow the "five different ways to do X" to a single, opinionated, best-practice way to do X. Some examples:

  • No any, no !, no type assertions — narrow instead
  • No enum — use as const objects with discriminated unions
  • No default exports, no barrel files
  • No .forEach(), no .reduce() — use for...of
  • No floating promises, no misused promises
  • return await inside try/catch (always)
  • ?? over ||, ?. over manual null checks
  • Exhaustive switch — every union variant handled
  • Result types for expected failures, throw only for bugs
  • Readonly<T> params, readonly properties, no mutable exports
  • Branded types for domain IDs and value objects
  • Early returns to fail fast and avoid deep nesting
  • strict: true plus noUncheckedIndexedAccess
  • ...and many more

The Claude skill and the ESLint plugin extend @typescript-eslint and cover over 50 opinions on type safety, error handling, async patters, naming conventions, and more.

"The TypeScript Narrows" is a play on "The Deathly Hallows".

Repo Structure

Getting Started

For AI-assisted development: Install the Claude plugin from the marketplace:

claude plugin add-marketplace github:sethlivingston/claude-marketplace
claude plugin install the-typescript-narrows

The skill triggers automatically when writing or reviewing TypeScript. See the plugin README for details.

For automated enforcement: Install @sethlivingston/eslint-plugin-typescript-narrows to lint against these opinions in CI and your editor:

npm install --save-dev @sethlivingston/eslint-plugin-typescript-narrows

See eslint-plugin README for setup instructions.

Both artifacts work independently, but they're designed to complement each other -- the skill covers opinions that can't be expressed as lint rules.

Coverage

See docs/TRACEABILITY.md for the full traceability matrix mapping all opinions to their enforcement mechanisms.

License

MIT

Ver o original no GitHub

Bom para

Relacionados