Package Exports
- eslint-plugin-node
- eslint-plugin-node/package.json
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-plugin-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
eslint-plugin-node
Additional ESLint's rules for Node.js
Install & Usage
> npm install --save-dev eslint eslint-plugin-node.eslintrc
{
"extends": "eslint:recommended",
"plugins": ["node"],
"env": {
"node": true
},
"rules": {
"node/no-missing-import": 2,
"node/no-missing-require": 2,
"node/no-unpublished-import": 2,
"node/no-unpublished-require": 2,
"node/no-unsupported-features": [2, {"version": 4}],
"node/shebang": 2
}
}Rules
Some rules are slow because it searches package.json and opens it.
- no-missing-import - Disallow
importandexportdeclarations for files that don't exist. - no-missing-require - Disallow
require()s for files that don't exist. - no-unpublished-import - Disallow
importandexportdeclarations for files that are not published. - no-unpublished-require - Disallow
require()s for files that are not published. - no-unsupported-features - Disallow unsupported ECMAScript features on the specified version.
- shebang - Suggest correct usage of shebang. (fixable)
FAQ
Q: The no-missing-import / no-missing-require rules don't work with nested folders in SublimeLinter-eslint
A: See context.getFilename() in rule returns relative path in the SublimeLinter-eslint FAQ.