Shoko-WebUI
Shoko-WebUI copied to clipboard
Possible eslint rules to consider adding (living document)
-
[x] Extend
plugin:@typescript-eslint/recommended
- Causes 3 rule failures in current codebase
- @typescript-eslint/no-explicit-any -> Self explanatory
-
@typescript-eslint/ban-types -> Prevents usage of
Function
,() => {}
as type, recommends usage ofRecord
- @typescript-eslint/no-non-null-asserted-optional-chain -> Need to turn this off, it's stupid.
-
[x] @typescript-eslint/array-type -> Force usage of either
Array<T>
orT[]
-
[x] @typescript-eslint/consistent-type-definitions -> Force usage of
Type
overInterface
-
[x] Extend plugin:@typescript-eslint/stylistic-type-checked -> More "styling" rules. eg., Prefer
Record
over[key: T]: T
, prefer??
over||
, etc. Also includes@typescript-eslint/array-type
which we have added before
For no-explicit-any rtkq lazy queries need to be typed better somehow I didn't spend time to figure it out so I put any in there.
Which one do we want for @typescript-eslint/array-type ?
I would prefer T[]
since that is consistent across languages.
How well does it work with complex types? Or should we then convert all rtkq request/response types into actual type declarations instead of being inline?
Things like this seem to still work
wait... This is not supposed to be closed. That's why it says "living document". We can add more rules to this same issue if required
@hidden4003 Check if we should extend this also. For more consistency
plugin:@typescript-eslint/stylistic-type-checked -> More "styling" rules. eg., Prefer Record
over [key: T]: T
, prefer ??
over ||
, etc. Also includes @typescript-eslint/array-type
which we have added before