|
| 1 | +/* |
| 2 | +👋 Hi! This file was autogenerated by tslint-to-eslint-config. |
| 3 | +https://github.com/typescript-eslint/tslint-to-eslint-config |
| 4 | +
|
| 5 | +It represents the closest reasonable ESLint configuration to this |
| 6 | +project's original TSLint configuration. |
| 7 | +
|
| 8 | +We recommend eventually switching this configuration to extend from |
| 9 | +the recommended rulesets in typescript-eslint. |
| 10 | +https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md |
| 11 | +
|
| 12 | +Happy linting! 💖 |
| 13 | +*/ |
| 14 | +module.exports = { |
| 15 | + env: { |
| 16 | + browser: true, |
| 17 | + es6: true, |
| 18 | + node: true |
| 19 | + }, |
| 20 | + extends: ['plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking'], |
| 21 | + parser: '@typescript-eslint/parser', |
| 22 | + parserOptions: { |
| 23 | + project: [ |
| 24 | + 'packages/mgt/tsconfig.json', |
| 25 | + 'packages/mgt-element/tsconfig.json', |
| 26 | + 'packages/mgt-components/tsconfig.json', |
| 27 | + 'packages/mgt-react/tsconfig.json', |
| 28 | + 'packages/mgt-spfx/tsconfig.json', |
| 29 | + 'packages/mgt-spfx-utils/tsconfig.json', |
| 30 | + 'packages/providers/mgt-electron-provider/tsconfig.authenticator.json', |
| 31 | + 'packages/providers/mgt-electron-provider/tsconfig.provider.json', |
| 32 | + 'packages/providers/mgt-mock-provider/tsconfig.json', |
| 33 | + 'packages/providers/mgt-msal-provider/tsconfig.json', |
| 34 | + 'packages/providers/mgt-msal2-provider/tsconfig.json', |
| 35 | + 'packages/providers/mgt-proxy-provider/tsconfig.json', |
| 36 | + 'packages/providers/mgt-sharepoint-provider/tsconfig.json', |
| 37 | + 'packages/providers/mgt-teams-msal2-provider/tsconfig.json', |
| 38 | + 'packages/providers/mgt-teams-provider/tsconfig.json', |
| 39 | + 'packages/providers/mgt-teamsfx-provider/tsconfig.json' |
| 40 | + ], |
| 41 | + sourceType: 'module' |
| 42 | + }, |
| 43 | + plugins: [ |
| 44 | + 'eslint-plugin-jsdoc', |
| 45 | + 'eslint-plugin-prefer-arrow', |
| 46 | + 'eslint-plugin-react', |
| 47 | + '@typescript-eslint', |
| 48 | + '@typescript-eslint/tslint' |
| 49 | + ], |
| 50 | + root: true, |
| 51 | + ignorePatterns: ['**/**-css.ts', '.eslintrc.js'], |
| 52 | + rules: { |
| 53 | + '@typescript-eslint/adjacent-overload-signatures': 'error', |
| 54 | + '@typescript-eslint/array-type': [ |
| 55 | + 'error', |
| 56 | + { |
| 57 | + default: 'array' |
| 58 | + } |
| 59 | + ], |
| 60 | + '@typescript-eslint/ban-types': [ |
| 61 | + 'error', |
| 62 | + { |
| 63 | + types: { |
| 64 | + Object: { |
| 65 | + message: 'Avoid using the `Object` type. Did you mean `object`?' |
| 66 | + }, |
| 67 | + Function: { |
| 68 | + message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.' |
| 69 | + }, |
| 70 | + Boolean: { |
| 71 | + message: 'Avoid using the `Boolean` type. Did you mean `boolean`?' |
| 72 | + }, |
| 73 | + Number: { |
| 74 | + message: 'Avoid using the `Number` type. Did you mean `number`?' |
| 75 | + }, |
| 76 | + String: { |
| 77 | + message: 'Avoid using the `String` type. Did you mean `string`?' |
| 78 | + }, |
| 79 | + Symbol: { |
| 80 | + message: 'Avoid using the `Symbol` type. Did you mean `symbol`?' |
| 81 | + } |
| 82 | + } |
| 83 | + } |
| 84 | + ], |
| 85 | + '@typescript-eslint/consistent-type-assertions': 'error', |
| 86 | + '@typescript-eslint/dot-notation': 'error', |
| 87 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 88 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 89 | + '@typescript-eslint/indent': 'off', |
| 90 | + '@typescript-eslint/member-delimiter-style': [ |
| 91 | + 'off', |
| 92 | + { |
| 93 | + multiline: { |
| 94 | + delimiter: 'none', |
| 95 | + requireLast: true |
| 96 | + }, |
| 97 | + singleline: { |
| 98 | + delimiter: 'semi', |
| 99 | + requireLast: false |
| 100 | + } |
| 101 | + } |
| 102 | + ], |
| 103 | + '@typescript-eslint/naming-convention': [ |
| 104 | + 'warn', |
| 105 | + { |
| 106 | + selector: 'variable', |
| 107 | + format: ['camelCase', 'UPPER_CASE', 'PascalCase'], |
| 108 | + leadingUnderscore: 'forbid', |
| 109 | + trailingUnderscore: 'forbid' |
| 110 | + }, |
| 111 | + { |
| 112 | + selector: ['property', 'accessor'], |
| 113 | + modifiers: ['private'], |
| 114 | + format: ['camelCase'], |
| 115 | + leadingUnderscore: 'allow' |
| 116 | + }, |
| 117 | + { |
| 118 | + selector: ['variable', 'function'], |
| 119 | + format: ['camelCase'], |
| 120 | + leadingUnderscore: 'allow' |
| 121 | + } |
| 122 | + ], |
| 123 | + '@typescript-eslint/no-empty-function': 'error', |
| 124 | + '@typescript-eslint/no-empty-interface': 'error', |
| 125 | + '@typescript-eslint/no-explicit-any': 'off', |
| 126 | + '@typescript-eslint/no-misused-new': 'error', |
| 127 | + '@typescript-eslint/no-namespace': 'error', |
| 128 | + '@typescript-eslint/no-parameter-properties': 'off', |
| 129 | + '@typescript-eslint/no-shadow': [ |
| 130 | + 'error', |
| 131 | + { |
| 132 | + hoist: 'all' |
| 133 | + } |
| 134 | + ], |
| 135 | + '@typescript-eslint/no-unused-expressions': 'error', |
| 136 | + '@typescript-eslint/no-use-before-define': 'off', |
| 137 | + '@typescript-eslint/no-var-requires': 'error', |
| 138 | + '@typescript-eslint/prefer-for-of': 'error', |
| 139 | + '@typescript-eslint/prefer-function-type': 'error', |
| 140 | + '@typescript-eslint/prefer-namespace-keyword': 'error', |
| 141 | + '@typescript-eslint/quotes': [ |
| 142 | + 'error', |
| 143 | + 'single', |
| 144 | + { |
| 145 | + avoidEscape: true |
| 146 | + } |
| 147 | + ], |
| 148 | + '@typescript-eslint/restrict-template-expressions': ['error', { allowBoolean: true, allowNumber: true }], |
| 149 | + '@typescript-eslint/semi': ['off', null], |
| 150 | + '@typescript-eslint/triple-slash-reference': [ |
| 151 | + 'error', |
| 152 | + { |
| 153 | + path: 'always', |
| 154 | + types: 'prefer-import', |
| 155 | + lib: 'always' |
| 156 | + } |
| 157 | + ], |
| 158 | + '@typescript-eslint/type-annotation-spacing': 'off', |
| 159 | + '@typescript-eslint/typedef': 'off', |
| 160 | + '@typescript-eslint/unified-signatures': 'error', |
| 161 | + 'arrow-parens': ['off', 'always'], |
| 162 | + 'brace-style': ['off', 'off'], |
| 163 | + 'comma-dangle': 'off', |
| 164 | + complexity: 'off', |
| 165 | + 'constructor-super': 'error', |
| 166 | + 'dot-notation': 'off', |
| 167 | + 'eol-last': 'off', |
| 168 | + eqeqeq: ['error', 'smart'], |
| 169 | + 'guard-for-in': 'error', |
| 170 | + 'id-denylist': 'error', |
| 171 | + 'id-match': 'error', |
| 172 | + indent: 'off', |
| 173 | + 'jsdoc/check-alignment': 'error', |
| 174 | + 'jsdoc/check-indentation': 'error', |
| 175 | + 'jsdoc/newline-after-description': 'error', |
| 176 | + 'linebreak-style': 'off', |
| 177 | + 'max-classes-per-file': ['error', 1], |
| 178 | + 'max-len': 'off', |
| 179 | + 'new-parens': 'off', |
| 180 | + 'newline-per-chained-call': 'off', |
| 181 | + 'no-bitwise': 'error', |
| 182 | + 'no-caller': 'error', |
| 183 | + 'no-cond-assign': 'error', |
| 184 | + 'no-console': 'error', |
| 185 | + 'no-debugger': 'error', |
| 186 | + 'no-empty': 'error', |
| 187 | + 'no-empty-function': 'off', |
| 188 | + 'no-eval': 'error', |
| 189 | + 'no-extra-semi': 'off', |
| 190 | + 'no-fallthrough': 'off', |
| 191 | + 'no-invalid-this': 'off', |
| 192 | + 'no-irregular-whitespace': 'off', |
| 193 | + 'no-multiple-empty-lines': 'off', |
| 194 | + 'no-new-wrappers': 'error', |
| 195 | + 'no-shadow': 'off', |
| 196 | + 'no-throw-literal': 'error', |
| 197 | + 'no-trailing-spaces': 'off', |
| 198 | + 'no-undef-init': 'error', |
| 199 | + 'no-underscore-dangle': 'off', |
| 200 | + 'no-unsafe-finally': 'error', |
| 201 | + 'no-unused-expressions': 'off', |
| 202 | + 'no-unused-labels': 'error', |
| 203 | + 'no-use-before-define': 'off', |
| 204 | + 'no-var': 'error', |
| 205 | + 'object-shorthand': 'error', |
| 206 | + 'one-var': ['error', 'never'], |
| 207 | + 'padded-blocks': [ |
| 208 | + 'off', |
| 209 | + { |
| 210 | + blocks: 'never' |
| 211 | + }, |
| 212 | + { |
| 213 | + allowSingleLineBlocks: true |
| 214 | + } |
| 215 | + ], |
| 216 | + 'prefer-arrow/prefer-arrow-functions': 'error', |
| 217 | + 'prefer-const': 'error', |
| 218 | + 'quote-props': 'off', |
| 219 | + quotes: 'off', |
| 220 | + radix: 'error', |
| 221 | + 'react/jsx-curly-spacing': 'off', |
| 222 | + 'react/jsx-equals-spacing': 'off', |
| 223 | + 'react/jsx-tag-spacing': [ |
| 224 | + 'off', |
| 225 | + { |
| 226 | + afterOpening: 'allow', |
| 227 | + closingSlash: 'allow' |
| 228 | + } |
| 229 | + ], |
| 230 | + 'react/jsx-wrap-multilines': 'off', |
| 231 | + semi: 'off', |
| 232 | + 'space-before-function-paren': 'off', |
| 233 | + 'space-in-parens': ['off', 'never'], |
| 234 | + 'spaced-comment': [ |
| 235 | + 'error', |
| 236 | + 'always', |
| 237 | + { |
| 238 | + markers: ['/'] |
| 239 | + } |
| 240 | + ], |
| 241 | + 'use-isnan': 'error', |
| 242 | + 'valid-typeof': 'off', |
| 243 | + '@typescript-eslint/tslint/config': [ |
| 244 | + 'warn', |
| 245 | + { |
| 246 | + rules: { |
| 247 | + 'completed-docs': [ |
| 248 | + true, |
| 249 | + { |
| 250 | + methods: { |
| 251 | + privacies: ['public', 'protected'] |
| 252 | + }, |
| 253 | + properties: { |
| 254 | + privacies: ['public', 'protected'] |
| 255 | + }, |
| 256 | + classes: true, |
| 257 | + enums: true, |
| 258 | + 'enum-members': true, |
| 259 | + functions: true, |
| 260 | + interfaces: true, |
| 261 | + namespaces: true, |
| 262 | + types: true, |
| 263 | + variables: true |
| 264 | + } |
| 265 | + ] |
| 266 | + } |
| 267 | + } |
| 268 | + ] |
| 269 | + } |
| 270 | +}; |
0 commit comments