build: migrate eslint to v10 flat config and upgrade typescript
Replace .eslintrc.json with eslint.config.js using the new flat config format required by ESLint 10. Swap @typescript-eslint/eslint-plugin and @typescript-eslint/parser for the unified typescript-eslint package. Upgrade TypeScript to 5.9 and @types/node to 25. Apply automatic code fixes: remove unused catch bindings and preserve error cause in auth header parsing.
This commit is contained in:
1 parent
4a191afdec
commit
75908e624f
27 files changed
+1146
-1595
No files matched your search
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": false
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,9 @@ export default class Autocomplete {
|
||||
if (!this.visible) {
|
||||
if (!this.hideTimeout) {
|
||||
document.body.appendChild(this.container);
|
||||
window.getComputedStyle(this.container).opacity;
|
||||
// Force style recalc so the initial opacity is resolved before
|
||||
// setting it to "1", allowing the CSS transition to play.
|
||||
void window.getComputedStyle(this.container).opacity;
|
||||
} else {
|
||||
clearTimeout(this.hideTimeout);
|
||||
this.hideTimeout = null;
|
||||
|
||||
@@ -47,7 +47,7 @@ const component: ClosureComponent = (vn): Component => {
|
||||
try {
|
||||
const url = new URL(param.value[0]);
|
||||
h = url.hostname;
|
||||
} catch (err) {
|
||||
} catch {
|
||||
// Ignore
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ function putActionHandler(action, _object, isNew?): Promise<ValidationErrors> {
|
||||
|
||||
try {
|
||||
object.value = stringify(parse(object.value || ""));
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return void resolve({
|
||||
value: "Config value must be valid expression",
|
||||
});
|
||||
|
||||
@@ -83,7 +83,7 @@ const component: ClosureComponent<Attrs> = (initialVnode) => {
|
||||
const list = filterList.map((f, idx) => {
|
||||
try {
|
||||
return parseFilter(attrs.resource, f);
|
||||
} catch (err) {
|
||||
} catch {
|
||||
filterInvalid |= 1 << idx;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -90,7 +90,7 @@ function putActionHandler(action, _object, isNew): Promise<ValidationErrors> {
|
||||
if (object.filter) {
|
||||
try {
|
||||
object.filter = stringify(memoizedParse(object.filter));
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return void resolve({
|
||||
filter: "Filter must be valid expression",
|
||||
});
|
||||
@@ -100,7 +100,7 @@ function putActionHandler(action, _object, isNew): Promise<ValidationErrors> {
|
||||
if (object.validate) {
|
||||
try {
|
||||
object.validate = stringify(memoizedParse(object.validate));
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return void resolve({
|
||||
validate: "Validate must be valid expression",
|
||||
});
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ function putActionHandler(action, _object, isNew): Promise<ValidationErrors> {
|
||||
if (object.precondition) {
|
||||
try {
|
||||
object.precondition = stringify(memoizedParse(object.precondition));
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return void resolve({
|
||||
precondition: "Precondition must be valid expression",
|
||||
});
|
||||
|
||||
+4
-2
@@ -113,7 +113,7 @@ function checkConnection(): void {
|
||||
setTimestamp(now2);
|
||||
m.redraw();
|
||||
}
|
||||
} catch (err) {
|
||||
} catch {
|
||||
// Ignore in case of missing or invalid Date header
|
||||
}
|
||||
|
||||
@@ -200,7 +200,9 @@ export async function xhrRequest(
|
||||
try {
|
||||
response = xhr.responseText ? JSON.parse(xhr.responseText) : null;
|
||||
} catch (err) {
|
||||
throw new Error("Invalid JSON: " + xhr.responseText.slice(0, 80));
|
||||
throw new Error("Invalid JSON: " + xhr.responseText.slice(0, 80), {
|
||||
cause: err,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
response = xhr.responseText;
|
||||
|
||||
Reference in new issue
Block a user