Package Exports
- eslint-config-node/style-guide
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-config-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Pluggable ESLint config for Node.js that you can import, extend and override
Node.js: Safety Checks and Best Practices with a bias toward code concision / brevity
Usage
In your js project directory:
npm install --save-dev eslint-config-nodeAnd in your .eslintrc.yaml:
extends:
- nodeAlternatively, in your .eslintrc.js or .eslintrc.json:
{
"extends": ["node"]
}To add a git-hook to your commits, consider using husky
npm install --save-dev huskyAnd in your package.json:
"scripts": {
"precommit": "eslint ."
}Config
This config is biased and opinionated, and errs on the side of too many rules instead of too few. Think of this as a superset of your repo's lint config, and discard what you don't like in it. It's easy to override and disable the rules you find inconvenient.
env:
node: trueenables Node.js features and global variables
extends: esnextincludes config and rules from eslint-config-esnext
rules:selected from here, configured to:
no-path-concat: disallow string concatenation with__dirnameand__filenameno-process-exit: disallow the use ofprocess.exit()no-sync: disallow synchronous methods; set to warn only