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 { useAppSelector } from 'soapbox/hooks';
import { makeGetAccount } from 'soapbox/selectors';
interface IAutosuggestAccount {
id: string,
id: string
}
const AutosuggestAccount: React.FC<IAutosuggestAccount> = ({ id }) => {

View File

@@ -4,11 +4,11 @@ import React from 'react';
import { IconButton } from 'soapbox/components/ui';
interface IComposeFormButton {
icon: string,
title?: string,
active?: boolean,
disabled?: boolean,
onClick: () => void,
icon: string
title?: string
active?: boolean
disabled?: boolean
onClick: () => void
}
const ComposeFormButton: React.FC<IComposeFormButton> = ({

View File

@@ -57,12 +57,12 @@ const messages = defineMessages({
});
interface IComposeForm<ID extends string> {
id: ID extends 'default' ? never : ID,
shouldCondense?: boolean,
autoFocus?: boolean,
clickableAreaRef?: React.RefObject<HTMLDivElement>,
event?: string,
group?: string,
id: ID extends 'default' ? never : ID
shouldCondense?: boolean
autoFocus?: boolean
clickableAreaRef?: React.RefObject<HTMLDivElement>
event?: string
group?: string
}
const ComposeForm = <ID extends string>({ id, shouldCondense, autoFocus, clickableAreaRef, event, group }: IComposeForm<ID>) => {

View File

@@ -92,8 +92,8 @@ const messages = defineMessages({
});
interface IEmojiPickerDropdown {
onPickEmoji: (data: EmojiType) => void,
button?: JSX.Element,
onPickEmoji: (data: EmojiType) => void
button?: JSX.Element
}
const EmojiPickerDropdown: React.FC<IEmojiPickerDropdown> = ({ onPickEmoji, button }) => {

View File

@@ -32,14 +32,14 @@ const messages = defineMessages({
});
interface IEmojiPickerMenu {
customEmojis: ImmutableList<ImmutableMap<string, string>>,
loading?: boolean,
onClose: () => void,
onPick: (emoji: Emoji) => void,
onSkinTone: (skinTone: number) => void,
skinTone?: number,
frequentlyUsedEmojis?: Array<string>,
style?: React.CSSProperties,
customEmojis: ImmutableList<ImmutableMap<string, string>>
loading?: boolean
onClose: () => void
onPick: (emoji: Emoji) => void
onSkinTone: (skinTone: number) => void
skinTone?: number
frequentlyUsedEmojis?: Array<string>
style?: React.CSSProperties
}
const EmojiPickerMenu: React.FC<IEmojiPickerMenu> = ({

View File

@@ -7,9 +7,9 @@ const listenerOptions = supportsPassiveEvents ? { passive: true } : false;
const backgroundImageFn = () => require('emoji-datasource/img/twitter/sheets/32.png');
interface IModifierPickerMenu {
active: boolean,
onSelect: (modifier: number) => void,
onClose: () => void,
active: boolean
onSelect: (modifier: number) => void
onClose: () => void
}
const ModifierPickerMenu: React.FC<IModifierPickerMenu> = ({ active, onSelect, onClose }) => {

View File

@@ -6,11 +6,11 @@ import ModifierPickerMenu from './modifier-picker-menu';
const backgroundImageFn = () => require('emoji-datasource/img/twitter/sheets/32.png');
interface IModifierPicker {
active: boolean,
modifier?: number,
onOpen: () => void,
onClose: () => void,
onChange: (skinTone: number) => void,
active: boolean
modifier?: number
onOpen: () => void
onClose: () => void
onChange: (skinTone: number) => void
}
const ModifierPicker: React.FC<IModifierPicker> = ({ active, modifier, onOpen, onClose, onChange }) => {

View File

@@ -12,7 +12,7 @@ const messages = defineMessages({
});
interface IMarkdownButton {
composeId: string,
composeId: string
}
const MarkdownButton: React.FC<IMarkdownButton> = ({ composeId }) => {

View File

@@ -13,7 +13,7 @@ const messages = defineMessages({
interface IPollButton {
composeId: string
disabled?: boolean,
disabled?: boolean
}
const PollButton: React.FC<IPollButton> = ({ composeId, disabled }) => {

View File

@@ -105,7 +105,7 @@ const Option: React.FC<IOption> = ({
};
interface IPollForm {
composeId: string,
composeId: string
}
const PollForm: React.FC<IPollForm> = ({ composeId }) => {

View File

@@ -30,13 +30,13 @@ const messages = defineMessages({
const listenerOptions = supportsPassiveEvents ? { passive: true } : false;
interface IPrivacyDropdownMenu {
style?: React.CSSProperties,
items: any[],
value: string,
placement: string,
onClose: () => void,
onChange: (value: string | null) => void,
unavailable?: boolean,
style?: React.CSSProperties
items: any[]
value: string
placement: string
onClose: () => void
onChange: (value: string | null) => void
unavailable?: boolean
}
const PrivacyDropdownMenu: React.FC<IPrivacyDropdownMenu> = ({ style, items, placement, value, onClose, onChange }) => {
@@ -140,7 +140,7 @@ const PrivacyDropdownMenu: React.FC<IPrivacyDropdownMenu> = ({ style, items, pla
};
interface IPrivacyDropdown {
composeId: string,
composeId: string
}
const PrivacyDropdown: React.FC<IPrivacyDropdown> = ({

View File

@@ -9,10 +9,10 @@ import { isRtl } from 'soapbox/rtl';
import type { Status } from 'soapbox/types/entities';
interface IReplyIndicator {
className?: string,
status?: Status,
onCancel?: () => void,
hideActions: boolean,
className?: string
status?: Status
onCancel?: () => void
hideActions: boolean
}
const ReplyIndicator: React.FC<IReplyIndicator> = ({ className, status, hideActions, onCancel }) => {

View File

@@ -10,7 +10,7 @@ import { makeGetStatus } from 'soapbox/selectors';
import type { Status as StatusEntity } from 'soapbox/types/entities';
interface IReplyMentions {
composeId: string,
composeId: string
}
const ReplyMentions: React.FC<IReplyMentions> = ({ composeId }) => {

View File

@@ -12,8 +12,8 @@ const messages = defineMessages({
});
interface IScheduleButton {
composeId: string,
disabled?: boolean,
composeId: string
disabled?: boolean
}
const ScheduleButton: React.FC<IScheduleButton> = ({ composeId, disabled }) => {

View File

@@ -28,7 +28,7 @@ const messages = defineMessages({
});
export interface IScheduleForm {
composeId: string,
composeId: string
}
const ScheduleForm: React.FC<IScheduleForm> = ({ composeId }) => {
@@ -74,7 +74,7 @@ const ScheduleForm: React.FC<IScheduleForm> = ({ composeId }) => {
/>)}
</BundleContainer>
<IconButton
iconClassName='w-4 h-4'
iconClassName='h-4 w-4'
className='bg-transparent text-gray-400 hover:text-gray-600'
src={require('@tabler/icons/x.svg')}
onClick={handleRemove}

View File

@@ -34,9 +34,9 @@ function redirectToAccount(accountId: string, routerHistory: any) {
}
interface ISearch {
autoFocus?: boolean,
autoSubmit?: boolean,
autosuggest?: boolean,
autoFocus?: boolean
autoSubmit?: boolean
autosuggest?: boolean
openInRoute?: boolean
}

View File

@@ -12,7 +12,7 @@ const messages = defineMessages({
});
interface ISpoilerButton {
composeId: string,
composeId: string
}
const SpoilerButton: React.FC<ISpoilerButton> = ({ composeId }) => {

View File

@@ -14,7 +14,7 @@ const messages = defineMessages({
});
interface ISpoilerInput extends Pick<IAutosuggestInput, 'onSuggestionsFetchRequested' | 'onSuggestionsClearRequested' | 'onSuggestionSelected'> {
composeId: string extends 'default' ? never : string,
composeId: string extends 'default' ? never : string
}
/** Text input for content warning in composer. */

View File

@@ -3,8 +3,8 @@ import React from 'react';
import { length } from 'stringz';
interface ITextCharacterCounter {
max: number,
text: string,
max: number
text: string
}
const TextCharacterCounter: React.FC<ITextCharacterCounter> = ({ text, max }) => {

View File

@@ -15,14 +15,14 @@ const onlyImages = (types: ImmutableList<string>) => {
};
export interface IUploadButton {
disabled?: boolean,
unavailable?: boolean,
onSelectFile: (files: FileList, intl: IntlShape) => void,
style?: React.CSSProperties,
resetFileKey: number | null,
className?: string,
iconClassName?: string,
icon?: string,
disabled?: boolean
unavailable?: boolean
onSelectFile: (files: FileList, intl: IntlShape) => void
style?: React.CSSProperties
resetFileKey: number | null
className?: string
iconClassName?: string
icon?: string
}
const UploadButton: React.FC<IUploadButton> = ({

View File

@@ -9,7 +9,7 @@ import UploadProgress from './upload-progress';
import type { Attachment as AttachmentEntity } from 'soapbox/types/entities';
interface IUploadForm {
composeId: string,
composeId: string
}
const UploadForm: React.FC<IUploadForm> = ({ composeId }) => {

View File

@@ -4,7 +4,7 @@ import UploadProgress from 'soapbox/components/upload-progress';
import { useCompose } from 'soapbox/hooks';
interface IComposeUploadProgress {
composeId: string,
composeId: string
}
/** File upload progress bar for post composer. */

View File

@@ -6,8 +6,8 @@ import Upload from 'soapbox/components/upload';
import { useAppDispatch, useCompose, useInstance } from 'soapbox/hooks';
interface IUploadCompose {
id: string,
composeId: string,
id: string
composeId: string
}
const UploadCompose: React.FC<IUploadCompose> = ({ composeId, id }) => {

View File

@@ -10,9 +10,9 @@ const messages = defineMessages({
interface IVisualCharacterCounter {
/** max text allowed */
max: number,
max: number
/** text to use to measure */
text: string,
text: string
}
/** Renders a character counter */

View File

@@ -4,7 +4,7 @@ import { spring } from 'react-motion';
import Motion from '../../ui/util/optional-motion';
interface IWarning {
message: React.ReactNode,
message: React.ReactNode
}
/** Warning message displayed in ComposeForm. */