From 12fffd4fb91a4cb2d085af6d3cbe89197e839115 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Thu, 25 Jan 2024 15:53:37 -0800 Subject: [PATCH] teacher tool - run prettier (#9831) * prettier * max line length 200 * max-line-length: 120 --- teachertool/.prettierrc | 5 ++-- teachertool/src/App.tsx | 3 +- .../src/components/ActiveRubricDisplay.tsx | 15 +++++++--- teachertool/src/components/CatalogModal.tsx | 20 +++++++++---- teachertool/src/components/DebugInput.tsx | 22 +++++++------- .../src/components/EvalResultDisplay.tsx | 7 +++-- teachertool/src/components/HeaderBar.tsx | 29 ++++--------------- teachertool/src/components/MakecodeFrame.tsx | 13 +++++---- teachertool/src/hooks/index.ts | 2 +- .../{ackendRequests.ts => backendRequests.ts} | 12 ++------ teachertool/src/services/loggingService.ts | 6 +--- .../src/services/makecodeEditorService.ts | 12 ++++---- teachertool/src/state/actions.ts | 16 ++++------ teachertool/src/state/appStateContext.tsx | 12 +++----- teachertool/src/state/helpers.ts | 2 +- teachertool/src/state/index.ts | 4 +-- teachertool/src/state/reducer.ts | 15 +++------- teachertool/src/state/state.ts | 6 ++-- .../src/transforms/addCriteriaToRubric.ts | 16 ++++++---- teachertool/src/transforms/hideModal.ts | 2 +- .../src/transforms/loadCatalogAsync.ts | 11 +++---- .../src/transforms/loadProjectAsync.ts | 1 - .../transforms/loadProjectMetadataAsync.ts | 2 +- .../transforms/removeCriteriaFromRubric.ts | 6 ++-- .../src/transforms/runEvaluateAsync.ts | 2 +- .../src/transforms/showCatalogModal.ts | 2 +- teachertool/src/types/criteria.ts | 2 +- teachertool/src/types/errorCode.ts | 4 +-- teachertool/src/types/index.ts | 2 +- teachertool/src/utils/index.ts | 7 ++--- 30 files changed, 116 insertions(+), 142 deletions(-) rename teachertool/src/services/{ackendRequests.ts => backendRequests.ts} (77%) diff --git a/teachertool/.prettierrc b/teachertool/.prettierrc index 19b5198afcac..fdcd59bbe075 100644 --- a/teachertool/.prettierrc +++ b/teachertool/.prettierrc @@ -1,5 +1,6 @@ { "arrowParens": "avoid", "semi": true, - "tabWidth": 4 -} \ No newline at end of file + "tabWidth": 4, + "printWidth":120 +} diff --git a/teachertool/src/App.tsx b/teachertool/src/App.tsx index a1d134577511..7f4f9c87f4a6 100644 --- a/teachertool/src/App.tsx +++ b/teachertool/src/App.tsx @@ -6,7 +6,7 @@ import { usePromise } from "./hooks"; import { makeNotification } from "./utils"; import * as Actions from "./state/actions"; import * as NotificationService from "./services/notificationService"; -import { downloadTargetConfigAsync } from "./services/ackendRequests"; +import { downloadTargetConfigAsync } from "./services/backendRequests"; import { logDebug } from "./services/loggingService"; import HeaderBar from "./components/HeaderBar"; @@ -20,7 +20,6 @@ import CatalogModal from "./components/CatalogModal"; import { postNotification } from "./transforms/postNotification"; import { loadCatalogAsync } from "./transforms/loadCatalogAsync"; - function App() { const { state, dispatch } = useContext(AppStateContext); const [inited, setInited] = useState(false); diff --git a/teachertool/src/components/ActiveRubricDisplay.tsx b/teachertool/src/components/ActiveRubricDisplay.tsx index 23014a837dee..fc3f916fc491 100644 --- a/teachertool/src/components/ActiveRubricDisplay.tsx +++ b/teachertool/src/components/ActiveRubricDisplay.tsx @@ -7,7 +7,6 @@ import { Button } from "react-common/components/controls/Button"; import { removeCriteriaFromRubric } from "../transforms/removeCriteriaFromRubric"; import { showCatalogModal } from "../transforms/showCatalogModal"; - interface IProps {} const ActiveRubricDisplay: React.FC = ({}) => { @@ -20,18 +19,26 @@ const ActiveRubricDisplay: React.FC = ({}) => { if (!criteriaInstance) return null; const catalogCriteria = getCatalogCriteriaWithId(criteriaInstance.catalogCriteriaId); - return criteriaInstance.catalogCriteriaId && ( + return ( + criteriaInstance.catalogCriteriaId && (
{catalogCriteria?.template}
+ ) ); })} -