|
| 1 | +module.exports = { |
| 2 | + "env": { |
| 3 | + "browser": true, |
| 4 | + "es6": true |
| 5 | + }, |
| 6 | + "extends": [ |
| 7 | + "plugin:@typescript-eslint/recommended", |
| 8 | + "plugin:@typescript-eslint/recommended-requiring-type-checking" |
| 9 | + ], |
| 10 | + "parser": "@typescript-eslint/parser", |
| 11 | + "parserOptions": { |
| 12 | + "project": "tsconfig.json", |
| 13 | + "sourceType": "module" |
| 14 | + }, |
| 15 | + "plugins": [ |
| 16 | + "eslint-plugin-import", |
| 17 | + "eslint-plugin-jsdoc", |
| 18 | + "eslint-plugin-prefer-arrow", |
| 19 | + "@typescript-eslint" |
| 20 | + ], |
| 21 | + "rules": { |
| 22 | + "@typescript-eslint/adjacent-overload-signatures": "error", |
| 23 | + "@typescript-eslint/array-type": [ |
| 24 | + "error", |
| 25 | + { |
| 26 | + "default": "array-simple" |
| 27 | + } |
| 28 | + ], |
| 29 | + "@typescript-eslint/ban-types": [ |
| 30 | + "error", |
| 31 | + { |
| 32 | + "types": { |
| 33 | + "Object": { |
| 34 | + "message": "Avoid using the `Object` type. Did you mean `object`?" |
| 35 | + }, |
| 36 | + "Function": { |
| 37 | + "message": "Avoid using the `Function` type. Prefer a specific function type." |
| 38 | + }, |
| 39 | + "Boolean": { |
| 40 | + "message": "Avoid using the `Boolean` type. Did you mean `boolean`?" |
| 41 | + }, |
| 42 | + "Number": { |
| 43 | + "message": "Avoid using the `Number` type. Did you mean `number`?" |
| 44 | + }, |
| 45 | + "String": { |
| 46 | + "message": "Avoid using the `String` type. Did you mean `string`?" |
| 47 | + }, |
| 48 | + "Symbol": { |
| 49 | + "message": "Avoid using the `Symbol` type. Did you mean `symbol`?" |
| 50 | + } |
| 51 | + } |
| 52 | + } |
| 53 | + ], |
| 54 | + "@typescript-eslint/dot-notation": "error", |
| 55 | + "@typescript-eslint/explicit-function-return-type": [ |
| 56 | + "error", |
| 57 | + { |
| 58 | + "allowExpressions": true |
| 59 | + } |
| 60 | + ], |
| 61 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 62 | + "@typescript-eslint/naming-convention": [ |
| 63 | + "warn", |
| 64 | + { "selector": "default", "format": ["camelCase"] }, |
| 65 | + { "selector": "typeLike", "format": ["PascalCase"] }, |
| 66 | + { "selector": "property", "modifiers": ["private"], "format": ["camelCase"], "leadingUnderscore": "require" }, |
| 67 | + { "selector": "property", "modifiers": ["static", "readonly"], "format": ["UPPER_CASE"] }, |
| 68 | + { "selector": "property", "modifiers": ["private", "static", "readonly"], "format": ["UPPER_CASE"], "leadingUnderscore": "forbid" }, |
| 69 | + { "selector": "enumMember", "format": ["PascalCase"] } |
| 70 | + ], |
| 71 | + "@typescript-eslint/no-inferrable-types": 0, |
| 72 | + "@typescript-eslint/no-misused-new": "error", |
| 73 | + "@typescript-eslint/no-namespace": "error", |
| 74 | + "@typescript-eslint/no-parameter-properties": "warn", |
| 75 | + "@typescript-eslint/no-shadow": "error", |
| 76 | + "@typescript-eslint/prefer-namespace-keyword": "error", |
| 77 | + "@typescript-eslint/restrict-template-expressions": 0, |
| 78 | + "@typescript-eslint/triple-slash-reference": [ |
| 79 | + "off", |
| 80 | + { |
| 81 | + "path": "always", |
| 82 | + "types": "prefer-import", |
| 83 | + "lib": "always" |
| 84 | + } |
| 85 | + ], |
| 86 | + "@typescript-eslint/unbound-method": [ |
| 87 | + "error", |
| 88 | + { |
| 89 | + "ignoreStatic": true |
| 90 | + } |
| 91 | + ], |
| 92 | + "@typescript-eslint/unified-signatures": "error", |
| 93 | + "constructor-super": "error", |
| 94 | + "dot-notation": [ |
| 95 | + "error", |
| 96 | + { |
| 97 | + "allowPattern": "^_.+" |
| 98 | + } |
| 99 | + ], |
| 100 | + "eqeqeq": "error", |
| 101 | + "guard-for-in": "error", |
| 102 | + "jsdoc/check-alignment": "error", |
| 103 | + "max-len": [ |
| 104 | + "warn", |
| 105 | + { |
| 106 | + "code": 120 |
| 107 | + } |
| 108 | + ], |
| 109 | + "new-parens": "error", |
| 110 | + "no-caller": "error", |
| 111 | + "no-cond-assign": "error", |
| 112 | + "no-console": "error", |
| 113 | + "no-debugger": "error", |
| 114 | + "no-empty": "error", |
| 115 | + "no-empty-function": "error", |
| 116 | + "no-eval": "error", |
| 117 | + "no-invalid-this": "error", |
| 118 | + "no-multiple-empty-lines": "warn", |
| 119 | + "no-new-wrappers": "error", |
| 120 | + "no-shadow": "off", // Required for @typescript-eslint/no-shadow to work properly |
| 121 | + "no-throw-literal": "error", |
| 122 | + "no-trailing-spaces": "error", |
| 123 | + "no-undef-init": "error", |
| 124 | + "no-unsafe-finally": "error", |
| 125 | + "no-unused-expressions": "error", |
| 126 | + "no-unused-labels": "error", |
| 127 | + "no-var": "error", |
| 128 | + "one-var": [ |
| 129 | + "error", |
| 130 | + "never" |
| 131 | + ], |
| 132 | + "prefer-arrow/prefer-arrow-functions": "error", |
| 133 | + "prefer-const": "error", |
| 134 | + "radix": "error", |
| 135 | + "spaced-comment": [ "error", "always" ], |
| 136 | + "use-isnan": "error", |
| 137 | + "valid-typeof": "error" |
| 138 | + } |
| 139 | +}; |
0 commit comments