mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
eslint: enable extra rules
no-implicit-coercion, no-extra-boolean-cast, no-invalid-this, logical-assignment-operators, no-unmodified-loop-condition
This commit is contained in:
1 parent
5ac9d930b2
commit
7f51df236a
34 files changed
+100
-96
No files matched your search
@@ -11,7 +11,7 @@ export const providers: Record<string, AvatarProvider> = {
|
||||
};
|
||||
|
||||
function avatar(src: string, size = 64, fallback = '') {
|
||||
src = src || fallback;
|
||||
src ||= fallback;
|
||||
let index = src.indexOf(':');
|
||||
if (index === -1) src = fallback;
|
||||
index = src.indexOf(':');
|
||||
|
||||
@@ -19,7 +19,7 @@ class I18nService extends Service {
|
||||
}
|
||||
|
||||
load(lang: string, content: Record<string, string>) {
|
||||
if (!translations[lang]) translations[lang] = [];
|
||||
translations[lang] ||= [];
|
||||
translations[lang].unshift(content);
|
||||
this.caller?.on('dispose', () => {
|
||||
translations[lang] = translations[lang].filter((i) => i !== content);
|
||||
|
||||
@@ -26,7 +26,7 @@ const buildChecker = (...permPrivChecker: PermPrivChecker) => {
|
||||
|
||||
export const nodes = new Proxy({}, {
|
||||
get(self, key) {
|
||||
if (!self[key]) self[key] = [];
|
||||
self[key] ||= [];
|
||||
return self[key];
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user