lintcn

Write and test type-aware TypeScript lint rules as Go files using the tsgolint API.

101|2|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/remorses/lintcn --skill lintcn-remorses
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lintcn
Source: https://github.com/remorses/lintcn/tree/main/skills/lintcn
Command: npx skills add https://github.com/remorses/lintcn --skill lintcn-remorses

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing custom type-aware TypeScript lint rules requires deep knowledge of the tsgolint Go API, AST listeners, and the TypeScript type checker, which is poorly documented and error-prone to learn from scratch. ## Core Features & Use Cases - Rule Authoring Reference: Provides the full tsgolint rule API including RuleContext, AST node listeners, type checker utilities, and reporting with fixes and suggestions. - Testing Patterns: Documents rule_tester usage with valid/invalid test cases, snapshot generation, and go test workflows inside .lintcn/. - Use Case: Ask your AI agent to create a rule that flags discarded Error-typed return values; it writes the Go rule file, adds tests, and validates with go build and go test. ## Quick Start Ask the agent to create a new lintcn rule in .lintcn/ that reports unhandled Error return values, then run go build and go test to verify it.

Frequently Asked Questions about lintcn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a custom type-aware TypeScript lint rule?

Create a subfolder under .lintcn/ with a Go file defining a rule.Rule struct containing a Name and Run function. The Run function returns listeners keyed by ast.Kind that use ctx.TypeChecker for type analysis and ctx.ReportNode to flag violations.

How do I test tsgolint lint rules in Go?

Use rule_tester.RunRuleTester with valid and invalid test cases containing inline TypeScript code and expected MessageIds. Run tests with go test -v ./... from inside .lintcn/, and generate snapshots with UPDATE_SNAPS=true.

Can lint rules provide auto-fixes and suggestions?

Yes, use ctx.ReportNodeWithFixes for automatic fixes applied by the linter, or ctx.ReportNodeWithSuggestions for user-confirmed changes. Fix helpers include RuleFixInsertBefore, RuleFixReplace, and RuleFixRemove.

Why does my lintcn rule fail to compile?

Common causes are a Go package name not matching the subfolder name, flat .go files placed directly in .lintcn/ root, or missing go.mod and go.work files. Run go build ./... inside .lintcn/ to see the exact error.

When should I use warning severity for lint rules?

Use // lintcn:severity warn for guidance rules that should not fail CI, such as suggestions to remove unnecessary type assertions. Warnings only appear for git-changed files by default; use --all-warnings to see them everywhere.