Skip to content

eslint/rules/node ​

Node: the mode of a workspace root and of everything around the projects (tool configs, scripts, specs run by Node): Node globals and modules, default exports for the tools, imports by path with their extension (Node ESM needs it), devDependencies, console output. rules/browser turns a project's sources back to the browser.

7 rules, 3 on. Source: lint/eslint/rules/node.mjs.

RuleSettingFilesWhat it checksWhy
import-x/no-anonymous-default-exportoffJS + TS—Off: tools load their config from a default export.
import-x/no-default-exportoffJS + TS——
import-x/extensionserror, ["always",{"ignorePackages":true,"checkTypeImports":true}]JS + TS—Custom: Node ESM needs the extension of a relative import (./lint/eslint/presets/typescript-node.mjs).
import-x/no-extraneous-dependencieserror, {"devDependencies":true,"optionalDependencies":false,"pee…JS + TS—Custom: tools and scripts are never shipped: they may import devDependencies.
import-x/no-nodejs-modulesoffJS + TS—Off: tool configs and scripts run in Node.
local/import-folderserror, {"mode":"simplify"}JS + TS—Custom: a path an index re-exports is simplified on save (./lint/index.mjs); a deep path stays allowed.
no-consoleoffJS + TSDisallow the use of consoleOff: tools and scripts report on the console.

Generated from the JSDoc of the sources.