From d84fb244d3b771d2e920239b571feefba2b0e4d9 Mon Sep 17 00:00:00 2001 From: caranicas Date: Tue, 20 Sep 2022 14:21:21 -0400 Subject: [PATCH] fix all the linting errors i can --- ui/frontend/build_src/.eslintrc.cjs | 12 +- .../build_src/src/Translation/config.ts | 31 ++-- ui/frontend/build_src/src/api/index.ts | 6 +- .../components/molecules/drawImage/index.tsx | 18 +- .../advancedSettings/advancedsettings.css.ts | 2 +- .../improvementSettings/index.tsx | 2 +- .../propertySettings/index.tsx | 4 +- .../makeButton/makeButton.css.ts | 2 +- .../basicCreation/seedImage/seedImage.css.ts | 2 +- .../creationPanel/creationPanelUIStore.ts | 32 ++-- .../imageModifiers/imageModifiers.css.ts | 2 +- .../creationPanel/imageModifiers/index.tsx | 11 +- .../completedImages/completedImages.css.ts | 2 +- .../displayPanel/currentDisplay/index.tsx | 5 +- .../footerDisplay/footerDisplay.css.ts | 2 +- .../organisms/footerDisplay/index.tsx | 2 +- .../headerDisplay/headerDisplay.css.ts | 2 +- .../statusDisplay/statusDisplay.css.ts | 2 +- .../build_src/src/pages/Home/home.css.ts | 2 +- .../build_src/src/stores/imageCreateStore.ts | 157 +++++++++--------- .../build_src/src/stores/imageQueueStore.ts | 2 +- ui/frontend/build_src/src/styles/index.css.ts | 2 +- .../build_src/src/styles/shared.css.ts | 2 +- ui/frontend/dist/index.js | 6 +- 24 files changed, 156 insertions(+), 154 deletions(-) diff --git a/ui/frontend/build_src/.eslintrc.cjs b/ui/frontend/build_src/.eslintrc.cjs index 9a5f9a6d..7193167b 100644 --- a/ui/frontend/build_src/.eslintrc.cjs +++ b/ui/frontend/build_src/.eslintrc.cjs @@ -54,20 +54,14 @@ module.exports = { "@typescript-eslint/space-before-function-paren": "off", "@typescript-eslint/quotes": "off", "@typescript-eslint/semi": "off", + "@typescript-eslint/brace-style": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/member-delimiter-style": "off", // TS WARNINGS WE WANT "@typescript-eslint/no-unused-vars": "warn", "@typescript-eslint/no-non-null-assertion": "warn", - // TS things turned off for now - "@typescript-eslint/consistent-type-assertions": "off", - - "@typescript-eslint/restrict-plus-operands": "off", - "@typescript-eslint/brace-style": "off", - "@typescript-eslint/prefer-ts-expect-error": "off", - "@typescript-eslint/indent": "off", - // "@typescript-eslint/member-delimiter-style": "off", - // i18n stuff no string literal works but turned off for now "i18next/no-literal-string": "off", // still need to figure out how to get this to work diff --git a/ui/frontend/build_src/src/Translation/config.ts b/ui/frontend/build_src/src/Translation/config.ts index f347cd2a..31c0611b 100644 --- a/ui/frontend/build_src/src/Translation/config.ts +++ b/ui/frontend/build_src/src/Translation/config.ts @@ -12,16 +12,21 @@ export const resources = { translation: ESTranslation, }, } as const; -i18n.use(initReactI18next).init({ - lng: "en", - interpolation: { - escapeValue: false, - }, - resources, -}).then(() => { - console.log("i18n initialized"); -}).catch((err) => { - console.error("i18n initialization failed", err); -}).finally(() => { - console.log("i18n initialization finished"); -}); \ No newline at end of file +i18n + .use(initReactI18next) + .init({ + lng: "en", + interpolation: { + escapeValue: false, + }, + resources, + }) + .then(() => { + console.log("i18n initialized"); + }) + .catch((err) => { + console.error("i18n initialization failed", err); + }) + .finally(() => { + console.log("i18n initialization finished"); + }); diff --git a/ui/frontend/build_src/src/api/index.ts b/ui/frontend/build_src/src/api/index.ts index 8ff8d4f2..17289282 100644 --- a/ui/frontend/build_src/src/api/index.ts +++ b/ui/frontend/build_src/src/api/index.ts @@ -61,14 +61,14 @@ export interface ImageOutput { data: string; path_abs: string | null; seed: number; -}; +} export interface ImageReturnType { output: ImageOutput[]; request: {}; status: string; session_id: string; -}; +} export const MakeImageKey = "MakeImage"; export const doMakeImage = async (reqBody: ImageRequest) => { @@ -82,4 +82,4 @@ export const doMakeImage = async (reqBody: ImageRequest) => { const data = await res.json(); return data; -}; \ No newline at end of file +}; diff --git a/ui/frontend/build_src/src/components/molecules/drawImage/index.tsx b/ui/frontend/build_src/src/components/molecules/drawImage/index.tsx index d088a231..1e8ba38e 100644 --- a/ui/frontend/build_src/src/components/molecules/drawImage/index.tsx +++ b/ui/frontend/build_src/src/components/molecules/drawImage/index.tsx @@ -8,12 +8,12 @@ import { // https://github.com/embiem/react-canvas-draw interface DrawImageProps { - imageData: string - brushSize: string + imageData: string; + brushSize: string; - brushShape: string - brushColor: string - isErasing: boolean + brushShape: string; + brushColor: string; + isErasing: boolean; } export default function DrawImage({ @@ -99,7 +99,13 @@ export default function DrawImage({ } }; - const _drawCursor = (x, y, brushSize, brushShape, brushColor) => { + const _drawCursor = ( + x: number, + y: number, + brushSize: number, + brushShape: string, + brushColor: string + ) => { const canvas = cursorRef.current; if (canvas != null) { const ctx = canvas.getContext("2d"); diff --git a/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/advancedsettings.css.ts b/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/advancedsettings.css.ts index 33223875..6a1a65f0 100644 --- a/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/advancedsettings.css.ts +++ b/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/advancedsettings.css.ts @@ -1,6 +1,6 @@ import { style, globalStyle } from "@vanilla-extract/css"; -// @ts-ignore +// @ts-expect-error import { vars } from "../../../../styles/theme/index.css.ts"; // import { PanelBox } from "../../../../styles/shared.css.ts"; diff --git a/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/improvementSettings/index.tsx b/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/improvementSettings/index.tsx index ffc2ba34..62304e5b 100644 --- a/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/improvementSettings/index.tsx +++ b/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/improvementSettings/index.tsx @@ -48,7 +48,7 @@ export default function ImprovementSettings() { // should probably be a store selector useEffect(() => { // if either are true we arent disabled - if (isUsingFaceCorrection || useUpscale != '') { + if (isUsingFaceCorrection || useUpscale != "") { setIsFilteringDisabled(false); } else { setIsFilteringDisabled(true); diff --git a/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/propertySettings/index.tsx b/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/propertySettings/index.tsx index f18d291c..4a45264b 100644 --- a/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/propertySettings/index.tsx +++ b/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/propertySettings/index.tsx @@ -152,7 +152,7 @@ export default function PropertySettings() { > {IMAGE_DIMENSIONS.map((dimension) => (