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 await inside loops so sequential calls that should be parallelized with Promise.all are caught early.
Disallow extracting a multi-condition boolean into a single-use variable for the next if-statement.
Disallow bracket notation assignment and encourage Reflect.set for dynamic property writes on objects.
Disallow calling methods via bracket notation with a static string key when dot notation is available.
Disallow redundant unknown type annotations on catch clause variables because TypeScript defaults them to unknown.
Require arrow functions with complex concise bodies to use an explicit block body.
Disallow attaching function or class declarations to export default.
Disallow destructuring patterns in callbacks, for-of loops, function parameters, variable declarations, and assignment expressions.
Disallow usage of the any type and require unknown with type guards or a specific type instead.
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 multiline string content including backslash continuation, visual newlines in template literals, and internal escape sequences.
Disallow binary, octal, and hexadecimal numeric literal forms and require parseInt with an explicit base instead.
Disallow the optional chaining operator so null and undefined checks are explicit.
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 rest parameters in function signatures so parameters are listed explicitly.
Disallow javascript colon URLs except for explicitly allowed patterns such as javascript void zero.
Disallow importing shared type files in code files to enforce type layering where shared types flow through domain type files.
Disallow template literal placeholder syntax in regular strings so missing backticks are caught before the expression appears literally in output.
Disallow ternary expressions inside template literals to keep template strings readable and encourage extracting logic into variables.
Disallow use of variables, constants, functions, classes, and types before they are defined.
Require bracket notation instead of dot notation for property access on project-defined plain objects.
Require an explicit return statement at the end of void function bodies so every function signals its exit point.
Require #hash notation for private class members instead of the private keyword.
Require 6-group import ordering with regular imports first (Node built-ins, third-party, local) then type imports (Node built-ins, third-party, local).
Require a body paragraph in JSDoc blocks that explains why the declaration exists.
Require JSDoc summary lines to follow the hierarchy chain derived from the file path and method name.
Require vertical alignment of param types, names, and dashes in JSDoc blocks.
Require param descriptions to match the parameter name with the first letter capitalized and a trailing period.
Require a private tag in JSDoc blocks for private class members to keep documentation consistent with access modifiers.
Require a since tag in every JSDoc block to track when classes, methods, properties, and type declarations were introduced.
Require kebab-case file names for TypeScript files.
Require expanded formatting for parenthesized groups in mixed-operator logical expressions.
Require each operand to be on its own line when a logical expression exceeds the allowed inline count.
Enforce context-aware naming conventions for identifiers based on their declaration type.
Require blank lines between specific statement patterns for improved readability such as exit code before return and before loops.
Require parenthesized condition in ternary expressions.
Require type alias names in definition files to start with the class name prefix derived from the file path.
Require explicit undefined initializer when declaring variables without a value.
Require every non-empty switch case to wrap its body in a block so declarations stay scoped and branches stay independent.
How Nova governs workspaces using roles, policies, and field handling rules that determine what each package.json recipe enforces.