|
4 | 4 | "parserOptions": {
|
5 | 5 | "ecmaVersion": 2019
|
6 | 6 | },
|
7 |
| - "plugins": [ |
8 |
| - "@typescript-eslint", |
9 |
| - "prettier", |
10 |
| - "eslint-plugin-tsdoc" |
11 |
| - ], |
| 7 | + "plugins": ["@typescript-eslint", "prettier", "eslint-plugin-tsdoc"], |
12 | 8 | "extends": [
|
13 | 9 | "eslint:recommended",
|
14 | 10 | "plugin:@typescript-eslint/eslint-recommended",
|
|
22 | 18 | },
|
23 | 19 | "rules": {
|
24 | 20 | "prettier/prettier": "error",
|
25 |
| - |
26 | 21 | "tsdoc/syntax": "warn",
|
27 |
| - |
28 | 22 | "no-console": "error",
|
29 |
| - "eqeqeq": ["error", "always", {"null": "ignore"}], |
| 23 | + "eqeqeq": [ |
| 24 | + "error", |
| 25 | + "always", |
| 26 | + { |
| 27 | + "null": "ignore" |
| 28 | + } |
| 29 | + ], |
30 | 30 | "strict": ["error", "global"],
|
31 |
| - |
32 | 31 | "@typescript-eslint/no-explicit-any": "off",
|
33 |
| - |
34 | 32 | "no-restricted-syntax": [
|
35 | 33 | "error",
|
36 | 34 | {
|
|
51 | 49 | }
|
52 | 50 | ]
|
53 | 51 | },
|
54 |
| - "overrides": [{ |
55 |
| - "files": ["*.d.ts"], |
56 |
| - "rules": { |
57 |
| - "prettier/prettier": "off", |
58 |
| - "@typescript-eslint/no-empty-interface": "off", |
59 |
| - "@typescript-eslint/no-misused-new": "off", |
60 |
| - "@typescript-eslint/ban-types": "off", |
61 |
| - "@typescript-eslint/no-unused-vars": "off" |
| 52 | + "overrides": [ |
| 53 | + { |
| 54 | + "files": ["*.d.ts"], |
| 55 | + "parser": "@typescript-eslint/parser", |
| 56 | + "rules": { |
| 57 | + "prettier/prettier": "off", |
| 58 | + "@typescript-eslint/no-empty-interface": "off", |
| 59 | + "@typescript-eslint/no-misused-new": "off", |
| 60 | + "@typescript-eslint/ban-types": "off", |
| 61 | + "@typescript-eslint/no-unused-vars": "off" |
| 62 | + } |
| 63 | + }, |
| 64 | + { |
| 65 | + "files": ["*.mjs"], |
| 66 | + "parserOptions": { |
| 67 | + "sourceType": "module" |
| 68 | + } |
| 69 | + }, |
| 70 | + { |
| 71 | + // Settings for javascript test files |
| 72 | + "files": ["test/**/*.js"], |
| 73 | + "parser": "espree", |
| 74 | + "plugins": ["prettier"], |
| 75 | + "extends": ["eslint:recommended", "plugin:prettier/recommended"], |
| 76 | + "rules": { |
| 77 | + "@typescript-eslint/no-var-requires": "off", |
| 78 | + "@typescript-eslint/no-empty-function": "off", |
| 79 | + "@typescript-eslint/no-this-alias": "off", |
| 80 | + "@typescript-eslint/no-unused-vars": "off", |
| 81 | + // Since we use ts-node we should always require the TS code |
| 82 | + // Also we have patches to apply to the mock server, so we should always import from there |
| 83 | + "no-restricted-modules": [ |
| 84 | + "error", |
| 85 | + { |
| 86 | + "patterns": ["**/../lib/**", "mongodb-mock-server"] |
| 87 | + } |
| 88 | + ], |
| 89 | + "no-console": "off", |
| 90 | + "tsdoc/syntax": "off", |
| 91 | + "strict": ["off", "global"], |
| 92 | + "no-restricted-syntax": "off" |
| 93 | + } |
| 94 | + }, |
| 95 | + { |
| 96 | + // Settings for typescript test files |
| 97 | + "files": ["test/**/*.ts"], |
| 98 | + "parser": "@typescript-eslint/parser", |
| 99 | + "rules": { |
| 100 | + "no-console": "off", |
| 101 | + "no-restricted-syntax": "off" |
| 102 | + } |
| 103 | + }, |
| 104 | + { |
| 105 | + // Settings for typescript type test files |
| 106 | + "files": ["*.test-d.ts"], |
| 107 | + "parser": "@typescript-eslint/parser", |
| 108 | + "rules": { |
| 109 | + "prettier/prettier": "error", |
| 110 | + "tsdoc/syntax": "warn", |
| 111 | + "no-console": "off", |
| 112 | + "@typescript-eslint/no-explicit-any": "off", |
| 113 | + "@typescript-eslint/no-unused-vars": "error", |
| 114 | + "@typescript-eslint/ban-ts-comment": "off", |
| 115 | + "@typescript-eslint/no-empty-function": "off" |
| 116 | + } |
62 | 117 | }
|
63 |
| - }, |
64 |
| - { |
65 |
| - "files": ["*.mjs"], |
66 |
| - "parserOptions": {"sourceType": "module"} |
67 |
| - |
68 |
| - },{ |
69 |
| - "files": ["*.ts"], |
70 |
| - "parserOptions": {"sourceType": "module"} |
71 |
| - |
72 |
| - }] |
| 118 | + ] |
73 | 119 | }
|
0 commit comments