Change ESLint rules, lint

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2023-02-15 22:26:27 +01:00
parent dec2cc69e8
commit 81de0014d3
337 changed files with 1301 additions and 1284 deletions

View File

@@ -5,7 +5,7 @@ import { queryClient } from 'soapbox/queries/client';
import { PaginatedResult, sortQueryData, updatePageItem } from '../queries';
interface Item {
id: number,
id: number
text: string
}

View File

@@ -11,9 +11,9 @@ const badgeToTag = (badge: string) => badge.replace(/^badge:/, '');
/** Difference between an old and new set of tags. */
interface TagDiff {
/** New tags that were added. */
added: string[],
added: string[]
/** Old tags that were removed. */
removed: string[],
removed: string[]
}
/** Returns the differences between two sets of tags. */

View File

@@ -10,7 +10,7 @@ import { compareDate } from './comparators';
import { appendPageItem, flattenPages, PaginatedResult, sortQueryData, updatePageItem } from './queries';
interface ChatPayload extends Omit<Chat, 'last_message'> {
last_message: ChatMessage | null,
last_message: ChatMessage | null
}
/**

View File

@@ -98,7 +98,7 @@ export default function(baseColor: string): TailwindColorObject {
};
const intensityMap: {
[key: number]: number;
[key: number]: number
} = {
50: 0.95,
100: 0.9,

View File

@@ -2,10 +2,10 @@
// https://git.pleroma.social/pleroma/pleroma-fe/-/blob/ef5bbc4e5f84bb9e8da76a0440eea5d656d36977/src/services/favicon_service/favicon_service.js
type Favicon = {
favcanvas: HTMLCanvasElement,
favimg: HTMLImageElement,
favcontext: CanvasRenderingContext2D | null,
favicon: HTMLLinkElement,
favcanvas: HTMLCanvasElement
favimg: HTMLImageElement
favcontext: CanvasRenderingContext2D | null
favicon: HTMLLinkElement
};
/** Service to draw and update a notifications dot on the favicon */

View File

@@ -862,13 +862,13 @@ export const getFeatures = createSelector([
/** Fediverse backend */
interface Backend {
/** Build name, if this software is a fork */
build: string | null,
build: string | null
/** Name of the software */
software: string | null,
software: string | null
/** API version number */
version: string,
version: string
/** Mastodon API version this backend is compatible with */
compatVersion: string,
compatVersion: string
}
/** Get information about the software from its version string */

View File

@@ -3,13 +3,13 @@ import { queryClient } from 'soapbox/queries/client';
import type { InfiniteData, QueryKey } from '@tanstack/react-query';
export interface PaginatedResult<T> {
result: T[],
hasMore: boolean,
link?: string,
result: T[]
hasMore: boolean
link?: string
}
interface Entity {
id: string,
id: string
}
const isEntity = <T = unknown>(object: T): object is T & Entity => {

View File

@@ -2,8 +2,8 @@
const DEFAULT_MAX_PIXELS = 1920 * 1080;
interface BrowserCanvasQuirks {
'image-orientation-automatic'?: boolean,
'canvas-read-unreliable'?: boolean,
'image-orientation-automatic'?: boolean
'canvas-read-unreliable'?: boolean
}
const _browser_quirks: BrowserCanvasQuirks = {};
@@ -146,11 +146,11 @@ const processImage = (
type = 'image/png',
name = 'resized.png',
} : {
width: number,
height: number,
orientation: number,
type?: string,
name?: string,
width: number
height: number
orientation: number
type?: string
name?: string
},
) => new Promise<File>((resolve, reject) => {
const canvas = document.createElement('canvas');

View File

@@ -1,7 +1,7 @@
/** Soapbox audio clip. */
type Sound = {
src: string,
type: string,
src: string
type: string
}
export type Sounds = 'boop' | 'chat'

View File

@@ -68,9 +68,9 @@ export const textForScreenReader = (intl: IntlShape, status: StatusEntity, reblo
/** Get reblogged status if any, otherwise return the original status. */
// @ts-ignore The type seems right, but TS doesn't like it.
export const getActualStatus: {
(status: StatusEntity): StatusEntity,
(status: undefined): undefined,
(status: null): null,
(status: StatusEntity): StatusEntity
(status: undefined): undefined
(status: null): null
} = (status) => {
if (status?.reblog && typeof status?.reblog === 'object') {
return status.reblog as StatusEntity;