From e7e3e646547c118e61bc2394108aed4e2eded709 Mon Sep 17 00:00:00 2001 From: arunachalam-monk Date: Fri, 6 Sep 2024 22:25:52 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=F0=9F=8F=BC=20fix=20comments=20lan?= =?UTF-8?q?guage=20and=20quotes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/eslint-config-typescript/index.js | 69 +++++++++---------- .../src/PhotoCapture/PhotoCapture.tsx | 2 +- .../PhotoCaptureHUD/PhotoCaptureHUD.tsx | 1 + ...otoCaptureHUDElementsAddPartSelectShot.tsx | 1 + .../PhotoCaptureHUDTutorial.tsx | 5 +- .../src/PhotoCapture/hooks/usePictureTaken.ts | 10 +-- .../src/translations/en.json | 2 +- .../src/translations/fr.json | 4 +- .../PhotoCaptureHUDTutorial.test.tsx | 1 + packages/network/src/api/image/requests.ts | 2 +- packages/types/src/config.ts | 2 +- 11 files changed, 50 insertions(+), 49 deletions(-) diff --git a/configs/eslint-config-typescript/index.js b/configs/eslint-config-typescript/index.js index acec90771..77738ea9b 100644 --- a/configs/eslint-config-typescript/index.js +++ b/configs/eslint-config-typescript/index.js @@ -5,62 +5,59 @@ const ERROR = 2; module.exports = { root: true, extends: [ - "@monkvision/eslint-config-base", - "plugin:@typescript-eslint/recommended", - "plugin:import/typescript", + '@monkvision/eslint-config-base', + 'plugin:@typescript-eslint/recommended', + 'plugin:import/typescript', ], - plugins: ["@typescript-eslint"], - parser: "@typescript-eslint/parser", + plugins: ['@typescript-eslint'], + parser: '@typescript-eslint/parser', settings: { - "import/resolver": { + 'import/resolver': { node: { - extensions: [".js", ".jsx", ".ts", ".tsx"], + extensions: ['.js', '.jsx', '.ts', '.tsx'], }, }, }, rules: { - "prettier/prettier": ERROR, - "@typescript-eslint/lines-between-class-members": OFF, - "no-useless-constructor": OFF, - "@typescript-eslint/no-empty-function": [ - ERROR, - { allow: ["arrowFunctions"] }, - ], - "@typescript-eslint/no-empty-interface": OFF, - "@typescript-eslint/no-non-null-assertion": OFF, - "@typescript-eslint/no-unused-vars": [ + 'prettier/prettier': ERROR, + '@typescript-eslint/lines-between-class-members': OFF, + 'no-useless-constructor': OFF, + '@typescript-eslint/no-empty-function': [ERROR, { allow: ['arrowFunctions'] }], + '@typescript-eslint/no-empty-interface': OFF, + '@typescript-eslint/no-non-null-assertion': OFF, + '@typescript-eslint/no-unused-vars': [ ERROR, { - argsIgnorePattern: "^_", - varsIgnorePattern: "^_", - caughtErrorsIgnorePattern: "^_", - }, + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_" + } ], - "no-underscore-dangle": OFF, - "@typescript-eslint/naming-convention": [ + 'no-underscore-dangle': OFF, + '@typescript-eslint/naming-convention': [ ERROR, - { selector: "interface", format: ["PascalCase"] }, - { selector: "enum", format: ["PascalCase"] }, - { selector: "typeAlias", format: ["PascalCase"] }, + { selector: 'interface', format: ['PascalCase'] }, + { selector: 'enum', format: ['PascalCase'] }, + { selector: 'typeAlias', format: ['PascalCase'] }, ], }, overrides: [ { - files: ["*.{ts,tsx}"], + files: ['*.{ts,tsx}'], rules: { - "@typescript-eslint/no-shadow": [ERROR], - "no-shadow": OFF, - "no-undef": OFF, + '@typescript-eslint/no-shadow': [ERROR], + 'no-shadow': OFF, + 'no-undef': OFF, }, }, { - files: ["test/**/*.{ts,tsx}"], + files: ['test/**/*.{ts,tsx}'], rules: { - "import/first": OFF, - "import/order": OFF, - "@typescript-eslint/no-empty-function": OFF, - "@typescript-eslint/no-explicit-any": OFF, - "class-methods-use-this": OFF, + 'import/first': OFF, + 'import/order': OFF, + '@typescript-eslint/no-empty-function': OFF, + '@typescript-eslint/no-explicit-any': OFF, + 'class-methods-use-this': OFF, }, }, ], diff --git a/packages/inspection-capture-web/src/PhotoCapture/PhotoCapture.tsx b/packages/inspection-capture-web/src/PhotoCapture/PhotoCapture.tsx index 075c55caa..58308c1a7 100644 --- a/packages/inspection-capture-web/src/PhotoCapture/PhotoCapture.tsx +++ b/packages/inspection-capture-web/src/PhotoCapture/PhotoCapture.tsx @@ -130,7 +130,7 @@ export function PhotoCapture({ customComplianceThresholdsPerSight, useLiveCompliance = false, allowSkipRetake = false, - addDamage = AddDamage.TWO_SHOT, + addDamage = AddDamage.PART_SELECT, sightGuidelines, enableTutorial = PhotoCaptureTutorialOption.FIRST_TIME_ONLY, allowSkipTutorial = true, diff --git a/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.tsx b/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.tsx index 77bab5754..3e6fe95e5 100644 --- a/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.tsx +++ b/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.tsx @@ -214,6 +214,7 @@ export function PhotoCaptureHUD({ onCloseTutorial={onCloseTutorial} allowSkipTutorial={allowSkipTutorial} sightId={selectedSight.id} + addDamage={addDamage} sightGuidelines={sightGuidelines} /> diff --git a/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddPartSelectShot/PhotoCaptureHUDElementsAddPartSelectShot.tsx b/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddPartSelectShot/PhotoCaptureHUDElementsAddPartSelectShot.tsx index bc1c274cb..de4733dca 100644 --- a/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddPartSelectShot/PhotoCaptureHUDElementsAddPartSelectShot.tsx +++ b/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsAddPartSelectShot/PhotoCaptureHUDElementsAddPartSelectShot.tsx @@ -15,6 +15,7 @@ export type PhotoCaptureHUDElementsAddPartSelectShotProps = Pick< */ onCancel: PhotoCaptureHUDElementsProps['onCancelAddDamage']; }; + export function PhotoCaptureHUDElementsAddPartSelectShot({ onCancel, onAddDamageParts, diff --git a/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.tsx b/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.tsx index 9ca91cd9a..27854f40e 100644 --- a/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.tsx +++ b/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.tsx @@ -13,7 +13,7 @@ import { DisplayText } from './DisplayText'; * Props of the PhotoCaptureHUDTutorial component. */ export interface PhotoCaptureHUDTutorialProps - extends Pick { + extends Pick { /** * The id of the sight. */ @@ -46,6 +46,7 @@ export function PhotoCaptureHUDTutorial({ sightId, onNextTutorialStep, onCloseTutorial, + addDamage, }: PhotoCaptureHUDTutorialProps) { const { t } = useTranslation(); const primaryColor = usePhotoCaptureHUDButtonBackground(); @@ -60,7 +61,7 @@ export function PhotoCaptureHUDTutorial({ sightId={sightId} sightGuidelines={sightGuidelines} enableSightGuidelines={currentTutorialStep === TutorialSteps.GUIDELINE} - addDamage={AddDamage.TWO_SHOT} + addDamage={addDamage} />