Language - JavaScript
Parse JavaScript and JSX files with the typescript-eslint parser so Nova's custom rules run on plain JavaScript sources with full AST support.
Why Use This Preset?
- Routes every
.js,.jsx,.cjs, and.mjsfile through the typescript-eslint parser so Nova's custom rules get full AST coverage on plain JavaScript. - Sets
ecmaVersion: 'latest'andsourceType: 'module'so modern JavaScript syntax parses without extra configuration. - Enables
project: trueso type-aware linting works across your JavaScript files. - Disables
@typescript-eslint/no-unused-varson JavaScript files so the standard rule reports unused variables without duplication.
Usage
Add langJavascript to the language layer of your flat config, after the ignores and code-style layers.
eslint.config.ts
import {
dxCodeStyle,
dxIgnore,
langJavascript,
} from '@cbnventures/nova/presets/eslint';
export default [
...dxIgnore,
...dxCodeStyle,
...langJavascript,
];
What This Preset Configures
The preset registers the typescript-eslint parser as the language parser and adds one rule override, both scoped to the .js, .jsx, .cjs, and .mjs script extensions. The base entry only wires up parsing, so the single authored rule turns a TypeScript-aware check off rather than reporting an error.
Parser setup
Registers the typescript-eslint parser with sourceType: 'module', ecmaVersion: 'latest', and project: true so modern JavaScript and JSX parse with full type-aware AST support.
Overrides
| Rule | What it enforces |
|---|---|
@typescript-eslint/no-unused-vars | Disabled on JavaScript files since the standard rule already handles unused vars. |
Related
- Review the layering order in ESLint Best Practices.
- See how presets compose end to end in the Presets Overview.