Skip to main content

46 docs tagged with "rules"

View all tags

Custom ESLint Rules

Custom ESLint rules for catching unsafe patterns and enforcing consistent code style across JavaScript and TypeScript projects.

No Assign Then Return

Disallow assigning to a const variable and immediately returning it when the expression can be returned directly.

No Await In Loop

Disallow await inside loops so sequential calls that should be parallelized with Promise.all are caught early.

No Boolean Var For If

Disallow extracting a multi-condition boolean into a single-use variable for the next if-statement.

No Bracket Assignment

Disallow bracket notation assignment and encourage Reflect.set for dynamic property writes on objects.

No Bracket Method Call

Disallow calling methods via bracket notation with a static string key when dot notation is available.

No Catch Unknown Annotation

Disallow redundant unknown type annotations on catch clause variables because TypeScript defaults them to unknown.

No Destructuring

Disallow destructuring patterns in callbacks, for-of loops, function parameters, variable declarations, and assignment expressions.

No Explicit Any

Disallow usage of the any type and require unknown with type guards or a specific type instead.

No Implicit Boolean

Require explicit boolean comparisons instead of relying on truthy/falsy coercion in conditions.

No Inline Type Annotation

Disallow inline type annotations in code files and require named type aliases from definition files instead.

No Logger.dev

Disallow Logger.dev calls in production code so dev-only logging statements are caught before release.

No Multiline Strings

Disallow multiline string content including backslash continuation, visual newlines in template literals, and internal escape sequences.

No Numeric Literals

Disallow binary, octal, and hexadecimal numeric literal forms and require parseInt with an explicit base instead.

No Optional Chaining

Disallow the optional chaining operator so null and undefined checks are explicit.

No Raw Text in Code

Disallow unwrapped text inside code JSX elements to prevent MDX from parsing special characters as JSX tags.

No Regex Literal Flags

Disallow flags on regex literals so shared patterns stay reusable and callers add flags at the call site via new RegExp.

No Regex Literals

Disallow inline regex literal expressions so patterns are centralized in a shared patterns file and reusable across the codebase.

No Rest Params

Disallow rest parameters in function signatures so parameters are listed explicitly.

No Script URL

Disallow javascript colon URLs except for explicitly allowed patterns such as javascript void zero.

No Shared Type Import

Disallow importing shared type files in code files to enforce type layering where shared types flow through domain type files.

No Template Curly in String

Disallow template literal placeholder syntax in regular strings so missing backticks are caught before the expression appears literally in output.

No Ternary in Template Literal

Disallow ternary expressions inside template literals to keep template strings readable and encourage extracting logic into variables.

No Use Before Define

Disallow use of variables, constants, functions, classes, and types before they are defined.

Require Explicit Return

Require an explicit return statement at the end of void function bodies so every function signals its exit point.

Require Hash Private

Require #hash notation for private class members instead of the private keyword.

Require Import Order

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 JSDoc Body

Require a body paragraph in JSDoc blocks that explains why the declaration exists.

Require JSDoc Hierarchy

Require JSDoc summary lines to follow the hierarchy chain derived from the file path and method name.

Require JSDoc Param Name

Require param descriptions to match the parameter name with the first letter capitalized and a trailing period.

Require JSDoc Private

Require a private tag in JSDoc blocks for private class members to keep documentation consistent with access modifiers.

Require JSDoc Since

Require a since tag in every JSDoc block to track when classes, methods, properties, and type declarations were introduced.

Require Padding Lines

Require blank lines between specific statement patterns for improved readability such as exit code before return and before loops.

Require Type Naming

Require type alias names in definition files to start with the class name prefix derived from the file path.

Switch Case Blocks

Require every non-empty switch case to wrap its body in a block so declarations stay scoped and branches stay independent.

Workspace Rules

How Nova governs workspaces using roles, policies, and field handling rules that determine what each package.json recipe enforces.