-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: introduce eslint-plugin-n
- Loading branch information
Showing
8 changed files
with
97 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,27 @@ | ||
module.exports = { | ||
extends: ["plugin:n/recommended"], | ||
env: { | ||
node: true, | ||
}, | ||
rules: { | ||
// enforce return after a callback | ||
"callback-return": "off", | ||
|
||
// require all requires be top-level | ||
// https://eslint.org/docs/rules/global-require | ||
"global-require": "error", | ||
|
||
// enforces error handling in callbacks (node environment) | ||
"handle-callback-err": "off", | ||
|
||
// disallow use of the Buffer() constructor | ||
// https://eslint.org/docs/rules/no-buffer-constructor | ||
"no-buffer-constructor": "error", | ||
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/global-require.md | ||
"n/global-require": "error", | ||
|
||
// disallow mixing regular variable and require declarations | ||
"no-mixed-requires": ["off", false], | ||
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-mixed-requires.md | ||
"n/no-mixed-requires": ["off", false], | ||
|
||
// disallow use of new operator with the require function | ||
"no-new-require": "error", | ||
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-new-require.md | ||
"n/no-new-require": "error", | ||
|
||
// disallow string concatenation with __dirname and __filename | ||
// https://eslint.org/docs/rules/no-path-concat | ||
"no-path-concat": "error", | ||
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-path-concat.md | ||
"n/no-path-concat": "error", | ||
|
||
// disallow use of process.env | ||
"no-process-env": "off", | ||
|
||
// disallow process.exit() | ||
"no-process-exit": "off", | ||
|
||
// restrict usage of specified node modules | ||
"no-restricted-modules": "off", | ||
|
||
// disallow use of synchronous methods (off by default) | ||
"no-sync": "off", | ||
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-env.md | ||
"n/no-process-env": "error", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters