GH-1362: Fix missing return type on function (#1375)

* fix missing return type errors

* fix in userSettings
This commit is contained in:
Scott Bishel 2021-09-29 17:58:36 -06:00 committed by GitHub
parent f92727f993
commit bde2a287e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 12 additions and 12 deletions

View file

@ -32,7 +32,7 @@ type Props = {
readonly: boolean
}
const CardDialog = (props: Props) => {
const CardDialog = (props: Props): JSX.Element => {
const {board, activeView, cards, views} = props
const card = useAppSelector(getCard(props.cardId))
const contents = useAppSelector(getCardContents(props.cardId))

View file

@ -42,7 +42,7 @@ const HeaderItems = () => {
)
}
const GlobalHeader = () => {
const GlobalHeader = (): JSX.Element => {
return (
<ReduxProvider store={store}>
<HeaderItems/>

View file

@ -25,7 +25,7 @@ type Props = {
onDrop: (srcCard: Card, dstCard: Card) => void
}
const TableRows = (props: Props) => {
const TableRows = (props: Props): JSX.Element => {
const {board, cards, activeView} = props
const {offset, resizingColumn} = useDragLayer((monitor) => {

View file

@ -10,7 +10,7 @@ import Editable from '../../widgets/editable'
import {useAppSelector, useAppDispatch} from '../../store/hooks'
import {getSearchText, setSearchText} from '../../store/searchText'
const ViewHeaderSearch = () => {
const ViewHeaderSearch = (): JSX.Element => {
const searchText = useAppSelector<string>(getSearchText)
const dispatch = useAppDispatch()
const intl = useIntl()

View file

@ -9,7 +9,7 @@ declare interface INativeApp {
declare const NativeApp: INativeApp
export function importNativeAppSettings() {
export function importNativeAppSettings(): void {
if (typeof NativeApp === 'undefined' || !NativeApp.settingsBlob) {
return
}
@ -19,7 +19,7 @@ export function importNativeAppSettings() {
NativeApp.settingsBlob = null
}
export function notifySettingsChanged(key: string) {
export function notifySettingsChanged(key: string): void {
postWebKitMessage({type: 'didChangeUserSettings', settingsBlob: exportUserSettingsBlob(), key})
}

View file

@ -81,7 +81,7 @@ class OctoClient {
return false
}
logout() {
logout(): void {
localStorage.removeItem('focalboardSessionId')
}

View file

@ -34,7 +34,7 @@ type Props = {
const websocketTimeoutForBanner = 5000
const BoardPage = (props: Props) => {
const BoardPage = (props: Props): JSX.Element => {
const intl = useIntl()
const board = useAppSelector(getCurrentBoard)
const activeView = useAppSelector(getCurrentView)

View file

@ -3,7 +3,7 @@
import React from 'react'
export default function DashboardOnboardingSvg(props: React.HTMLAttributes<HTMLSpanElement>) {
export default function DashboardOnboardingSvg(props: React.HTMLAttributes<HTMLSpanElement>): JSX.Element {
return (
<span {...props}>
<svg

View file

@ -3,7 +3,7 @@
import React from 'react'
export default function SearchIllustration(props: React.HTMLAttributes<HTMLSpanElement>) {
export default function SearchIllustration(props: React.HTMLAttributes<HTMLSpanElement>): JSX.Element {
return (
<span {...props}>
<svg

View file

@ -23,7 +23,7 @@ export class UserSettings {
return localStorage.getItem(key)
}
static set(key: UserSettingKey, value: string | null) {
static set(key: UserSettingKey, value: string | null): void {
if (!Object.values(UserSettingKey).includes(key)) {
return
}
@ -98,7 +98,7 @@ export class UserSettings {
return json ? JSON.parse(json) : null
}
static setEmojiMartSetting(key: string, value: any) {
static setEmojiMartSetting(key: string, value: any): void {
const prefixed = `emoji-mart.${key}`
Utils.assert((Object as any).values(UserSettingKey).includes(prefixed))
UserSettings.set(prefixed as UserSettingKey, JSON.stringify(value))