willyd61/nautobot-v2-custom-metrics-old/typescript-quality
Claude Code and agent skill by willyd61/nautobot-v2-custom-metrics-old
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
TypeScript/JavaScript code quality with ESLint, Biome, and strict TypeScript. Covers linting, formatting, type safety, and best practices. USE WHEN: user works with "TypeScript", "JavaScript", "ESLint", "Biome", asks about "TS strict mode", "type safety", "linting rules", "code formatting" DO NOT USE FOR: SonarQube - use `sonarqube` skill, testing - use Vitest/Jest skills, security - use security skills
Install
npx vskill@latest install willyd61/nautobot-v2-custom-metrics-old/typescript-qualitySemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
TypeScript Quality - Quick Reference
When NOT to Use This Skill
- SonarQube integration - Use
sonarqubeskill - Test configuration - Use
vitestskill - Security scanning - Use security skills
- React-specific patterns - Use
reactskill
Deep Knowledge: Usemcp__documentation__fetch_docswith technology:typescriptorbiomefor comprehensive documentation.
Tool Comparison
| Tool | Speed | Type-aware | Configuration | |
|---|---|---|---|---|
| Biome | Fastest | No | Minimal | |
| ESLint | Slower | Yes (with TS) | Extensive | |
| TypeScript | N/A | Yes | tsconfig.json |
Recommendation: Use Biome for formatting + basic linting, ESLint for type-aware rules.
Biome Setup (Recommended)
Installation
biome.json
Commands
ESLint Setup (Type-aware)
Installation
eslint.config.js (Flat Config - ESLint 9+)
Commands
TypeScript Strict Mode
tsconfig.json (Maximum Strictness)
Key Strict Flags Explained
| Flag | Effect | Example | |||
|---|---|---|---|---|---|
noUncheckedIndexedAccess | Array access returns `T \ | undefined` | arr[0] is `T \ | undefined` | |
exactOptionalPropertyTypes | { a?: string } means string or missing, not undefined | Can't assign undefined explicitly | |||
noPropertyAccessFromIndexSignature | Forces bracket notation for index signatures | obj['key'] not obj.key |
Common Code Smells & Fixes
1. Excessive any Usage
2. Type Assertions Overuse
3. Non-null Assertion
4. Complex Conditionals
5. Long Functions
Pre-commit Setup
package.json Scripts
Husky + lint-staged
VS Code Settings
Quality Metrics Targets
| Metric | Target | Tool | |
|---|---|---|---|
| Cyclomatic Complexity | < 10 | ESLint complexity rule | |
| Cognitive Complexity | < 15 | Biome/SonarQube | |
| Function Length | < 50 lines | ESLint max-lines-per-function | |
| File Length | < 300 lines | ESLint max-lines | |
| Nesting Depth | < 4 levels | ESLint max-depth | |
| Parameters | < 4 | ESLint max-params |
Anti-Patterns
| Anti-Pattern | Why It's Bad | Correct Approach | |
|---|---|---|---|
any everywhere | Defeats type safety | Use proper types or unknown | |
as type assertions | Runtime errors | Use type guards or Zod | |
! non-null assertion | Potential runtime null | Proper null checking | |
| Disabling lint rules inline | Technical debt | Fix the issue or configure globally | |
@ts-ignore | Hides real errors | Use @ts-expect-error with comment | |
| No strict mode | Weaker guarantees | Enable all strict flags |
Quick Troubleshooting
| Issue | Likely Cause | Solution | |
|---|---|---|---|
| ESLint slow on large projects | Type-aware rules expensive | Use project references, cache | |
| Biome conflicts with ESLint | Both trying to format | Use Biome for format, ESLint for type rules | |
| TypeScript error not caught by lint | Need type-aware rule | Use typescript-eslint with projectService | |
| Import order inconsistent | No auto-organize | Enable Biome organizeImports | |
| Pre-commit too slow | Running on all files | Use lint-staged for changed files only |
Related Skills
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.mcp-servers/skill-loader/skills/quality/typescript-quality/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/willyd61/nautobot-v2-custom-metrics-old/typescript-quality)