|
| 1 | +import tsParser from "@typescript-eslint/parser"; |
| 2 | +import eslint from '@eslint/js'; |
| 3 | +import tseslint from 'typescript-eslint'; |
| 4 | +import stylistic from "@stylistic/eslint-plugin"; |
| 5 | +import importPlugin from 'eslint-plugin-import'; |
| 6 | +import globals from "globals"; |
| 7 | + |
| 8 | +export default [...[].concat( |
| 9 | + importPlugin.flatConfigs.recommended, |
| 10 | + importPlugin.flatConfigs.typescript, |
| 11 | + importPlugin.flatConfigs.errors, |
| 12 | + stylistic.configs["all-flat"], |
| 13 | + tseslint.configs.strictTypeChecked, |
| 14 | + tseslint.configs.eslintRecommended, |
| 15 | + tseslint.configs.recommendedTypeChecked, |
| 16 | + tseslint.configs.all, |
| 17 | + eslint.configs.all |
| 18 | + ), |
| 19 | + { |
| 20 | + files: ["projects/interacto-angular/src/**/*.ts"], |
| 21 | + languageOptions: { |
| 22 | + parser: tsParser, |
| 23 | + parserOptions: { |
| 24 | + sourceType: "module", |
| 25 | + project: ["projects/interacto-angular/tsconfig.lib.prod.json"] |
| 26 | + }, |
| 27 | + globals: { |
| 28 | + ...globals.browser, |
| 29 | + ...globals.node, |
| 30 | + "NodeJS": true |
| 31 | + } |
| 32 | + }, |
| 33 | + plugins: { |
| 34 | + }, |
| 35 | + rules: { |
| 36 | + "no-useless-constructor": "off", |
| 37 | + "no-warning-comments": "off", |
| 38 | + "no-new": "off", |
| 39 | + "no-underscore-dangle": "off", |
| 40 | + "id-length": ["error", { |
| 41 | + exceptions: ["x", "y", "i", "j", "c"], |
| 42 | + }], |
| 43 | + "require-await": "off", |
| 44 | + "no-use-before-define": "off", |
| 45 | + "default-case": "off", |
| 46 | + "accessor-pairs": "off", |
| 47 | + "no-console": "off", |
| 48 | + "new-cap": "off", |
| 49 | + "no-duplicate-imports": "off", |
| 50 | + "func-style": "off", |
| 51 | + "max-lines": "off", |
| 52 | + "prefer-destructuring": "off", |
| 53 | + "no-lonely-if": "off", |
| 54 | + "capitalized-comments": "off", |
| 55 | + "no-plusplus": "off", |
| 56 | + "no-extra-parens": "off", |
| 57 | + "dot-location": "off", |
| 58 | + "sort-keys": "off", |
| 59 | + "array-element-newline": "off", |
| 60 | + "function-paren-newline": "off", |
| 61 | + "max-params": "off", |
| 62 | + "no-ternary": "off", |
| 63 | + "multiline-ternary": "off", |
| 64 | + "max-classes-per-file": "off", |
| 65 | + "max-statements": "off", |
| 66 | + "init-declarations": "off", |
| 67 | + "keyword-spacing": "off", |
| 68 | + "space-before-function-paren": "off", |
| 69 | + "function-call-argument-newline": "off", |
| 70 | + "no-mixed-operators": "off", |
| 71 | + "lines-between-class-members": "off", |
| 72 | + "no-unused-expressions": "off", |
| 73 | + "no-undefined": "off", |
| 74 | + "padded-blocks": "off", |
| 75 | + "lines-around-comment": "off", |
| 76 | + "sort-imports": "off", |
| 77 | + "no-magic-numbers": "off", |
| 78 | + "indent": "off", |
| 79 | + "multiline-comment-style": ["error", "starred-block"], |
| 80 | + "arrow-parens": ["error", "as-needed"], |
| 81 | + "complexity": ["error", { |
| 82 | + max: 10, |
| 83 | + }], |
| 84 | + "eqeqeq": ["error", "smart"], |
| 85 | + "max-len": ["error", { |
| 86 | + code: 150, |
| 87 | + }], |
| 88 | + "no-multiple-empty-lines": ["error", { |
| 89 | + max: 1, |
| 90 | + }], |
| 91 | + "no-restricted-syntax": ["error", "ForInStatement"], |
| 92 | + "one-var": ["error", "never"], |
| 93 | + "class-methods-use-this": "off", |
| 94 | + "no-empty-function": "off", |
| 95 | + "no-shadow": "error", |
| 96 | + "no-unused-vars": ["error", { |
| 97 | + argsIgnorePattern: "^_", |
| 98 | + }], |
| 99 | + |
| 100 | + "@stylistic/block-spacing": "off", |
| 101 | + "@stylistic/padded-blocks": "off", |
| 102 | + "@stylistic/array-element-newline": "off", |
| 103 | + "@stylistic/function-call-argument-newline": "off", |
| 104 | + "@stylistic/arrow-parens": "off", |
| 105 | + "@stylistic/multiline-comment-style": "off", |
| 106 | + "@stylistic/object-property-newline": "off", |
| 107 | + "@stylistic/function-paren-newline": "off", |
| 108 | + "@stylistic/dot-location": "off", |
| 109 | + "@stylistic/space-before-function-paren": "off", |
| 110 | + "@stylistic/multiline-ternary": "off", |
| 111 | + "@stylistic/no-extra-parens": "off", |
| 112 | + "@stylistic/lines-around-comment": "off", |
| 113 | + "@stylistic/implicit-arrow-linebreak": "off", |
| 114 | + "@stylistic/quote-props": "off", |
| 115 | + "@stylistic/indent": ["error", 4, { |
| 116 | + FunctionDeclaration: { |
| 117 | + parameters: "first", |
| 118 | + }, |
| 119 | + |
| 120 | + FunctionExpression: { |
| 121 | + parameters: "first", |
| 122 | + }, |
| 123 | + |
| 124 | + SwitchCase: 1, |
| 125 | + }], |
| 126 | + "@stylistic/quotes": ["error", "double"], |
| 127 | + |
| 128 | + "@typescript-eslint/no-invalid-void-type": "off", |
| 129 | + "@typescript-eslint/consistent-type-imports": "off", |
| 130 | + "@typescript-eslint/parameter-properties": "off", |
| 131 | + "@typescript-eslint/no-extraneous-class": "off", |
| 132 | + "@typescript-eslint/no-unsafe-type-assertion": "off", |
| 133 | + "@typescript-eslint/consistent-type-exports": "off", |
| 134 | + "@typescript-eslint/prefer-readonly-parameter-types": "off", |
| 135 | + "@typescript-eslint/class-methods-use-this": "off", |
| 136 | + "@typescript-eslint/no-unnecessary-type-parameters": "off", |
| 137 | + "@typescript-eslint/prefer-optional-chain": "off", |
| 138 | + "@typescript-eslint/max-params": "off", |
| 139 | + "@typescript-eslint/block-spacing": "off", |
| 140 | + "@typescript-eslint/lines-around-comment": "off", |
| 141 | + "@typescript-eslint/no-type-alias": "off", |
| 142 | + "@typescript-eslint/no-magic-numbers": "off", |
| 143 | + "@typescript-eslint/init-declarations": "off", |
| 144 | + "@typescript-eslint/space-before-function-paren": "off", |
| 145 | + "@typescript-eslint/no-empty-interface": "off", |
| 146 | + "@typescript-eslint/no-empty-function": "off", |
| 147 | + "@typescript-eslint/member-ordering": "off", |
| 148 | + "@typescript-eslint/method-signature-style": "off", |
| 149 | + "@typescript-eslint/no-extra-parens": "off", |
| 150 | + "@typescript-eslint/no-invalid-this": "off", |
| 151 | + "@typescript-eslint/no-unused-expressions": "off", |
| 152 | + "@typescript-eslint/typedef": "off", |
| 153 | + "@typescript-eslint/array-type": ["error", { |
| 154 | + default: "generic", |
| 155 | + }], |
| 156 | + "@typescript-eslint/explicit-member-accessibility": ["error", { |
| 157 | + accessibility: "explicit", |
| 158 | + }], |
| 159 | + "@typescript-eslint/prefer-nullish-coalescing": ["error", { |
| 160 | + ignoreMixedLogicalExpressions: false, |
| 161 | + ignoreConditionalTests: false, |
| 162 | + }], |
| 163 | + "@typescript-eslint/no-unused-vars": "off", |
| 164 | + |
| 165 | + "import/no-deprecated": "error", |
| 166 | + "import/no-empty-named-blocks": "error", |
| 167 | + "import/no-extraneous-dependencies": "off", |
| 168 | + "import/no-mutable-exports": "error", |
| 169 | + "import/no-absolute-path": "error", |
| 170 | + "import/no-useless-path-segments": "error", |
| 171 | + "import/no-self-import": "error", |
| 172 | + "import/no-restricted-paths": ["error", { |
| 173 | + zones: [{ |
| 174 | + target: "./src/api", |
| 175 | + from: "./src/impl", |
| 176 | + }], |
| 177 | + }], |
| 178 | + "import/consistent-type-specifier-style": ["error", "prefer-top-level"], |
| 179 | + "import/exports-last": "error", |
| 180 | + "import/order": ["error", { |
| 181 | + "newlines-between": "never", |
| 182 | + |
| 183 | + alphabetize: { |
| 184 | + order: "asc", |
| 185 | + caseInsensitive: true, |
| 186 | + }, |
| 187 | + |
| 188 | + groups: [ |
| 189 | + "index", |
| 190 | + "sibling", |
| 191 | + "parent", |
| 192 | + "internal", |
| 193 | + "external", |
| 194 | + "builtin", |
| 195 | + "object", |
| 196 | + "type", |
| 197 | + ], |
| 198 | + }], |
| 199 | + "import/no-unassigned-import": "error", |
| 200 | + "import/newline-after-import": "error", |
| 201 | + "import/first": "error", |
| 202 | + "import/no-unresolved": "off", |
| 203 | + "import/named": "off" |
| 204 | + } |
| 205 | + }, |
| 206 | + { |
| 207 | + files: ["projects/interacto-angular/src/**/*.spec.ts"], |
| 208 | + plugins: { |
| 209 | + }, |
| 210 | + languageOptions: { |
| 211 | + parser: tsParser, |
| 212 | + parserOptions: { |
| 213 | + sourceType: "module", |
| 214 | + project: ["projects/interacto-angular/tsconfig.spec.json"], |
| 215 | + tsconfigRootDir: import.meta.dirname, |
| 216 | + }, |
| 217 | + globals: { |
| 218 | + ...globals.node, |
| 219 | + ...globals.browser, |
| 220 | + ...globals.jasmine |
| 221 | + } |
| 222 | + }, |
| 223 | + rules: { |
| 224 | + "no-new": "off", |
| 225 | + "no-underscore-dangle": "off", |
| 226 | + "no-duplicate-imports": "off", |
| 227 | + "func-style": "off", |
| 228 | + "max-lines": "off", |
| 229 | + "prefer-destructuring": "off", |
| 230 | + "no-lonely-if": "off", |
| 231 | + "capitalized-comments": "off", |
| 232 | + "no-plusplus": "off", |
| 233 | + "no-extra-parens": "off", |
| 234 | + "dot-location": "off", |
| 235 | + "sort-keys": "off", |
| 236 | + "array-element-newline": "off", |
| 237 | + "function-paren-newline": "off", |
| 238 | + "max-params": "off", |
| 239 | + "no-ternary": "off", |
| 240 | + "multiline-ternary": "off", |
| 241 | + "max-classes-per-file": "off", |
| 242 | + "max-statements": "off", |
| 243 | + "init-declarations": "off", |
| 244 | + "keyword-spacing": "off", |
| 245 | + "space-before-function-paren": "off", |
| 246 | + "function-call-argument-newline": "off", |
| 247 | + "no-mixed-operators": "off", |
| 248 | + "lines-between-class-members": "off", |
| 249 | + "no-unused-expressions": "off", |
| 250 | + "no-undefined": "off", |
| 251 | + "padded-blocks": "off", |
| 252 | + "lines-around-comment": "off", |
| 253 | + "sort-imports": "off", |
| 254 | + "no-magic-numbers": "off", |
| 255 | + "indent": "off", |
| 256 | + "id-length": "off", |
| 257 | + "multiline-comment-style": "off", |
| 258 | + "max-lines-per-function": "off", |
| 259 | + "object-property-newline": "off", |
| 260 | + "complexity": "off", |
| 261 | + "class-methods-use-this": "off", |
| 262 | + "no-empty-function": "off", |
| 263 | + "no-unused-vars": "off", |
| 264 | + "one-var": "off", |
| 265 | + "no-array-constructor": "off", |
| 266 | + "no-throw-literal": "off", |
| 267 | + "default-param-last": "off", |
| 268 | + "require-await": "off", |
| 269 | + |
| 270 | + "@stylistic/block-spacing": "off", |
| 271 | + "@stylistic/padded-blocks": "off", |
| 272 | + "@stylistic/array-element-newline": "off", |
| 273 | + "@stylistic/function-call-argument-newline": "off", |
| 274 | + "@stylistic/arrow-parens": "off", |
| 275 | + "@stylistic/multiline-comment-style": "off", |
| 276 | + "@stylistic/object-property-newline": "off", |
| 277 | + "@stylistic/function-paren-newline": "off", |
| 278 | + "@stylistic/dot-location": "off", |
| 279 | + "@stylistic/space-before-function-paren": "off", |
| 280 | + "@stylistic/multiline-ternary": "off", |
| 281 | + "@stylistic/no-extra-parens": "off", |
| 282 | + "@stylistic/lines-around-comment": "off", |
| 283 | + "@stylistic/implicit-arrow-linebreak": "off", |
| 284 | + "@stylistic/quote-props": "off", |
| 285 | + "@stylistic/indent": ["error", 4, { |
| 286 | + FunctionDeclaration: { |
| 287 | + parameters: "first", |
| 288 | + }, |
| 289 | + |
| 290 | + FunctionExpression: { |
| 291 | + parameters: "first", |
| 292 | + }, |
| 293 | + |
| 294 | + SwitchCase: 1, |
| 295 | + }], |
| 296 | + |
| 297 | + "@typescript-eslint/no-unsafe-argument": "off", |
| 298 | + "@typescript-eslint/no-unsafe-type-assertion": "off", |
| 299 | + "@typescript-eslint/only-throw-error": "off", |
| 300 | + "@typescript-eslint/prefer-destructuring": "off", |
| 301 | + "@typescript-eslint/unbound-method": "off", |
| 302 | + "@typescript-eslint/no-unsafe-member-access": "off", |
| 303 | + "@typescript-eslint/no-unsafe-call": "off", |
| 304 | + "@typescript-eslint/non-nullable-type-assertion-style": "off", |
| 305 | + "@typescript-eslint/no-confusing-void-expression": "off", |
| 306 | + "@typescript-eslint/await-thenable": "off", |
| 307 | + "@typescript-eslint/consistent-type-exports": "off", |
| 308 | + "@typescript-eslint/prefer-readonly-parameter-types": "off", |
| 309 | + "@typescript-eslint/class-methods-use-this": "off", |
| 310 | + "@typescript-eslint/no-unnecessary-type-parameters": "off", |
| 311 | + "@typescript-eslint/prefer-optional-chain": "off", |
| 312 | + "@typescript-eslint/max-params": "off", |
| 313 | + "@typescript-eslint/block-spacing": "off", |
| 314 | + "@typescript-eslint/lines-around-comment": "off", |
| 315 | + "@typescript-eslint/no-type-alias": "off", |
| 316 | + "@typescript-eslint/no-magic-numbers": "off", |
| 317 | + "@typescript-eslint/init-declarations": "off", |
| 318 | + "@typescript-eslint/space-before-function-paren": "off", |
| 319 | + "@typescript-eslint/no-empty-interface": "off", |
| 320 | + "@typescript-eslint/no-empty-function": "off", |
| 321 | + "@typescript-eslint/member-ordering": "off", |
| 322 | + "@typescript-eslint/method-signature-style": "off", |
| 323 | + "@typescript-eslint/no-extra-parens": "off", |
| 324 | + "@typescript-eslint/no-invalid-this": "off", |
| 325 | + "@typescript-eslint/no-unused-expressions": "off", |
| 326 | + "@typescript-eslint/typedef": "off", |
| 327 | + "@typescript-eslint/array-type": ["error", { |
| 328 | + default: "generic", |
| 329 | + }], |
| 330 | + "@typescript-eslint/no-unused-vars": ["error", { |
| 331 | + argsIgnorePattern: "^_", |
| 332 | + }], |
| 333 | + "@typescript-eslint/restrict-template-expressions": "off" |
| 334 | + } |
| 335 | + } |
| 336 | +] |
0 commit comments