Skip to main content

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

  • Custom ESLint rules that catch patterns the built-in rule set does not cover.
  • Focused checks that target specific risks like leaked dev logging and unscoped switch cases.
  • No extra options required — enable each rule in your flat config and it works.
  • Designed to complement existing ESLint rules, not replace them.

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.

Formatting

RuleSynopsis
No Raw Text in CodeBan unwrapped text inside <code> elements to prevent MDX parsing issues.
Require Padding LinesRequire blank lines between specific statement patterns for readability.

Nova

RuleSynopsis
No Logger.devFlag Logger.dev calls so dev-only logging gets caught before production.

Patterns

RuleSynopsis
No Assign Then ReturnReturn expressions directly instead of assigning to an intermediate variable.
No Bracket AssignmentUse Reflect.set() instead of bracket notation assignment.
No DestructuringBan destructuring in callbacks, loops, functions, declarations, assignments.
No Implicit BooleanRequire explicit comparisons instead of truthy/falsy coercion in conditions.
No Ternary in Template LiteralExtract ternary expressions out of template literal interpolation slots.
Switch Case BlocksRequire block-wrapped switch cases so declarations stay scoped per branch.

Regex

RuleSynopsis
No Regex Literal FlagsBan flags on regex literals so callers add flags at the call site.
No Regex LiteralsBan inline regex literals so patterns are centralized in a shared file.

TypeScript

RuleSynopsis
No Catch Unknown AnnotationRemove redundant : unknown annotations from catch clause variables.
No Inline Type AnnotationRequire named type aliases instead of inline type annotations in code files.
No Shared Type ImportPrevent code files from importing shared type files directly.

Using Nova presets? See Presets for composable ESLint and TSConfig layers.