Skip to main content

ESLint and TSConfig Presets

Use Nova Presets to lock in strict TypeScript, consistent style, and predictable builds. Pick the layers that match your stack.

Each preset is an ESM module designed for modern workspaces.

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 presets. 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.

ESLint Presets

Configure ESLint by composing small layers into a single flat config export. The goal is clear rules, low noise, and fast composition.

ESLint preset configurations and rule implementations are separate on purpose. Presets compose curated ESLint behavior, including novaRules, which registers Nova-owned rules and enables all of their scaffold defaults. Individual rule implementations remain available from @cbnventures/nova/rules/eslint. Consumers can append a later config object to change or disable any rule.

Mental Model

Nova's ESLint presets are flat config layers that you spread into one export. Think of them as small building blocks.

Each layer states intent and adds a focused set of opinions without hiding magic.

Composition follows a simple order:

  1. Start with an ignores file to keep noise out.
  2. Apply strict code styling so formatting is consistent project-wide.
  3. Add a single language layer for the code you write (e.g., TypeScript).
  4. Then the environment (runtime) or framework that matches where it runs.
  5. Optionally, pick a platform.
  6. Finish with any tool specifics.
  7. Add novaRules, then append consumer-owned overrides last.

Available ESLint Presets

LayerPresetsUse
Required baselinedxIgnore, dxCodeStyleAlways begin with these two layers, in this order.
LanguagelangJavascript, langTypescript, langMdxSelect every language present in the linted workspace.
FrameworkfwAstro, fwDocusaurus, fwExpressjs, fwNextjs, fwReact, fwSvelte, fwVueAdd the framework adapter after its language layers.
RuntimeruntimeBrowser, runtimeCloudflareWorkers, runtimeEdge, runtimeNode, runtimeServiceWorker, runtimeWebWorkerDeclare only the globals and runtime checks available where the code executes.
TooltoolViteScope Node.js globals to Vite and Vitest configuration files.

60-Second Setup

This example shows a minimal Node.js project using TypeScript, composed with Nova's ESLint presets. Configured through the eslint.config.mts file.

ts
import {
  dxCodeStyle,
  dxIgnore,
  langTypescript,
  novaRules,
  runtimeNode,
} from '@cbnventures/nova/presets/eslint';

export default [
  ...dxIgnore,
  ...dxCodeStyle,
  ...langTypescript,
  ...runtimeNode,
  ...novaRules,
];

Read next: ESLint Best Practices.

TSConfig Presets

Configure TypeScript by chaining a few preset configs with "extends". Aim for consistent compiler behavior, strict typing, and predictable output with minimal overrides.

Mental Model

Nova's TSConfig presets are small layers you chain with "extends".

Composition follows a simple order:

  1. Start with essentials as the baseline.
  2. Apply strict for stronger compiler checks.
  3. Select one role to decide whether TypeScript emits source, declarations, or nothing.
  4. Add the runtime that matches where the code runs.
  5. Add a framework when the project uses one.
  6. Finish with any tool specifics.
  7. Keep project paths, ambient types, includes, excludes, and output directories local.

The presets set the heavy knobs for you (e.g., module with moduleResolution, matching lib sets, etc.), so your config stays simple.

Keep local overrides focused on project wiring: paths for imports, outDir and rootDir for layout, types for type packages, and use include for the files you compile and exclude for build artifacts and node_modules.

Available TSConfig Presets

LayerPresetsUse
Required baselinedx-essentials, dx-strictEvery Nova TSConfig begins with these two presets, in this order.
Rolerole-app, role-config, role-scripts, role-source, role-testsSelect build ownership immediately after the required baseline.
Frameworkfw-astro, fw-docusaurus, fw-expressjs, fw-homebridge, fw-nextjs, fw-react, fw-svelte, fw-vueAdd framework compiler behavior after the matching runtime.
Runtimeruntime-browser, runtime-cloudflare-workers, runtime-edge, runtime-node, runtime-service-worker, runtime-web-workerSelect module resolution and libraries for the execution environment.
Tooltool-viteConfigure bundler resolution and isolated transforms for Vite-built source.

60-Second Setup

This example shows a minimal Node.js project using TypeScript, composed with Nova's TSConfig presets. Configured through the tsconfig.json file.

json
{
  "extends": [
    "@cbnventures/nova/presets/tsconfig/dx-essentials.json",
    "@cbnventures/nova/presets/tsconfig/dx-strict.json",
    "@cbnventures/nova/presets/tsconfig/role-source.json",
    "@cbnventures/nova/presets/tsconfig/runtime-node.json"
  ],
  "compilerOptions": {
    "outDir": "./build",
    "paths": {
      "@/*": [
        "./src/*"
      ]
    },
    "rootDir": "./",
    "types": [
      "@types/node"
    ]
  },
  "include": [
    "./*",
    "./src/**/*"
  ],
  "exclude": [
    "./build/**",
    "./node_modules/**"
  ]
}

Read next: TypeScript Compatibility and TSConfig Best Practices.

Scaffold Coverage

Every generated monorepo root has ESLint, TSConfig, and Vitest, even when it starts with no workspace. Every JavaScript or TypeScript workspace starts with dxIgnore, dxCodeStyle, dx-essentials, and dx-strict, enables novaRules, and includes a Vitest suite. Native-only workspace code keeps its native toolchain; Nova applies the JavaScript stack only to Node.js helpers that Nova generates.

ScaffoldAdditional ESLint layersWorkspace TSConfig rolesTest owner
Starter - BaseJavaScript, TypeScript, Noderole-config, role-testsVitest at the root
App - AndroidJavaScript, TypeScript, Node for helper scriptsrole-scripts, role-testsVitest for helpers; Gradle for native code
App - AppleJavaScript, TypeScript, Node for helper scriptsrole-scripts, role-testsVitest for helpers; XCTest for native code
App - AstroJavaScript, TypeScript, Astro, Browserrole-app, role-config, role-testsVitest
App - Discord BotJavaScript, TypeScript, Noderole-source, role-config, role-testsVitest
App - Express.jsJavaScript, TypeScript, Express.js, Noderole-source, role-config, role-testsVitest
App - Next.jsJavaScript, TypeScript, Next.jsrole-app, role-config, role-testsVitest
App - ViteJavaScript, TypeScript, Browser, Vite, selected frameworkrole-appVitest
Docs - DocusaurusJavaScript, MDX, TypeScript, Docusaurus, Browserrole-appVitest and Nova documentation suites
Package - GitHub ActionJavaScript, TypeScript, Noderole-source, role-config, role-testsVitest
Package - HomebridgeJavaScript, TypeScript, Noderole-source, role-config, role-testsVitest
Package - pfSenseJavaScript, TypeScript, Node for packaging helpersrole-scripts, role-testsVitest for helpers; package-specific structural checks for native sources
Tool - ServerlessJavaScript, TypeScript, Node, selected deployment runtimerole-source, role-config, role-testsVitest

Looking for individual custom ESLint rules and their options? See Nova Rules.