|
4 | 4 | { |
5 | 5 | "files": ["*.ts"], |
6 | 6 | "parserOptions": { |
7 | | - "project": ["tsconfig.json"], |
| 7 | + "project": true, |
8 | 8 | "createDefaultProgram": true |
9 | 9 | }, |
10 | 10 | "extends": [ |
11 | 11 | "eslint:recommended", |
12 | | - "plugin:@typescript-eslint/recommended", |
13 | | - "plugin:@angular-eslint/recommended", |
| 12 | + "plugin:@typescript-eslint/strict-type-checked", |
| 13 | + "plugin:@typescript-eslint/stylistic-type-checked", |
| 14 | + "plugin:@angular-eslint/all", |
14 | 15 | "plugin:@angular-eslint/template/process-inline-templates" |
15 | 16 | ], |
16 | 17 | "rules": { |
| 18 | + "@angular-eslint/component-max-inline-declarations": "off", // We use that mostly for testing, so it's fine |
| 19 | + "@angular-eslint/no-forward-ref": "off", // We sometimes need it |
| 20 | + "@angular-eslint/prefer-on-push-component-change-detection": "off", |
| 21 | + "@angular-eslint/use-component-selector": "off", // Some components are not template-able and thus do not need selector |
| 22 | + "@typescript-eslint/consistent-type-definitions": ["error", "type"], |
| 23 | + "@typescript-eslint/explicit-member-accessibility": "error", |
| 24 | + "@typescript-eslint/no-confusing-void-expression": "off", // We prefer code tersity |
| 25 | + "@typescript-eslint/no-dynamic-delete": "off", |
| 26 | + "@typescript-eslint/no-explicit-any": "off", |
| 27 | + "@typescript-eslint/no-extraneous-class": "off", // We have component without any logic in TS |
| 28 | + "@typescript-eslint/no-floating-promises": "off", |
| 29 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 30 | + "@typescript-eslint/no-unnecessary-condition": "off", // This is very unfortunate, but there are too many dangerous false-positive, see https://github.com/typescript-eslint/typescript-eslint/issues/1798 |
| 31 | + "@typescript-eslint/no-unsafe-argument": "off", |
| 32 | + "@typescript-eslint/no-unsafe-assignment": "off", |
| 33 | + "@typescript-eslint/no-unsafe-call": "off", |
| 34 | + "@typescript-eslint/no-unsafe-member-access": "off", |
| 35 | + "@typescript-eslint/no-unsafe-return": "off", |
| 36 | + "@typescript-eslint/prefer-nullish-coalescing": "off", // Usually a good idea, but sometimes dangerous false-positive |
| 37 | + "@typescript-eslint/unbound-method": "off", |
17 | 38 | "@angular-eslint/directive-selector": [ |
18 | 39 | "error", |
19 | 40 | { |
|
30 | 51 | "style": "kebab-case" |
31 | 52 | } |
32 | 53 | ], |
33 | | - "@typescript-eslint/ban-types": "error", |
34 | 54 | "@typescript-eslint/explicit-function-return-type": [ |
35 | 55 | "error", |
36 | 56 | { |
37 | 57 | "allowExpressions": true |
38 | 58 | } |
39 | 59 | ], |
40 | | - "@typescript-eslint/explicit-member-accessibility": "error", |
41 | 60 | "@typescript-eslint/explicit-module-boundary-types": [ |
42 | 61 | "error", |
43 | 62 | { |
44 | 63 | "allowArgumentsExplicitlyTypedAsAny": true |
45 | 64 | } |
46 | 65 | ], |
47 | | - "@typescript-eslint/prefer-for-of": "error", |
| 66 | + "@typescript-eslint/no-misused-promises": [ |
| 67 | + "error", |
| 68 | + { |
| 69 | + "checksVoidReturn": { |
| 70 | + // We want to use promise in Rxjs subscribes without caring about the promise result |
| 71 | + "arguments": false, |
| 72 | + "properties": false |
| 73 | + } |
| 74 | + } |
| 75 | + ], |
48 | 76 | "no-restricted-globals": [ |
49 | 77 | "error", |
50 | 78 | "atob", |
|
64 | 92 | }, |
65 | 93 | { |
66 | 94 | "files": ["*.html"], |
67 | | - "extends": ["plugin:@angular-eslint/template/recommended"], |
68 | | - "rules": {} |
| 95 | + "extends": ["plugin:@angular-eslint/template/all"], |
| 96 | + "rules": { |
| 97 | + "@angular-eslint/template/alt-text": "off", // We don't care as much as we should about a11y |
| 98 | + "@angular-eslint/template/attributes-order": "off", // TODO: We want to enable this, but autofix mess up our code, and it's too much manual changes |
| 99 | + "@angular-eslint/template/button-has-type": "off", |
| 100 | + "@angular-eslint/template/click-events-have-key-events": "off", // We don't care as much as we should about a11y |
| 101 | + "@angular-eslint/template/i18n": "off", |
| 102 | + "@angular-eslint/template/interactive-supports-focus": "off", // We don't care as much as we should about a11y |
| 103 | + "@angular-eslint/template/label-has-associated-control": "off", // We don't care as much as we should about a11y |
| 104 | + "@angular-eslint/template/no-any": "off", // Unfortunately, some libs force us to use this |
| 105 | + "@angular-eslint/template/no-autofocus": "off", |
| 106 | + "@angular-eslint/template/no-call-expression": "off", |
| 107 | + "@angular-eslint/template/no-inline-styles": "off", // We sometimes use short inlie styles |
| 108 | + "@angular-eslint/template/prefer-ngsrc": "off", // TODO: experiment with ngsrc and see if we need to use it or not |
| 109 | + "@angular-eslint/template/eqeqeq": [ |
| 110 | + "error", |
| 111 | + { |
| 112 | + "allowNullOrUndefined": true |
| 113 | + } |
| 114 | + ] |
| 115 | + } |
69 | 116 | } |
70 | 117 | ] |
71 | 118 | } |
0 commit comments