-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
61 lines (53 loc) · 1.69 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import node from "eslint-plugin-node";
import _import from "eslint-plugin-import";
import unicorn from "eslint-plugin-unicorn";
import fileExtensionInImportTs from "eslint-plugin-file-extension-in-import-ts";
import { fixupPluginRules } from "@eslint/compat";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
export default [{
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
plugins: {
node,
import: fixupPluginRules(_import),
unicorn,
"file-extension-in-import-ts": fileExtensionInImportTs
},
languageOptions: {
globals: {
...globals.browser
},
parser: tsParser,
ecmaVersion: "latest",
sourceType: "module"
},
settings: {
"import/resolver": {
typescript: true,
node: true
},
node: {
resolvePaths: ["node_modules/@types"]
}
},
rules: {
"file-extension-in-import-ts/file-extension-in-import-ts": ["error", "always", {
extMapping: {
".ts": ".js"
}
}],
"node/no-extraneous-import": "error",
"node/no-sync": "warn",
"node/file-extension-in-import": "error",
"import/extensions": "error",
"import/no-unresolved": ["error", {
ignore: ["\\.js$"]
}],
"import/no-useless-path-segments": "error",
"import/no-extraneous-dependencies": "error",
"import/no-commonjs": "error",
"unicorn/prefer-module": "error",
"unicorn/prefer-node-protocol": "error",
"unicorn/prefer-top-level-await": "error"
}
}];