|
| 1 | +module.exports = { |
| 2 | + "env": { |
| 3 | + "browser": true, |
| 4 | + "es6": true |
| 5 | + }, |
| 6 | + "parser": "@typescript-eslint/parser", |
| 7 | + "plugins": [ |
| 8 | + "@typescript-eslint", |
| 9 | + "@typescript-eslint/tslint", |
| 10 | + "jsdoc", |
| 11 | + "react" |
| 12 | + ], |
| 13 | + "rules": { |
| 14 | + "react/jsx-uses-vars": "error", |
| 15 | + "react/jsx-uses-react": "error", |
| 16 | + "@typescript-eslint/await-thenable": "error", |
| 17 | + "@typescript-eslint/consistent-type-assertions": "error", |
| 18 | + "@typescript-eslint/consistent-type-definitions": "error", |
| 19 | + "@typescript-eslint/dot-notation": "error", |
| 20 | + "@typescript-eslint/explicit-member-accessibility": [ |
| 21 | + "off", |
| 22 | + { |
| 23 | + "accessibility": "explicit" |
| 24 | + } |
| 25 | + ], |
| 26 | + "@typescript-eslint/indent": "off", |
| 27 | + "@typescript-eslint/interface-name-prefix": "off", |
| 28 | + "@typescript-eslint/member-delimiter-style": [ |
| 29 | + "error", |
| 30 | + { |
| 31 | + "multiline": { |
| 32 | + "delimiter": "none", |
| 33 | + "requireLast": true |
| 34 | + }, |
| 35 | + "singleline": { |
| 36 | + "delimiter": "semi", |
| 37 | + "requireLast": false |
| 38 | + } |
| 39 | + } |
| 40 | + ], |
| 41 | + "@typescript-eslint/member-ordering": "off", |
| 42 | + "@typescript-eslint/no-empty-function": "error", |
| 43 | + "@typescript-eslint/no-explicit-any": "off", |
| 44 | + "@typescript-eslint/no-inferrable-types": "error", |
| 45 | + "@typescript-eslint/no-require-imports": "off", |
| 46 | + "@typescript-eslint/no-unused-expressions": "error", |
| 47 | + "@typescript-eslint/no-unused-vars": [ |
| 48 | + "error", |
| 49 | + { |
| 50 | + "argsIgnorePattern": "^_" , |
| 51 | + "varsIgnorePattern": "^_" |
| 52 | + } |
| 53 | + ] , |
| 54 | + "@typescript-eslint/no-use-before-define": "error", |
| 55 | + "@typescript-eslint/no-var-requires": "off", |
| 56 | + "@typescript-eslint/prefer-namespace-keyword": "error", |
| 57 | + "@typescript-eslint/quotes": [ |
| 58 | + "error", |
| 59 | + "single", |
| 60 | + { |
| 61 | + "avoidEscape": true, |
| 62 | + "allowTemplateLiterals": true |
| 63 | + } |
| 64 | + ], |
| 65 | + "@typescript-eslint/semi": [ |
| 66 | + "error", |
| 67 | + "never" |
| 68 | + ], |
| 69 | + "@typescript-eslint/strict-boolean-expressions": "off", |
| 70 | + "@typescript-eslint/type-annotation-spacing": "error", |
| 71 | + "@typescript-eslint/typedef": [ |
| 72 | + "error", |
| 73 | + { |
| 74 | + "propertyDeclaration": true |
| 75 | + } |
| 76 | + ], |
| 77 | + "@typescript-eslint/method-signature-style": [ |
| 78 | + "error", |
| 79 | + "method" |
| 80 | + ], |
| 81 | + "no-redeclare": "off", |
| 82 | + "@typescript-eslint/no-redeclare": ["error"], |
| 83 | + "arrow-parens": [ |
| 84 | + "error", |
| 85 | + "as-needed" |
| 86 | + ], |
| 87 | + "brace-style": [ |
| 88 | + "error", |
| 89 | + "1tbs" |
| 90 | + ], |
| 91 | + "camelcase": "error", |
| 92 | + "class-methods-use-this": "error", |
| 93 | + "comma-dangle": "error", |
| 94 | + "constructor-super": "error", |
| 95 | + "curly": "off", |
| 96 | + "default-case": "error", |
| 97 | + "eol-last": "error", |
| 98 | + "eqeqeq": [ |
| 99 | + "error", |
| 100 | + "smart" |
| 101 | + ], |
| 102 | + "func-style": [ |
| 103 | + "error", |
| 104 | + "declaration", |
| 105 | + { "allowArrowFunctions": true } |
| 106 | + ], |
| 107 | + "guard-for-in": "off", |
| 108 | + "id-blacklist": [ |
| 109 | + "error", |
| 110 | + "any", |
| 111 | + "Number", |
| 112 | + "number", |
| 113 | + "String", |
| 114 | + "string", |
| 115 | + "Boolean", |
| 116 | + "boolean", |
| 117 | + "Undefined", |
| 118 | + "undefined" |
| 119 | + ], |
| 120 | + "id-match": "error", |
| 121 | + "jsdoc/check-alignment": "error", |
| 122 | + "jsdoc/check-indentation": "error", |
| 123 | + "jsdoc/newline-after-description": "error", |
| 124 | + "max-len": [ |
| 125 | + "error", |
| 126 | + { |
| 127 | + "code": 100 |
| 128 | + } |
| 129 | + ], |
| 130 | + "no-bitwise": "error", |
| 131 | + "no-caller": "error", |
| 132 | + "no-cond-assign": "error", |
| 133 | + "no-console": [ |
| 134 | + "error", |
| 135 | + { |
| 136 | + "allow": [ |
| 137 | + "log", |
| 138 | + "warn", |
| 139 | + "error", |
| 140 | + "dir", |
| 141 | + "assert", |
| 142 | + "clear", |
| 143 | + "count", |
| 144 | + "countReset", |
| 145 | + "group", |
| 146 | + "groupCollapsed", |
| 147 | + "groupEnd", |
| 148 | + "Console", |
| 149 | + "dirxml", |
| 150 | + "table", |
| 151 | + "markTimeline", |
| 152 | + "profile", |
| 153 | + "profileEnd", |
| 154 | + "timeline", |
| 155 | + "timelineEnd", |
| 156 | + "timeStamp", |
| 157 | + "context" |
| 158 | + ] |
| 159 | + } |
| 160 | + ], |
| 161 | + "no-control-regex": "error", |
| 162 | + "no-debugger": "error", |
| 163 | + "no-empty": "error", |
| 164 | + "no-extra-semi": "error", |
| 165 | + "no-eval": "error", |
| 166 | + "no-fallthrough": "error", |
| 167 | + "no-invalid-regexp": "error", |
| 168 | + "no-irregular-whitespace": "error", |
| 169 | + "no-multiple-empty-lines": "error", |
| 170 | + "no-new-wrappers": "error", |
| 171 | + "no-null/no-null": "off", |
| 172 | + "no-regex-spaces": "error", |
| 173 | + "no-shadow": [ |
| 174 | + "off", |
| 175 | + { |
| 176 | + "hoist": "all" |
| 177 | + } |
| 178 | + ], |
| 179 | + "no-throw-literal": "error", |
| 180 | + "no-trailing-spaces": "error", |
| 181 | + "no-unused-labels": "error", |
| 182 | + "no-var": "error", |
| 183 | + "object-curly-spacing": [ |
| 184 | + "error", |
| 185 | + "always" |
| 186 | + ], |
| 187 | + "prefer-const": "error", |
| 188 | + "radix": "error", |
| 189 | + "spaced-comment": [ |
| 190 | + "error", |
| 191 | + "always", |
| 192 | + { |
| 193 | + "markers": [ |
| 194 | + "/" |
| 195 | + ] |
| 196 | + } |
| 197 | + ], |
| 198 | + "use-isnan": "error" |
| 199 | + /* |
| 200 | + // check mapping of tslint to eslint rules and current status of rules migration here |
| 201 | + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/ROADMAP.md |
| 202 | + "@typescript-eslint/tslint/config": [ |
| 203 | + "error", |
| 204 | + { |
| 205 | + "rules": { |
| 206 | + "function-name": [ |
| 207 | + true, |
| 208 | + { |
| 209 | + "method-regex": "^[a-z][\\w\\d]+$", |
| 210 | + "private-method-regex": "^__?[a-z][\\w\\d]+$", |
| 211 | + "static-method-regex": "^[a-z][\\w\\d]+$", |
| 212 | + "function-regex": "^[a-z][\\w\\d]+$" |
| 213 | + } |
| 214 | + ], |
| 215 | + "no-unnecessary-local-variable": true, |
| 216 | + "no-unnecessary-override": true |
| 217 | + } |
| 218 | + } |
| 219 | + ] |
| 220 | + */ |
| 221 | + } |
| 222 | +}; |
0 commit comments