Update to eslint 10 (#36925)

- Enable a few more rules, fix issues. The 2 `value` issues are
false-positives.
- Add exact types for `window.pageData` and
`window.notificationSettings`.
- peerDependencyRules for eslint-plugin-github unrestricted, the plugin
works in v10, but does not declare compatibility, pending
https://github.com/github/eslint-plugin-github/issues/680.
- Added
[eslint-plugin-de-morgan](https://github.com/azat-io/eslint-plugin-de-morgan),
no violations.

---------

Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
silverwind
2026-03-23 08:49:25 +01:00
committed by GitHub
parent 4ba90207cf
commit ae0bc0222a
16 changed files with 494 additions and 261 deletions

View File

@@ -112,8 +112,8 @@ export function blobToDataURI(blob: Blob): Promise<string> {
reject(new Error('blobToDataURI: FileReader error'));
});
reader.readAsDataURL(blob);
} catch (err) {
reject(err);
} catch (err: unknown) {
reject(err instanceof Error ? err : new Error(String(err)));
}
});
}
@@ -135,16 +135,16 @@ export function convertImage(blob: Blob, mime: string): Promise<Blob> {
if (!(blob instanceof Blob)) return reject(new Error('convertImage: toBlob failed'));
resolve(blob);
}, mime);
} catch (err) {
reject(err);
} catch (err: unknown) {
reject(err instanceof Error ? err : new Error(String(err)));
}
});
img.addEventListener('error', () => {
reject(new Error('convertImage: image failed to load'));
});
img.src = await blobToDataURI(blob);
} catch (err) {
reject(err);
} catch (err: unknown) {
reject(err instanceof Error ? err : new Error(String(err)));
}
});
}