diff --git a/.eslintrc.json b/.eslintrc.json index 61f9cbc708..749ea1f152 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -34,6 +34,9 @@ "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "warn", "react/prop-types": 0, + "arrow-spacing": "error", + "space-infix-ops": "error", + "no-trailing-spaces": ["error", { "ignoreComments": true }], "comma-dangle": ["error", "never"], "object-curly-spacing": ["error", "always"], "space-in-parens": ["error", "never"], diff --git a/packages/common-components/src/Helpers/Dates.ts b/packages/common-components/src/Helpers/Dates.ts index 065fbe3284..6f79bd7ea4 100644 --- a/packages/common-components/src/Helpers/Dates.ts +++ b/packages/common-components/src/Helpers/Dates.ts @@ -9,7 +9,7 @@ export const formatAMPM = (date: Date) => { const ampm = hours >= 12 ? "pm" : "am" hours = hours % 12 hours = hours ? hours : 12 // the hour '0' should be '12' - return `${hours}:${minutes < 10 ? "0"+ minutes : minutes} ${ampm}` + return `${hours}:${minutes < 10 ? "0" + minutes : minutes} ${ampm}` } export const standardlongDateFormat = (input: Date, time?: boolean): string => { @@ -29,5 +29,5 @@ export const standardlongDateFormat = (input: Date, time?: boolean): string => { ] return `${`${input.getDay()}`.padStart(2, "0")} ${`${ months[input.getMonth()].substr(0, 4) - }`} ${`${input.getFullYear()}`.substr(0, 4)}${time ? ` ${formatAMPM(input)}`: ""}` + }`} ${`${input.getFullYear()}`.substr(0, 4)}${time ? ` ${formatAMPM(input)}` : ""}` } \ No newline at end of file diff --git a/packages/common-components/src/Scroll/ScrollToTop.hook.tsx b/packages/common-components/src/Scroll/ScrollToTop.hook.tsx index a32d198c23..13b5de25af 100644 --- a/packages/common-components/src/Scroll/ScrollToTop.hook.tsx +++ b/packages/common-components/src/Scroll/ScrollToTop.hook.tsx @@ -2,7 +2,7 @@ import { useCallback, useEffect } from "react" import { animateScroll as scroll } from "react-scroll" export function useScrollToTop(onMount = false) { - + const scrollToTop = useCallback(() => { scroll.scrollToTop() }, []) diff --git a/packages/common-components/src/stories/Typography.stories.tsx b/packages/common-components/src/stories/Typography.stories.tsx index 9dc82181f0..4ad36e0e58 100644 --- a/packages/common-components/src/stories/Typography.stories.tsx +++ b/packages/common-components/src/stories/Typography.stories.tsx @@ -14,17 +14,17 @@ export const actionsData = { onClick: action("onClickTypography") } -type VariantOption = "h1" - |"h2" - |"h3" - |"h4" - |"h5" - |"h6" - |"subtitle1" - |"subtitle2" - |"body1" - |"body2" - |"caption" +type VariantOption = "h1" + |"h2" + |"h3" + |"h4" + |"h5" + |"h6" + |"subtitle1" + |"subtitle2" + |"body1" + |"body2" + |"caption" |"button" const variantOptions: VariantOption[] = [ diff --git a/packages/common-contexts/src/UserContext/UserContext.tsx b/packages/common-contexts/src/UserContext/UserContext.tsx index b8954b8e48..20578a6a63 100644 --- a/packages/common-contexts/src/UserContext/UserContext.tsx +++ b/packages/common-contexts/src/UserContext/UserContext.tsx @@ -49,7 +49,7 @@ const UserProvider = ({ children }: UserContextProps) => { return Promise.reject("There was an error getting profile.") } }, [imployApiClient]) - + useEffect(() => { if (isLoggedIn) { const retrieveProfile = async () => { diff --git a/packages/common-themes/src/Hooks/useDoubleClick.ts b/packages/common-themes/src/Hooks/useDoubleClick.ts index 7d6dc34fdf..be465eaf9e 100644 --- a/packages/common-themes/src/Hooks/useDoubleClick.ts +++ b/packages/common-themes/src/Hooks/useDoubleClick.ts @@ -9,10 +9,10 @@ export function useDoubleClick(actionSingleClick: () => void, actionDoubleClick: if (clickCount === 1) { actionSingleClick && actionSingleClick() } - + setClickCount(0) }, delay) - + // the duration between this click and the previous one // is less than the value of delay = double-click if (clickCount === 2) { diff --git a/packages/common-themes/src/Provider/ThemeSwitcherContext.tsx b/packages/common-themes/src/Provider/ThemeSwitcherContext.tsx index ec0fcdc981..fc93f4e621 100644 --- a/packages/common-themes/src/Provider/ThemeSwitcherContext.tsx +++ b/packages/common-themes/src/Provider/ThemeSwitcherContext.tsx @@ -55,7 +55,7 @@ const ThemeSwitcher: React.FC = ({ if (canUseLocalStorage && current != "") { localStorage.setItem(storageKey, current) } - + // Update CSS vars if (current != "" && themes[current].globalStyling["@global"][":root"]) { Object.keys(themes[current].globalStyling["@global"][":root"]).map( diff --git a/packages/common-themes/src/utils/colorManipulator.ts b/packages/common-themes/src/utils/colorManipulator.ts index df032f6f9a..94bbc97aec 100644 --- a/packages/common-themes/src/utils/colorManipulator.ts +++ b/packages/common-themes/src/utils/colorManipulator.ts @@ -97,7 +97,7 @@ export function decomposeColor(color: string): IColorObject { if (type === "var") { colorToParse = getComputedStyle(document.documentElement).getPropertyValue(color.substr(marker + 1, color.length - 1)) - } + } const valuesStrings = colorToParse .substring(marker + 1, colorToParse.length - 1) diff --git a/packages/files-ui/src/Components/Elements/CustomModal.tsx b/packages/files-ui/src/Components/Elements/CustomModal.tsx index 08c552b031..6eb7e6132f 100644 --- a/packages/files-ui/src/Components/Elements/CustomModal.tsx +++ b/packages/files-ui/src/Components/Elements/CustomModal.tsx @@ -9,9 +9,6 @@ const useStyles = makeStyles(({ constants, breakpoints }: CSFTheme) => root: { "&:before": { backgroundColor: fade(constants.modalDefault.fadeBackground, 0.9) - }, - [breakpoints.down("md")]: { - } }, inner: { diff --git a/packages/files-ui/src/Components/Elements/ShareTransferRequestModal.tsx b/packages/files-ui/src/Components/Elements/ShareTransferRequestModal.tsx index d4f22eefda..5d997202a1 100644 --- a/packages/files-ui/src/Components/Elements/ShareTransferRequestModal.tsx +++ b/packages/files-ui/src/Components/Elements/ShareTransferRequestModal.tsx @@ -52,7 +52,7 @@ const ShareTransferRequestModal = ({ requests }: Props) => { const classes = useStyles() const [isLoadingApprove, setIsLoadingApprove] = useState(false) const [isLoadingReject, setIsLoadingReject] = useState(false) - const { browserDetail, encPubKeyX, timestamp } = useMemo(() => requests[requests.length -1], [requests]) + const { browserDetail, encPubKeyX, timestamp } = useMemo(() => requests[requests.length - 1], [requests]) useEffect(() => { // reset the buttons state for each new request displayed @@ -90,7 +90,7 @@ const ShareTransferRequestModal = ({ requests }: Props) => { on {dayjs(timestamp).format("ddd D MMMM h:mm a")}
- -