|
1 | 1 | extends:
|
2 |
| - - 'plugin:@typescript-eslint/strict' |
3 |
| - # - 'plugin:@shopify/typescript' |
| 2 | + - 'plugin:@typescript-eslint/strict-type-checked' |
| 3 | + - 'plugin:@typescript-eslint/stylistic-type-checked' |
4 | 4 | - 'plugin:import/typescript'
|
5 | 5 |
|
6 | 6 | parserOptions:
|
7 | 7 | project: true
|
8 |
| - |
9 | 8 | rules:
|
| 9 | + # allow specifying a type that could be inferred |
10 | 10 | '@typescript-eslint/no-inferrable-types': 'off'
|
| 11 | + |
| 12 | + # prevent unused vars |
11 | 13 | '@typescript-eslint/no-unused-vars':
|
12 | 14 | ['warn', { args: 'none', destructuredArrayIgnorePattern: '^_' }]
|
13 |
| - '@typescript-eslint/naming-convention': 'off' |
14 |
| - '@shopify/binary-assignment-parens': 'off' |
| 15 | + |
| 16 | + # ensure only boolean types are used for conditions |
| 17 | + '@typescript-eslint/strict-boolean-expressions': |
| 18 | + - 'error' |
| 19 | + - allowString: false |
| 20 | + allowNumber: false |
| 21 | + allowNullableObject: false |
| 22 | + |
| 23 | + # ensure switches on union types handle all cases |
| 24 | + '@typescript-eslint/switch-exhaustiveness-check': 'error' |
| 25 | + |
| 26 | + # ensure any constant numbers are properly named to increase readability |
| 27 | + '@typescript-eslint/no-magic-numbers': |
| 28 | + - 'error' |
| 29 | + - enforceConst: true |
| 30 | + ignoreArrayIndexes: true |
| 31 | + ignoreDefaultValues: true |
| 32 | + ignoreClassFieldInitialValues: true |
| 33 | + |
| 34 | + ignoreEnums: true |
| 35 | + ignoreNumericLiteralTypes: true |
| 36 | + ignoreReadonlyClassProperties: true |
| 37 | + ignoreTypeIndexes: true |
| 38 | + no-magic-numbers: 'off' |
| 39 | + |
| 40 | + # TODO: do we want this? |
| 41 | + # require enum values to be initialized in order to prevent value shifting |
| 42 | + '@typescript-eslint/prefer-enum-initializers': 'error' |
| 43 | + |
| 44 | + # allow use of both `type` and `interface` |
| 45 | + '@typescript-eslint/consistent-type-definitions': 'off' |
| 46 | + |
| 47 | + # ensure private members are marked readonly when possible |
| 48 | + '@typescript-eslint/prefer-readonly': 'error' |
| 49 | + |
| 50 | + # allow `indexOf()` |
| 51 | + '@typescript-eslint/prefer-includes': 'off' |
| 52 | + |
| 53 | + # typescript handles these rules for us |
| 54 | + consistent-return: 'off' |
| 55 | + no-invalid-this: 'off' |
0 commit comments