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:
- Start with an ignores file to keep noise out.
- Apply strict code styling so formatting is consistent project-wide.
- Add a single language layer for the code you write (e.g., TypeScript).
- Then the environment (runtime) or framework that matches where it runs.
- Optionally, pick a platform.
- Finish with any tool specifics.
- Add
novaRules, then append consumer-owned overrides last.
Available ESLint Presets
| Layer | Presets | Use |
|---|---|---|
| Required baseline | dxIgnore, dxCodeStyle | Always begin with these two layers, in this order. |
| Language | langJavascript, langTypescript, langMdx | Select every language present in the linted workspace. |
| Framework | fwAstro, fwDocusaurus, fwExpressjs, fwNextjs, fwReact, fwSvelte, fwVue | Add the framework adapter after its language layers. |
| Runtime | runtimeBrowser, runtimeCloudflareWorkers, runtimeEdge, runtimeNode, runtimeServiceWorker, runtimeWebWorker | Declare only the globals and runtime checks available where the code executes. |
| Tool | toolVite | Scope 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.
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:
- Start with essentials as the baseline.
- Apply strict for stronger compiler checks.
- Select one role to decide whether TypeScript emits source, declarations, or nothing.
- Add the runtime that matches where the code runs.
- Add a framework when the project uses one.
- Finish with any tool specifics.
- 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
| Layer | Presets | Use |
|---|---|---|
| Required baseline | dx-essentials, dx-strict | Every Nova TSConfig begins with these two presets, in this order. |
| Role | role-app, role-config, role-scripts, role-source, role-tests | Select build ownership immediately after the required baseline. |
| Framework | fw-astro, fw-docusaurus, fw-expressjs, fw-homebridge, fw-nextjs, fw-react, fw-svelte, fw-vue | Add framework compiler behavior after the matching runtime. |
| Runtime | runtime-browser, runtime-cloudflare-workers, runtime-edge, runtime-node, runtime-service-worker, runtime-web-worker | Select module resolution and libraries for the execution environment. |
| Tool | tool-vite | Configure 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.
{
"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.
| Scaffold | Additional ESLint layers | Workspace TSConfig roles | Test owner |
|---|---|---|---|
| Starter - Base | JavaScript, TypeScript, Node | role-config, role-tests | Vitest at the root |
| App - Android | JavaScript, TypeScript, Node for helper scripts | role-scripts, role-tests | Vitest for helpers; Gradle for native code |
| App - Apple | JavaScript, TypeScript, Node for helper scripts | role-scripts, role-tests | Vitest for helpers; XCTest for native code |
| App - Astro | JavaScript, TypeScript, Astro, Browser | role-app, role-config, role-tests | Vitest |
| App - Discord Bot | JavaScript, TypeScript, Node | role-source, role-config, role-tests | Vitest |
| App - Express.js | JavaScript, TypeScript, Express.js, Node | role-source, role-config, role-tests | Vitest |
| App - Next.js | JavaScript, TypeScript, Next.js | role-app, role-config, role-tests | Vitest |
| App - Vite | JavaScript, TypeScript, Browser, Vite, selected framework | role-app | Vitest |
| Docs - Docusaurus | JavaScript, MDX, TypeScript, Docusaurus, Browser | role-app | Vitest and Nova documentation suites |
| Package - GitHub Action | JavaScript, TypeScript, Node | role-source, role-config, role-tests | Vitest |
| Package - Homebridge | JavaScript, TypeScript, Node | role-source, role-config, role-tests | Vitest |
| Package - pfSense | JavaScript, TypeScript, Node for packaging helpers | role-scripts, role-tests | Vitest for helpers; package-specific structural checks for native sources |
| Tool - Serverless | JavaScript, TypeScript, Node, selected deployment runtime | role-source, role-config, role-tests | Vitest |
Looking for individual custom ESLint rules and their options? See Nova Rules.