Custom ESLint Rules
Custom ESLint rules for catching unsafe patterns and enforcing consistent code style across JavaScript and TypeScript projects.
Custom ESLint rules for catching unsafe patterns and enforcing consistent code style across JavaScript and TypeScript projects.
Disallow assigning to a const variable and immediately returning it when the expression can be returned directly.
Disallow bracket notation assignment and encourage Reflect.set for dynamic property writes on objects.
Disallow redundant unknown type annotations on catch clause variables because TypeScript defaults them to unknown.
Disallow destructuring patterns in callbacks, for-of loops, function parameters, variable declarations, and assignment expressions.
Require explicit boolean comparisons instead of relying on truthy/falsy coercion in conditions.
Disallow inline type annotations in code files and require named type aliases from definition files instead.
Disallow Logger.dev calls in production code so dev-only logging statements are caught before release.
Disallow unwrapped text inside code JSX elements to prevent MDX from parsing special characters as JSX tags.
Disallow flags on regex literals so shared patterns stay reusable and callers add flags at the call site via new RegExp.
Disallow inline regex literal expressions so patterns are centralized in a shared patterns file and reusable across the codebase.
Disallow importing shared type files in code files to enforce type layering where shared types flow through domain type files.
Disallow ternary expressions inside template literals to keep template strings readable and encourage extracting logic into variables.
Require blank lines between specific statement patterns for improved readability such as exit code before return and before loops.
Require every non-empty switch case to wrap its body in a block so declarations stay scoped and branches stay independent.