Fix lint errors (except @typescript-eslint/prefer-nullish-coalescing) (#9311)
* `yarn workspace client run lint --fix` * `eslint-disable-next-line no-var` for service worker self * A few more manual sw fixes * word change
This commit is contained in:
parent
bae7939d79
commit
8211893210
15 changed files with 25 additions and 21 deletions
|
|
@ -54,7 +54,7 @@ export const toThemeString = (value: Color | Func | RefProp | RefConst | Css) =>
|
|||
|
||||
export const convertToMisskeyTheme = (vm: ThemeViewModel, name: string, desc: string, author: string, base: 'dark' | 'light'): Theme => {
|
||||
const props = { } as { [key: string]: string };
|
||||
for (const [ key, value ] of vm) {
|
||||
for (const [key, value] of vm) {
|
||||
if (value === null) continue;
|
||||
props[key] = toThemeString(value);
|
||||
}
|
||||
|
|
@ -68,13 +68,13 @@ export const convertToMisskeyTheme = (vm: ThemeViewModel, name: string, desc: st
|
|||
export const convertToViewModel = (theme: Theme): ThemeViewModel => {
|
||||
const vm: ThemeViewModel = [];
|
||||
// プロパティの登録
|
||||
vm.push(...themeProps.map(key => [ key, fromThemeString(theme.props[key])] as [ string, ThemeValue ]));
|
||||
vm.push(...themeProps.map(key => [key, fromThemeString(theme.props[key])] as [ string, ThemeValue ]));
|
||||
|
||||
// 定数の登録
|
||||
const consts = Object
|
||||
.keys(theme.props)
|
||||
.filter(k => k.startsWith('$'))
|
||||
.map(k => [ k, fromThemeString(theme.props[k]) ] as [ string, ThemeValue ]);
|
||||
.map(k => [k, fromThemeString(theme.props[k])] as [ string, ThemeValue ]);
|
||||
|
||||
vm.push(...consts);
|
||||
return vm;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue