-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
47 lines (47 loc) · 1.2 KB
/
eslint.config.mjs
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
39
40
41
42
43
44
45
46
47
import flat from "./flat.mjs";
export default [
...flat,
{
// Common JS
files: ["*.js"],
rules: {
"no-restricted-syntax": [
"error",
{
selector: "ImportDeclaration",
message: "Unexpected import, use require instead.",
},
{
selector: "ExportNamedDeclaration",
message: "Unexpected export, use module.exports instead.",
},
{
selector: "ExportDefaultDeclaration",
message: "Unexpected export, use module.exports instead.",
},
],
},
},
{
// Common JS
files: ["__tests__/*.js", "*.spec.js", "*.test.js"],
rules: {
"no-restricted-syntax": [
"error",
{
selector: "CallExpression[callee.name='require']",
message: "Unexpected require, use import instead.",
},
{
selector:
"MemberExpression[object.name='module'][property.name='exports']",
message: "Unexpected module.exports, use export instead.",
},
{
selector: "MemberExpression[object.name='exports']",
message: "Unexpected exports, use export instead.",
},
],
},
},
];