## Overview Adds a bunch of ESLint rules, mostly from `typescript-eslint`, and fixes the issues turning on these rules raises. Also updates Typescript & typescript-eslint. ## Rationale Most of these new rules are auto-fixable, so I've tackled a bunch of the little fixes that do need manual intervention now with the intention that this shouldn't add much of any additional friction in future development work, and also give us a good bump in overall code quality. A lot of the rules here are also great for catching potential bugs! ## Changes - Adds `void` to most un-awaited and unhandled promises (i.e. places where async functions are called but nothing is done with the promise) - Converts properties that are only ever read to `readonly` - Adds a new `isApiError` function that informs Typescript of when an error is an `APIError` - Adds types to a bunch of places that were previously untyped - Changes instances of `Map<string, any>` in lit property update methods to `PropertyValues<this>`, or sometimes `PropertyValues<this> & Map<string, unknown>` where private or protected members are used (`keyof` doesn't include private and protected members, unfortunately) - Adds types to a bunch of custom events - Cleans up a regex by removing unnecessary escape characters - Makes a number of implied type conversions explicit (by wrapping with `Boolean(...)` or calling `.toString()`) - More consistently applies type coercions when necessary, and removes them when unnecessary - Converts a couple const strings to an enum - Removes the need to type debounced functions as `any` by doing type coercions to the underlying function type at where the method is bound to the event in the `html` block
12 lines
248 B
JSON
12 lines
248 B
JSON
{
|
|
"recommendations": [
|
|
"dbaeumer.vscode-eslint",
|
|
"esbenp.prettier-vscode",
|
|
"dbaeumer.vscode-eslint",
|
|
"runem.lit-plugin",
|
|
"bradlc.vscode-tailwindcss",
|
|
"redhat.vscode-yaml",
|
|
"streetsidesoftware.code-spell-checker"
|
|
]
|
|
}
|