chore: fix some lints automatically (#8788)
* chore: fix some lints automatically Fixed lints that were automatically fixable with `eslint --fix`. * fix type * workaround for empty interface lint
This commit is contained in:
@@ -13,7 +13,7 @@ const defaultLocaleStringFormats: {[index: string]: string} = {
|
||||
function formatLocaleString(date: Date, format: string): string {
|
||||
return format.replace(/\{\{(\w+)(:(\w+))?\}\}/g, (match: string, kind: string, unused?, option?: string) => {
|
||||
if (['weekday', 'era', 'year', 'month', 'day', 'hour', 'minute', 'second', 'timeZoneName'].includes(kind)) {
|
||||
return date.toLocaleString(window.navigator.language, {[kind]: option ? option : defaultLocaleStringFormats[kind]});
|
||||
return date.toLocaleString(window.navigator.language, { [kind]: option ? option : defaultLocaleStringFormats[kind] });
|
||||
} else {
|
||||
return match;
|
||||
}
|
||||
@@ -24,8 +24,8 @@ export function formatDateTimeString(date: Date, format: string): string {
|
||||
return format
|
||||
.replace(/yyyy/g, date.getFullYear().toString())
|
||||
.replace(/yy/g, date.getFullYear().toString().slice(-2))
|
||||
.replace(/MMMM/g, date.toLocaleString(window.navigator.language, { month: 'long'}))
|
||||
.replace(/MMM/g, date.toLocaleString(window.navigator.language, { month: 'short'}))
|
||||
.replace(/MMMM/g, date.toLocaleString(window.navigator.language, { month: 'long' }))
|
||||
.replace(/MMM/g, date.toLocaleString(window.navigator.language, { month: 'short' }))
|
||||
.replace(/MM/g, (`0${date.getMonth() + 1}`).slice(-2))
|
||||
.replace(/M/g, (date.getMonth() + 1).toString())
|
||||
.replace(/dd/g, (`0${date.getDate()}`).slice(-2))
|
||||
|
@@ -22,7 +22,7 @@ export function getNoteMenu(props: {
|
||||
props.note.poll == null
|
||||
);
|
||||
|
||||
let appearNote = isRenote ? props.note.renote as misskey.entities.Note : props.note;
|
||||
const appearNote = isRenote ? props.note.renote as misskey.entities.Note : props.note;
|
||||
|
||||
function del(): void {
|
||||
os.confirm({
|
||||
|
@@ -148,7 +148,7 @@ export function getUserMenu(user) {
|
||||
userId: user.id
|
||||
}).then(() => {
|
||||
user.isFollowed = !user.isFollowed;
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
let menu = [{
|
||||
|
@@ -36,7 +36,7 @@ export class Hpml {
|
||||
if (this.opts.enableAiScript) {
|
||||
this.aiscript = markRaw(new AiScript({ ...createAiScriptEnv({
|
||||
storageKey: 'pages:' + this.page.id
|
||||
}), ...initAiLib(this)}, {
|
||||
}), ...initAiLib(this) }, {
|
||||
in: (q) => {
|
||||
return new Promise(ok => {
|
||||
os.inputText({
|
||||
|
@@ -41,9 +41,9 @@ export function physics(container: HTMLElement) {
|
||||
|
||||
const groundThickness = 1024;
|
||||
const ground = Matter.Bodies.rectangle(containerCenterX, containerHeight + (groundThickness / 2), containerWidth, groundThickness, {
|
||||
isStatic: true,
|
||||
restitution: 0.1,
|
||||
friction: 2
|
||||
isStatic: true,
|
||||
restitution: 0.1,
|
||||
friction: 2
|
||||
});
|
||||
|
||||
//const wallRight = Matter.Bodies.rectangle(window.innerWidth+50, window.innerHeight/2, 100, window.innerHeight, wallopts);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { v4 as uuid} from 'uuid';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
import { themeProps, Theme } from './theme';
|
||||
|
||||
|
@@ -42,7 +42,7 @@ export const getBuiltinThemesRef = () => {
|
||||
const builtinThemes = ref<Theme[]>([]);
|
||||
getBuiltinThemes().then(themes => builtinThemes.value = themes);
|
||||
return builtinThemes;
|
||||
}
|
||||
};
|
||||
|
||||
let timeout = null;
|
||||
|
||||
|
Reference in New Issue
Block a user