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