-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnode.js
38 lines (37 loc) · 2.01 KB
/
node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* eslint sort-keys: ["error", "asc"] */
/* eslint-disable sort-keys */
module.exports = {
plugins: ["node"],
extends: ["plugin:n/recommended"],
env: {
node: true,
},
parserOptions: {
// Most Node projects don't use Babel to preprocess JS files
// Requiring them would be annoying
requireConfigFile: false,
},
rules: {
/* eslint-enable sort-keys */
"n/callback-return": "warn", // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/callback-return.md
"n/global-require": "off", // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/global-require.md
"n/handle-callback-err": ["warn", "^(err|error)$"], // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/handle-callback-err
"n/no-mixed-requires": [
"warn",
{
allowCall: true,
grouping: false,
},
], // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-mixed-requires.md
"n/no-new-require": "warn", // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-new-require.md
"n/no-path-concat": "warn", // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-path-concat.md
// process.exit() is often used in situations where it would have been better to either throw an error or
// let the process exit by itself.
// There are situations where process.exit() is the cause of truncated stdout output,
// see https://nodejs.org/api/process.html#process_process_exit_code
// If you want to set the exit code, you can also use process.exitCode.
// Disable this rule if you have to exit the process forcefully and you know what you're doing.
"n/no-process-exit": "warn", // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-exit.md
/* eslint-disable sort-keys */
},
};