Comprehensive catalog of TypeScript code quality rules for Next.js, React.js, React Native, and Nest.js projects
⚡Next.js
Full-stack React framework
📱React Native
Mobile development
Category Breakdown
Rule distribution across categories and tools
| Category | Total | ESLint | SunLint | VS Code | Coverage |
|---|
| Common Rules | 33 | 19 | 7 | 13 | |
| Security Rules | 47 | 43 | 3 | 32 | |
| TypeScript Rules | 11 | 8 | 0 | 3 | |
| React.js Rules | 6 | 6 | 0 | 0 | |
Complete list of TypeScript rules by category
C002
Avoid code duplication > 10 linesC003
Use clear variable names; avoid arbitrary abbreviationsC006
Function names must be verbs or verb-noun combinationsC010
Avoid more than 3 levels of nested blocksC014
Use Dependency Injection instead of directly instantiating dependenciesC017
Do not put business logic inside constructorsC018
Do not throw generic errors; always provide detailed messagesC019
Do not use `error` log level for non-critical issuesC023
Do not declare duplicate variable names in the same scopeC024
Do not scatter hardcoded constants throughout the logicC029
All `catch` blocks must log the root cause of the errorC030
Use custom error classes instead of generic system errorsC031
Validation logic must be separatedC033
Separate processing logic and data access in the service layerC035
Log all relevant context when handling errorsC040
Do not spread validation logic across multiple classesC041
Do not hardcode or push sensitive information (token, API key, secret, URL) into the repoC042
Boolean variable names should start with `is`, `has`, or `should`C043
Do not use `print` or `console.log` in production codeC047
Retry logic must not be duplicated in multiple placesC048
Do not bypass architectural layers (controller/service/repository)C052
Parsing or data transformation logic must be separated from controllersC056
Do not process large datasets without logging or resource monitoringC060
Do not override superclass methods and ignore critical logicC061
Write unit tests for business logicC065
Each test case should verify only one behaviorC067
Do not hardcode configuration inside codeC070
Tests should not rely on real timeC072
Each test should assert only one behaviorC073
All required configurations must be validated at startupC075
All functions must explicitly declare return typesC076
All public functions must declare explicit types for argumentsRoadmap for enhancing TypeScript support
Phase 1: ESLint Enhancement
- • Complete remaining 14 Common Rules without ESLint
- • Develop 4 Security Rules for comprehensive coverage
- • Add 3 TypeScript Rules for strict type checking
Phase 2: AI Integration
- • Enhanced VS Code extension capabilities
- • Context-aware rule suggestions
- • Automated rule learning from codebase patterns
TypeScript Catalog • Version 1.0 • Last Updated: July 2025
Developed by Sun* Engineering Team