Config for Node.js projects.
-
If you haven't already, make sure to install
@code-pushup/eslint-config
and its required peer dependencies. -
Since this plugin requires additional peer dependencies, you have to install them as well:
npm install -D eslint-plugin-n
-
Add to your
eslint.config.js
file:import node from '@code-pushup/eslint-config/node.js'; import tseslint from 'typescript-eslint'; export default tseslint.config(...node);
290 rules are included from javascript
config. For brevity, only the 4 additional rules are listed in this document.
🔧 Automatically fixable by the
--fix
CLI option.
💡 Manually fixable by editor suggestions.
🧪🚫 Disabled for test files.
🧪⚠️ Severity lessened to warning for test files.
Plugin | Rule | Options | Autofix | Overrides |
---|---|---|---|---|
no-unsupported-features/node-builtins disallow unsupported Node.js built-in APIs on the specified version |
Plugin | Rule | Options | Autofix | Overrides |
---|---|---|---|---|
no-process-exit disallow the use of process.exit() |
||||
no-sync disallow synchronous methods |
||||
prefer-promises/fs enforce require("fs").promises |