11{
22 "root": true,
33 "env": {
4- "node": true,
5- "mocha": true
4+ "node": true
65 },
76 "parser": "@typescript-eslint/parser",
8- "plugins": [
9- "@typescript-eslint"
10- ],
7+ "plugins": ["@typescript-eslint", "prettier"],
118 "extends": [
129 "eslint:recommended",
13- "plugin:@typescript-eslint/recommended"
10+ "plugin:@typescript-eslint/recommended",
11+ "plugin:import/recommended",
12+ "plugin:prettier/recommended"
1413 ],
1514 "rules": {
1615 "quotes": ["warn", "double", "avoid-escape"],
2019 "no-console": "off",
2120 "camelcase": "warn",
2221 "require-atomic-updates": "off",
23- "prefer-destructuring": ["warn", {
24- "array": false,
25- "object": true
26- }, {
27- "enforceForRenamedProperties": false
28- }],
22+ "prefer-destructuring": [
23+ "warn",
24+ {
25+ "AssignmentExpression": { "object": false, "array": false },
26+ "VariableDeclarator": { "object": true, "array": true }
27+ },
28+ {
29+ "enforceForRenamedProperties": false
30+ }
31+ ],
2932 "object-curly-spacing": ["warn", "always"],
3033 "prefer-const": ["warn"],
31- "@typescript-eslint/require-await": ["error"],
32- "@typescript-eslint/no-explicit-any": ["off"]
34+ "@typescript-eslint/consistent-type-imports": [
35+ "warn",
36+ { "prefer": "type-imports" }
37+ ]
3338 },
3439 "overrides": [
3540 {
3641 "files": ["test/**/*.ts"],
3742 "rules": {
38- "@typescript-eslint/ban-ts-comment": ["off"],
39- "@typescript-eslint/no-unused-vars": ["off"]
43+ "@typescript-eslint/ban-ts-comment": "off",
44+ "@typescript-eslint/no-explicit-any": "off",
45+ "@typescript-eslint/no-unused-vars": "off",
46+ "@typescript-eslint/no-empty-function": "off"
47+ }
48+ }
49+ ],
50+ "settings": {
51+ "import/parsers": {
52+ "@typescript-eslint/parser": [".ts", ".tsx"]
53+ },
54+ "import/resolver": {
55+ "typescript": {
56+ "alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
57+ "project": "./tsconfig.json"
4058 }
4159 }
42- ]
60+ }
4361}
44-
0 commit comments