require-nvmrc-file
Require a .nvmrc file in repositories.
Targeted pattern scopeâ
This rule checks the repository root for .nvmrc.
What this rule reportsâ
This rule reports when .nvmrc is missing from the repository root.
Why this rule existsâ
Teams that rely on nvm typically use .nvmrc as the canonical Node.js version pin.
Without it, local development, CI runners, and release tooling can silently run
on different Node.js versions and produce inconsistent behavior.
â Incorrectâ
// .nvmrc is missing from the repository root
â Correctâ
// .nvmrc contains the pinned Node.js version
20.11.1
ESLint flat config exampleâ
import repoPlugin from "eslint-plugin-repo";
export default [
repoPlugin.configs.node,
{
plugins: { "repo-compliance": repoPlugin },
rules: {
"repo-compliance/require-nvmrc-file": "warn",
},
},
];
When not to use itâ
Disable this rule if your project intentionally standardizes on .node-version
instead and you enforce that in
require-node-version-file.
Rule catalog ID: R040