Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run lint --fix with "@typescript-eslint/indent": ["error", 2], #1585

Merged
merged 1 commit into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"rules": {
"comma-spacing": ["error", { "before": false, "after": true }],
"cypress/no-pause": "error",
"indent": ["error", 2],
"@typescript-eslint/indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "double"],
"semi": ["error", "never"],
Expand Down
2 changes: 1 addition & 1 deletion packages/common-components/src/Icons/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type fontSizeProp = "inherit" | "small" | "medium" | "large"
declare module "*.svg" {
import React = require("react")
export const ReactComponent: React.FunctionComponent<React.SVGProps<
SVGSVGElement
SVGSVGElement
>>
const src: string
export default src
Expand Down
12 changes: 6 additions & 6 deletions packages/common-components/src/MenuDropdown/MenuDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ interface IMenuDropdownProps {
indicator?: typeof SvgIcon
animation?: "rotate" | "flip" | "none"
anchor?:
| "top-left"
| "top-center"
| "top-right"
| "bottom-left"
| "bottom-center"
| "bottom-right"
| "top-left"
| "top-center"
| "top-right"
| "bottom-left"
| "bottom-center"
| "bottom-right"
menuItems: IMenuItem[]
title?: string
classNames?: {
Expand Down
24 changes: 12 additions & 12 deletions packages/common-components/src/Typography/Typography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,18 @@ interface OwnProps extends React.HTMLProps<HTMLDivElement> {
className?: string
children?: ReactNode | ReactNode[]
variant?:
| "h1"
| "h2"
| "h3"
| "h4"
| "h5"
| "h6"
| "subtitle1"
| "subtitle2"
| "body1"
| "body2"
| "caption"
| "button"
| "h1"
| "h2"
| "h3"
| "h4"
| "h5"
| "h6"
| "subtitle1"
| "subtitle2"
| "body1"
| "body2"
| "caption"
| "button"
component?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | "p"
}

Expand Down
22 changes: 11 additions & 11 deletions packages/common-components/src/stories/Typography.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ export const actionsData = {
}

type VariantOption = "h1"
|"h2"
|"h3"
|"h4"
|"h5"
|"h6"
|"subtitle1"
|"subtitle2"
|"body1"
|"body2"
|"caption"
|"button"
|"h2"
|"h3"
|"h4"
|"h5"
|"h6"
|"subtitle1"
|"subtitle2"
|"body1"
|"body2"
|"caption"
|"button"

const variantOptions: VariantOption[] = [
"h1",
Expand Down
26 changes: 13 additions & 13 deletions packages/common-theme/src/Create/CreateBreakpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
export type Overwrite<T, U> = Omit<T, keyof U> & U

type GenerateStringUnion<T> = Extract<
{
[Key in keyof T]: true extends T[Key] ? Key : never
}[keyof T],
string
{
[Key in keyof T]: true extends T[Key] ? Key : never
}[keyof T],
string
>

/**
Expand All @@ -22,18 +22,18 @@ type GenerateStringUnion<T> = Extract<
* @internal
*/
export type OverridableStringUnion<T, U = Record<any, any>> = GenerateStringUnion<
Overwrite<T, U>
Overwrite<T, U>
>

export type BreakpointDefaults = Record<
"xs" | "sm" | "md" | "lg" | "xl" | string,
true
"xs" | "sm" | "md" | "lg" | "xl" | string,
true
>
export interface BreakpointOverrides {[key: string]: unknown}

export type Breakpoint = OverridableStringUnion<
BreakpointDefaults,
BreakpointOverrides
BreakpointDefaults,
BreakpointOverrides
>
export type BreakpointValues = { [key in Breakpoint]: number }
export const keys: Breakpoint[] = []
Expand All @@ -49,10 +49,10 @@ export interface IBreakpoints {
}

export type BreakpointsOptions = Partial<
{
unit: string
step: number
} & IBreakpoints
{
unit: string
step: number
} & IBreakpoints
>

// Keep in mind that @media is inclusive by the CSS specification.
Expand Down
12 changes: 6 additions & 6 deletions packages/common-theme/src/Hooks/useDoubleClick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export function useDoubleClick(
const onClick = useCallback((e?: React.MouseEvent) => {
if (e) {
switch (e.detail) {
case 1:
actionSingleClick && actionSingleClick(e)
break
case 2:
actionDoubleClick && actionDoubleClick(e)
break
case 1:
actionSingleClick && actionSingleClick(e)
break
case 2:
actionDoubleClick && actionDoubleClick(e)
break
}
}
}, [actionSingleClick, actionDoubleClick])
Expand Down
4 changes: 2 additions & 2 deletions packages/files-ui/src/Components/Elements/MnemonicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ const useStyles = makeStyles(({ animation, constants, palette, zIndex }: CSFThem
)

interface Props {
buttonLabel?: string
onComplete: () => void
buttonLabel?: string
onComplete: () => void
}

const MnemonicForm = ({ buttonLabel, onComplete }: Props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import clsx from "clsx"
import { CSFTheme } from "../../Themes/types"

interface Props {
requests: ShareTransferRequest[]
requests: ShareTransferRequest[]
}

const useStyles = makeStyles(({ constants }: CSFTheme) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/files-ui/src/Components/Elements/SharedUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const useStyles = makeStyles(() => {
})
})
interface Props {
bucket: BucketKeyPermission
bucket: BucketKeyPermission
}

const SharedUsers = ({ bucket }: Props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,37 +204,37 @@ const SharedFileBrowser = () => {

const itemOperations: IFilesTableBrowserProps["itemOperations"] = useMemo(() => {
switch (access) {
case "owner":
return {
[CONTENT_TYPES.Audio]: ["preview"],
[CONTENT_TYPES.MP4]: ["preview"],
[CONTENT_TYPES.Image]: ["preview"],
[CONTENT_TYPES.Pdf]: ["preview"],
[CONTENT_TYPES.Text]: ["preview"],
[CONTENT_TYPES.File]: ["download", "info", "rename", "move", "delete", "share"],
[CONTENT_TYPES.Directory]: ["rename", "move", "delete"]
}
case "writer":
return {
[CONTENT_TYPES.Audio]: ["preview"],
[CONTENT_TYPES.MP4]: ["preview"],
[CONTENT_TYPES.Image]: ["preview"],
[CONTENT_TYPES.Pdf]: ["preview"],
[CONTENT_TYPES.Text]: ["preview"],
[CONTENT_TYPES.File]: ["download", "info", "rename", "move", "delete", "report", "share"],
[CONTENT_TYPES.Directory]: ["rename", "move", "delete"]
}
// case "reader":
default:
return {
[CONTENT_TYPES.Audio]: ["preview"],
[CONTENT_TYPES.MP4]: ["preview"],
[CONTENT_TYPES.Image]: ["preview"],
[CONTENT_TYPES.Pdf]: ["preview"],
[CONTENT_TYPES.Text]: ["preview"],
[CONTENT_TYPES.File]: ["download", "info", "report", "share"],
[CONTENT_TYPES.Directory]: []
}
case "owner":
return {
[CONTENT_TYPES.Audio]: ["preview"],
[CONTENT_TYPES.MP4]: ["preview"],
[CONTENT_TYPES.Image]: ["preview"],
[CONTENT_TYPES.Pdf]: ["preview"],
[CONTENT_TYPES.Text]: ["preview"],
[CONTENT_TYPES.File]: ["download", "info", "rename", "move", "delete", "share"],
[CONTENT_TYPES.Directory]: ["rename", "move", "delete"]
}
case "writer":
return {
[CONTENT_TYPES.Audio]: ["preview"],
[CONTENT_TYPES.MP4]: ["preview"],
[CONTENT_TYPES.Image]: ["preview"],
[CONTENT_TYPES.Pdf]: ["preview"],
[CONTENT_TYPES.Text]: ["preview"],
[CONTENT_TYPES.File]: ["download", "info", "rename", "move", "delete", "report", "share"],
[CONTENT_TYPES.Directory]: ["rename", "move", "delete"]
}
// case "reader":
default:
return {
[CONTENT_TYPES.Audio]: ["preview"],
[CONTENT_TYPES.MP4]: ["preview"],
[CONTENT_TYPES.Image]: ["preview"],
[CONTENT_TYPES.Pdf]: ["preview"],
[CONTENT_TYPES.Text]: ["preview"],
[CONTENT_TYPES.File]: ["download", "info", "report", "share"],
[CONTENT_TYPES.Directory]: []
}
}
}, [access])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,26 +356,26 @@ const FilesList = ({ isShared = false }: Props) => {

switch (column) {
// defaults to name sorting
default: {
temp = sourceFiles.sort((a, b) => {
return a.name.localeCompare(b.name, selectedLocale, {
sensitivity: "base"
default: {
temp = sourceFiles.sort((a, b) => {
return a.name.localeCompare(b.name, selectedLocale, {
sensitivity: "base"
})
})
})
break
}
case "size": {
temp = sourceFiles
.sort((a, b) => (a.size < b.size ? -1 : 1))
.sort(sortFoldersFirst)
break
}
case "date_uploaded": {
temp = sourceFiles
.sort((a, b) => (a.created_at < b.created_at ? -1 : 1))
.sort(sortFoldersFirst)
break
}
break
}
case "size": {
temp = sourceFiles
.sort((a, b) => (a.size < b.size ? -1 : 1))
.sort(sortFoldersFirst)
break
}
case "date_uploaded": {
temp = sourceFiles
.sort((a, b) => (a.created_at < b.created_at ? -1 : 1))
.sort(sortFoldersFirst)
break
}
}
return direction === "descend"
? temp.reverse().sort(sortFoldersFirst)
Expand Down Expand Up @@ -501,15 +501,15 @@ const FilesList = ({ isShared = false }: Props) => {
if (!!permission && isShared) {

switch(permission) {
case "owner":
fileOperations = ownerOperations
break
case "writer":
fileOperations = writerOperations
break
case "reader":
fileOperations = readerOperations
break
case "owner":
fileOperations = ownerOperations
break
case "writer":
fileOperations = writerOperations
break
case "reader":
fileOperations = readerOperations
break
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ const InitializeAccount = ({ className }: IInitializeAccount) => {
, [addPasswordShare, resetShouldInitialize])

switch (initializeState) {
case "explainer":
return <ConciseExplainer
className={className}
onContinue={() => setInitializeState("setUpPassword")}
/>
case "setUpPassword":
return <PasswordSetup
className={className}
cancel={() => setInitializeState("explainer")}
setPassword={onSetPassword}
/>
default:
return null
case "explainer":
return <ConciseExplainer
className={className}
onContinue={() => setInitializeState("setUpPassword")}
/>
case "setUpPassword":
return <PasswordSetup
className={className}
cancel={() => setInitializeState("explainer")}
setPassword={onSetPassword}
/>
default:
return null
}
}

Expand Down
Loading