-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
/
nodejs.js
36 lines (31 loc) · 841 Bytes
/
nodejs.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
"use strict";
const recommendedScriptConfig = require("eslint-plugin-n/configs/recommended-script");
const recommendedModuleConfig = require("eslint-plugin-n/configs/recommended-module");
const sharedRules = {
"n/callback-return": ["error", ["cb", "callback", "next"]],
"n/handle-callback-err": ["error", "err"],
"n/prefer-node-protocol": "error"
};
const cjsConfigs = [
recommendedScriptConfig,
{
name: "eslint-config-eslint/cjs",
rules: {
...sharedRules,
"n/no-mixed-requires": "error",
"n/no-new-require": "error",
"n/no-path-concat": "error"
}
}
];
const esmConfigs = [
recommendedModuleConfig,
{
name: "eslint-config-eslint/esm",
rules: sharedRules
}
];
module.exports = {
cjsConfigs,
esmConfigs
};