-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
54 lines (53 loc) · 1.58 KB
/
.eslintrc.cjs
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
48
49
50
51
52
53
54
module.exports = {
"env": {
"browser": true,
"es2021": true,
},
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
},
"settings": {
"import/resolver": {
typescript: true,
node: true,
},
"node": {
"resolvePaths": ["node_modules/@types"],
// "tryExtensions": [".js", ".json", ".node", ".ts", ".d.ts", ".cjs", ".mjs", ".mts", "cts"]
},
},
"plugins": [
"node",
"import",
"unicorn",
"file-extension-in-import-ts",
],
"rules": {
// https://github.com/AlexSergey/eslint-plugin-file-extension-in-import-ts
"file-extension-in-import-ts/file-extension-in-import-ts": [
"error",
"always",
{ extMapping: { ".ts": ".js" } },
],
// https://github.com/mysticatea/eslint-plugin-node
// this plugin does not allow ".js" from ts?
// "node/no-missing-import": "error",
"node/no-extraneous-import": "error",
"node/no-sync": "warn",
"node/file-extension-in-import": "error",
// https://github.com/import-js/eslint-plugin-import
"import/extensions": "error",
// conflict with file-extension-in-import-ts
'import/no-unresolved': ['error', { ignore: [ '\\.js$' ] }],
"import/no-useless-path-segments": "error",
"import/no-extraneous-dependencies": "error",
"import/no-commonjs": "error",
// https://github.com/sindresorhus/eslint-plugin-unicorn
"unicorn/prefer-module": "error",
"unicorn/prefer-node-protocol": "error",
"unicorn/prefer-top-level-await": "error",
},
};