forked from getodk/web-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to address changes in ESLint etc
- TEMPORARY: warn on `throw` with non-object value. I know we recently decided not to leave warnings unaddressed, but we will likely address the affected cases in upcoming work on form load error conditions (in context of external secondary instances) - Flat config is no longer experimental in VSCode - FlatCompat is evidently no longer necessary for Vue language support (and we drop @eslint/eslintrc as a direct dependency, since FlatCompat was all we used it for) - Address a few changes in typescript-eslint specifically: - Some rules have been split up. To the extent I’m aware of and understand these changes, any affected overrides are updated to match current behavior (or as close as possible). - Some rules have gotten more strict. The one which stands out the most is detection of unused variables. Previously, no error was produced if a type is derived from variables with no runtime use. This is no longer the case. One case is ignored, and the reasoning for it is already explained in a JSDoc block. One case that may not be obvious is replacing a `ui-solid` derived component type with Solid’s provided `Component` type which is specifically intended for the use case. (The usage is a bit odd, it’s overriding the props type of a styled component from the SUID component library.) The remaining cases are calls to initialize Vitest assertion extensions. These calls cause global side effects, assigning custom assertion methods on the `expect()` result object. We then derive the types from those calls’ return values, and assign them to the corresponding types for the same extended `expect()` result object. I’ve chosen to export these cases (as that treats them as used), but could consider explicitly ignoring them instead. I think this pattern is probably more flexible for the future (i.e. if we want to put some effort into converting our assertion extensions into something less global side-effect-y). - A new rule which seems sensible: it’s recommended to use `RegExp#exec` rather than `String#match` for regular expressions without the global (`g`) flag. - As noted in a few override comments: a very sensible error is now produced for statements which don’t appear to do anything. We override this in cases where we have known logic triggering reactive subscriptions by reading a reactive getter property. One other affected case that may not be obvious: a pair of assertions in an `xpath` test were mistakenly separated by commas. This behaved correctly, but would be misleading in terms of intent if left as-is. I am almost certain it was a typo, introduced while rapidly porting tests from openrosa-xpath-evaluator to our then-new XPath implementation. - tseslint improves detecting usage patterns that might break `this` binding for object methods (e.g. by destructuring or otherwise taking a direct reference to them). We largely accommodate this by converting newly caught cases to arrow functions. In some cases, we also convert the type definition for such methods to arrow function properties.
- Loading branch information
1 parent
69e5263
commit bf9f8c3
Showing
27 changed files
with
67 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.