Overview
Use Nova Rules to catch unsafe patterns and enforce consistent code style. Pick the rules that match your workflow.
Install
If the package is not in your repo yet, go to Setup and Configure and choose Install into project.
warning
Nova must be installed in your project before importing rules. This is because Node.js resolves imports from your project's node_modules folder.
info
If you wish, you can install Nova globally (into the system) and locally (into the project) at the same time. They will not conflict with each other.
Purpose and Scope
Rules
All items below are targeted, independent, and safe to adopt. Enable only what you need.
Each rule focuses on a single concern.
ESLint
Custom rules for JavaScript and TypeScript projects.
Conventions
| Rule | Synopsis |
|---|---|
| No Default Export Declaration | Disallow attaching function or class declarations to export default. |
| No Implicit Boolean | Require explicit comparisons instead of truthy/falsy coercion in conditions. |
| Require Explicit Return | Require an explicit return; at the end of void function bodies. |
| Require Hash Private | Require #hash notation for private class members. |
| Require Kebab Case Filename | Require kebab-case file names for TypeScript files. |
| Require Naming Convention | Enforce context-aware naming conventions for identifiers. |
| Require Undefined Init | Require = undefined when declaring uninitialized variables. |
| Switch Case Blocks | Require block-wrapped switch cases so declarations stay scoped per branch. |
Formatting
| Rule | Synopsis |
|---|---|
| No Complex Arrow Concise | Require block body on complex concise arrows. |
| No Multiline Strings | Use [].join() instead of multiline string content. |
| No Raw Text in Code | Ban unwrapped text inside <code> elements to prevent MDX parsing issues. |
| No Ternary in Template Literal | Extract ternary expressions out of template literal interpolation slots. |
| Require Import Order | Require 6-group import ordering with blank line separation. |
| Require Multiline Condition Groups | Require expanded formatting for parenthesized groups in mixed-operator logical expressions. |
| Require Multiline Conditions | Require multiline format when a logical expression exceeds the inline operand limit. |
| Require Padding Lines | Require blank lines between specific statement patterns for readability. |
| Require Ternary Parens | Require parenthesized condition in ternaries. |
JSDoc
| Rule | Synopsis |
|---|---|
| Require JSDoc Body | Require a body paragraph in JSDoc blocks that explains why the declaration exists. |
| Require JSDoc Hierarchy | Require summary lines to follow hierarchy chain from file path. |
| Require JSDoc Param Alignment | Require vertical alignment of @param types, names, and dashes. |
| Require JSDoc Param Name | Require @param descriptions to match param name. |
| Require JSDoc Private | Require @private tag for private class members. |
| Require JSDoc Since | Require @since tag in every JSDoc block. |
Nova
| Rule | Synopsis |
|---|---|
| No Logger.dev | Flag Logger.dev calls so dev-only logging gets caught before production. |
Patterns
| Rule | Synopsis |
|---|---|
| No Assign Then Return | Return expressions directly instead of assigning to an intermediate variable. |
| No Await In Loop | Disallow await inside loops so sequential calls are parallelized. |
| No Boolean Var For If | Disallow extracting multi-condition boolean into a variable used once in the next if. |
| No Bracket Assignment | Use Reflect.set() instead of bracket notation assignment. |
| No Bracket Method Call | Use dot notation to call methods instead of bracket notation with static keys. |
| No Template Curly in String | Catch ${...} in regular strings so missing backticks are found early. |
| No Use Before Define | Catch identifiers used before declaration so read order matches definition order. |
Regex
| Rule | Synopsis |
|---|---|
| No Regex Literal Flags | Ban flags on regex literals so callers add flags at the call site. |
| No Regex Literals | Ban inline regex literals so patterns are centralized in a shared file. |
Safety
| Rule | Synopsis |
|---|---|
| No Script URL | Block javascript: URLs in string literals. |
Syntax
| Rule | Synopsis |
|---|---|
| No Destructuring | Ban destructuring in callbacks, loops, functions, declarations, assignments. |
| No Numeric Literals | Use parseInt() with an explicit base instead of binary, octal, or hex literals. |
| No Optional Chaining | Ban the ?. operator so null/undefined checks are explicit. |
| No Rest Params | Ban rest parameters so function signatures list parameters explicitly. |
TypeScript
| Rule | Synopsis |
|---|---|
| No Catch Unknown Annotation | Remove redundant : unknown annotations from catch clause variables. |
| No Explicit Any | Disallow the any type in favor of unknown or specific types. |
| No Inline Type Annotation | Require named type aliases instead of inline type annotations in code files. |
| No Shared Type Import | Prevent code files from importing shared type files directly. |
| Require Bracket Property Access | Require bracket notation instead of dot notation on project-defined objects. |
| Require Type Naming | Require type alias names to start with the class name prefix from file path. |
Using Nova presets? See Presets for composable ESLint and TSConfig layers.