/
module-base.js
38 lines (33 loc) · 882 Bytes
/
module-base.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
"use strict";
/**
* @fileoverview Base config for Node.js ES Modules in both JS and TS
*/
/** @type {import("@typescript-eslint/utils").TSESLint.Linter.Config} */
module.exports = {
parserOptions: {
sourceType: "module",
},
plugins: ["import"],
rules: {
// for both TypeScript and non-TypeScript rules
// ** Static analysis **
"import/no-absolute-path": 2,
// for monorepo
"import/no-relative-packages": 2,
"import/no-self-import": 2,
"import/no-useless-path-segments": 2,
// ** Helpful warnings **
"import/no-deprecated": 2,
"import/no-mutable-exports": 2,
// ** Style guide **
"import/first": 2,
"import/newline-after-import": 2,
"import/no-duplicates": 2,
"import/order": [
2,
{
groups: [["builtin", "external"], "internal", "index", "parent", "sibling"],
},
],
},
};