From 2a715efceaceb719f9945723fe031d374cc01af3 Mon Sep 17 00:00:00 2001 From: Steffen Kleinle Date: Tue, 26 Mar 2024 18:38:09 +0100 Subject: [PATCH] 983: Upgrade prettier and add trailing commas --- .prettierrc | 5 +-- package.json | 2 +- src/components/ImageCarousel.tsx | 2 +- src/components/ListItem.tsx | 2 +- .../__tests__/CameraOverlay.spec.tsx | 4 +-- .../__tests__/CustomTextInput.spec.tsx | 6 ++-- .../__tests__/ExerciseHeader.spec.tsx | 2 +- .../__tests__/FavoriteButton.spec.tsx | 2 +- .../__tests__/FeedbackModal.spec.tsx | 6 ++-- src/components/__tests__/ListItem.spec.tsx | 2 +- src/components/__tests__/Loading.spec.tsx | 2 +- .../__tests__/NotAuthorisedView.spec.tsx | 15 ++++++-- .../__tests__/RouteWrapper.spec.tsx | 4 +-- .../__tests__/ServerResponseHandler.spec.tsx | 6 ++-- .../__tests__/VocabularyList.spec.tsx | 4 +-- src/constants/theme/colors.ts | 2 +- src/hooks/helpers.ts | 2 +- src/hooks/useLoadAsync.ts | 2 +- src/hooks/useLoadVocabularyItems.ts | 4 +-- src/navigation/BottomTabNavigator.tsx | 2 +- .../__tests__/OverlayMenuScreen.spec.tsx | 4 +-- .../ProfessionSelectionScreen.spec.tsx | 4 +-- .../__tests__/VocabularyListScreen.spec.tsx | 2 +- .../AddCustomDisciplineScreen.tsx | 2 +- .../AddCustomDisciplineScreen.spec.tsx | 4 +-- .../ArticleChoiceExerciseScreen.tsx | 2 +- .../ArticleChoiceExerciseScreen.spec.tsx | 2 +- .../components/SingleChoiceExercise.tsx | 8 ++--- .../__tests__/ExerciseFinishedScreen.spec.tsx | 8 ++--- .../exercises/StandardExercisesScreen.tsx | 2 +- .../home/components/__tests__/Card.spec.tsx | 2 +- .../CustomDisciplineDetails.spec.tsx | 2 +- .../__tests__/HomeScreenHeader.spec.tsx | 2 +- .../__tests__/NextExerciseCard.spec.tsx | 2 +- .../__tests__/ProfessionDetails.spec.tsx | 2 +- .../UserVocabularyProcessScreen.tsx | 2 +- .../UserVocabularyProcessScreen.spec.tsx | 10 +++--- .../components/AudioRecordOverlay.tsx | 2 +- src/routes/repetition/RepetitionScreen.tsx | 4 +-- .../__tests__/RepetitionScreen.spec.tsx | 2 +- .../components/RepetitionProgressChart.tsx | 2 +- .../__tests__/AlternativeWords.spec.tsx | 4 +-- .../write-exercise/WriteExerciseScreen.tsx | 12 +++---- .../__tests__/WriteExerciseScreen.spec.tsx | 16 ++++----- .../__tests__/AnswerReview.spec.tsx | 12 +++---- .../__tests__/InteractionSection.spec.tsx | 32 ++++++++--------- .../services/AbstractWriteExerciseService.ts | 18 +++++----- .../RepetitionWriteExerciseService.ts | 4 +-- .../services/StandardWriteExerciseService.ts | 6 ++-- .../RepetitionWriteExerciseService.spec.ts | 6 ++-- .../StandardWriteExerciseService.spec.tsx | 2 +- src/services/AsyncStorage.ts | 15 ++++---- src/services/RepetitionService.ts | 6 ++-- .../__tests__/RepetitionService.spec.ts | 36 +++++++++---------- src/services/__tests__/helpers.spec.ts | 8 ++--- src/services/helpers.ts | 12 +++---- tools/constants.ts | 2 +- tools/git-version.ts | 8 ++--- tools/github-release.ts | 4 +-- tools/jira-release.ts | 4 +-- tools/manage-metadata.ts | 10 +++--- tools/move-release-notes.ts | 2 +- yarn.lock | 12 +++---- 63 files changed, 195 insertions(+), 182 deletions(-) diff --git a/.prettierrc b/.prettierrc index ec99dd2ec..6d885b9ce 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,11 +1,12 @@ { + "plugins": ["@trivago/prettier-plugin-sort-imports"], "semi": false, "singleQuote": true, "arrowParens": "avoid", "printWidth": 120, "bracketSameLine": true, "jsxSingleQuote": true, + "endOfLine": "auto", "importOrder": ["^(\\.)+(\\/)+"], - "importOrderSeparation": true, - "endOfLine": "auto" + "importOrderSeparation": true } diff --git a/package.json b/package.json index cd3780c8c..d95962fd8 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "jest-transform-stub": "^2.0.0", "metro-react-native-babel-preset": "^0.77.0", "patch-package": "^8.0.0", - "prettier": "^2.7.1", + "prettier": "^3.2.5", "react-dom": "18.2.0", "react-test-renderer": "18.2.0", "ts-jest": "^29.1.2", diff --git a/src/components/ImageCarousel.tsx b/src/components/ImageCarousel.tsx index 935d99e18..ee93cc72f 100644 --- a/src/components/ImageCarousel.tsx +++ b/src/components/ImageCarousel.tsx @@ -80,7 +80,7 @@ const ImageCarousel = ({ images, minimized = false }: ImageCarouselProps): React !!currentIndex && allSize > 1 && imagesUrls.map((item, index) => - index + 1 === currentIndex ? : + index + 1 === currentIndex ? : , )} ) diff --git a/src/components/ListItem.tsx b/src/components/ListItem.tsx index 97795865f..0b849f907 100644 --- a/src/components/ListItem.tsx +++ b/src/components/ListItem.tsx @@ -159,7 +159,7 @@ const ListItem = ({ } setPressInY(null) }, - [pressInY, updatePressed, onPress] + [pressInY, updatePressed, onPress], ) const titleToRender = diff --git a/src/components/__tests__/CameraOverlay.spec.tsx b/src/components/__tests__/CameraOverlay.spec.tsx index 47defd67b..f2f2585b3 100644 --- a/src/components/__tests__/CameraOverlay.spec.tsx +++ b/src/components/__tests__/CameraOverlay.spec.tsx @@ -14,7 +14,7 @@ describe('CameraOverlay', () => { const { getByTestId, queryByTestId, findByTestId } = render( Children - + , ) const closeIcon = await findByTestId('close-circle-icon-white') expect(closeIcon).toBeDefined() @@ -27,7 +27,7 @@ describe('CameraOverlay', () => { const { findByTestId } = render( Children - + , ) const closeIcon = await findByTestId('close-circle-icon-white') expect(closeIcon).toBeDefined() diff --git a/src/components/__tests__/CustomTextInput.spec.tsx b/src/components/__tests__/CustomTextInput.spec.tsx index 1cca7ef77..9ad827b39 100644 --- a/src/components/__tests__/CustomTextInput.spec.tsx +++ b/src/components/__tests__/CustomTextInput.spec.tsx @@ -8,21 +8,21 @@ describe('CustomTextInput', () => { it('should show placeholder text', () => { const { getByPlaceholderText } = render( - + , ) expect(getByPlaceholderText('Test')).toBeTruthy() }) it('should not show clear indicator with empty input', () => { const { queryByTestId } = render( - + , ) expect(queryByTestId('clearInput')).toBeNull() }) it('should show indicator when input was set', () => { const { getByTestId } = render( - + , ) expect(getByTestId('clearInput')).toBeTruthy() }) diff --git a/src/components/__tests__/ExerciseHeader.spec.tsx b/src/components/__tests__/ExerciseHeader.spec.tsx index 5887328de..4d811b92e 100644 --- a/src/components/__tests__/ExerciseHeader.spec.tsx +++ b/src/components/__tests__/ExerciseHeader.spec.tsx @@ -29,7 +29,7 @@ describe('ExerciseHeader', () => { feedbackType={FeedbackType.vocabularyItem} feedbackForId={1} exerciseKey={ExerciseKeys.vocabularyList} - /> + />, ) expect(getByTestId('customModal')).toBeTruthy() expect(getByTestId('customModal').props.visible).toBe(false) diff --git a/src/components/__tests__/FavoriteButton.spec.tsx b/src/components/__tests__/FavoriteButton.spec.tsx index 5817a8d40..600582c43 100644 --- a/src/components/__tests__/FavoriteButton.spec.tsx +++ b/src/components/__tests__/FavoriteButton.spec.tsx @@ -16,7 +16,7 @@ describe('FavoriteButton', () => { render( - + , ) it('should add favorite on click', async () => { diff --git a/src/components/__tests__/FeedbackModal.spec.tsx b/src/components/__tests__/FeedbackModal.spec.tsx index e1d892578..606ed2f16 100644 --- a/src/components/__tests__/FeedbackModal.spec.tsx +++ b/src/components/__tests__/FeedbackModal.spec.tsx @@ -16,7 +16,7 @@ describe('FeedbackModal', () => { it('should have a disabled send button when message is empty', () => { const { getByText, getByPlaceholderText } = render( - + , ) expect(getByText(getLabels().feedback.sendFeedback)).toBeDisabled() const feedbackInputField = getByPlaceholderText(getLabels().feedback.feedbackPlaceholder) @@ -26,7 +26,7 @@ describe('FeedbackModal', () => { it('should get a cleared feedback text when clear button was clicked', () => { const { getByPlaceholderText, getByTestId } = render( - + , ) const feedbackInputField = getByPlaceholderText(getLabels().feedback.feedbackPlaceholder) fireEvent.changeText(feedbackInputField, 'Mein Feedback') @@ -36,7 +36,7 @@ describe('FeedbackModal', () => { it('should send feedback', () => { const { getByText, getByPlaceholderText } = render( - + , ) const feedbackInputField = getByPlaceholderText(getLabels().feedback.feedbackPlaceholder) const emailInputField = getByPlaceholderText(getLabels().feedback.mailPlaceholder) diff --git a/src/components/__tests__/ListItem.spec.tsx b/src/components/__tests__/ListItem.spec.tsx index cb8504d9f..1021a81e7 100644 --- a/src/components/__tests__/ListItem.spec.tsx +++ b/src/components/__tests__/ListItem.spec.tsx @@ -23,7 +23,7 @@ describe('ListItem', () => { badgeLabel={badge} arrowDisabled={arrowDisabled} disabled={disabled} - /> + />, ) it('should render texts', () => { diff --git a/src/components/__tests__/Loading.spec.tsx b/src/components/__tests__/Loading.spec.tsx index 020e658ad..a5590f6d9 100644 --- a/src/components/__tests__/Loading.spec.tsx +++ b/src/components/__tests__/Loading.spec.tsx @@ -12,7 +12,7 @@ describe('Loading', () => { render( {childText} - + , ) it('should not render children when isLoading is true', () => { diff --git a/src/components/__tests__/NotAuthorisedView.spec.tsx b/src/components/__tests__/NotAuthorisedView.spec.tsx index e9b82e6a5..6e736a2fa 100644 --- a/src/components/__tests__/NotAuthorisedView.spec.tsx +++ b/src/components/__tests__/NotAuthorisedView.spec.tsx @@ -16,7 +16,10 @@ describe('NotAuthorisedView', () => { it('should render description', () => { const { getByText } = render( - + , ) const isNoAuthDescription = getByText(getLabels().general.camera.noAuthorization.description) expect(isNoAuthDescription).toBeTruthy() @@ -24,7 +27,10 @@ describe('NotAuthorisedView', () => { it('should successfully go back', () => { const { getByText } = render( - + , ) const buttonVisible = getByText(getLabels().general.back) fireEvent.press(buttonVisible) @@ -34,7 +40,10 @@ describe('NotAuthorisedView', () => { it('should open settings successfully', () => { mocked(Linking.openSettings).mockImplementationOnce(Promise.resolve) const { getByText } = render( - + , ) const message = getByText(getLabels().settings.settings) fireEvent.press(message) diff --git a/src/components/__tests__/RouteWrapper.spec.tsx b/src/components/__tests__/RouteWrapper.spec.tsx index 4db024c4f..e31065be4 100644 --- a/src/components/__tests__/RouteWrapper.spec.tsx +++ b/src/components/__tests__/RouteWrapper.spec.tsx @@ -14,7 +14,7 @@ describe('RouteWrapper', () => { const { queryByTestId } = render(
- + , ) expect(queryByTestId('hiddenContainer')).toBeDefined() Platform.OS = platform @@ -26,7 +26,7 @@ describe('RouteWrapper', () => { const { queryByTestId } = render(
- + , ) expect(queryByTestId('hiddenContainer')).toBeNull() Platform.OS = platform diff --git a/src/components/__tests__/ServerResponseHandler.spec.tsx b/src/components/__tests__/ServerResponseHandler.spec.tsx index 62596e43b..edc763b9e 100644 --- a/src/components/__tests__/ServerResponseHandler.spec.tsx +++ b/src/components/__tests__/ServerResponseHandler.spec.tsx @@ -14,7 +14,7 @@ describe('ServerResponseHandler', () => { const { getByText } = render( TestContent - + , ) expect(getByText(error.message)).toBeTruthy() @@ -26,7 +26,7 @@ describe('ServerResponseHandler', () => { const { getByTestId } = render( TestContent - + , ) expect(getByTestId('loading')).toBeTruthy() @@ -36,7 +36,7 @@ describe('ServerResponseHandler', () => { const { getByText } = render( TestContent - + , ) expect(getByText('TestContent')).toBeTruthy() diff --git a/src/components/__tests__/VocabularyList.spec.tsx b/src/components/__tests__/VocabularyList.spec.tsx index ac1e42f02..d05edc1bb 100644 --- a/src/components/__tests__/VocabularyList.spec.tsx +++ b/src/components/__tests__/VocabularyList.spec.tsx @@ -28,7 +28,7 @@ describe('VocabularyList', () => { mockUseLoadAsyncWithData(vocabularyItems) const { getByText, getAllByText, getAllByTestId } = render( - + , ) expect(getByText('Title')).toBeTruthy() @@ -43,7 +43,7 @@ describe('VocabularyList', () => { it('should call onItemPress with correct index', () => { const { getByText } = render( - + , ) expect(onItemPress).toHaveBeenCalledTimes(0) diff --git a/src/constants/theme/colors.ts b/src/constants/theme/colors.ts index f308e38c3..bdba3d00d 100644 --- a/src/constants/theme/colors.ts +++ b/src/constants/theme/colors.ts @@ -30,4 +30,4 @@ export const COLORS = { chartColor4: '#D9D9D9', } -export type Color = typeof COLORS[keyof typeof COLORS] +export type Color = (typeof COLORS)[keyof typeof COLORS] diff --git a/src/hooks/helpers.ts b/src/hooks/helpers.ts index 84b283809..39a2c627a 100644 --- a/src/hooks/helpers.ts +++ b/src/hooks/helpers.ts @@ -22,7 +22,7 @@ export type ServerResponseDiscipline = { export const formatDiscipline = ( item: ServerResponseDiscipline, - loadingInfo: DisciplinesRequestParams + loadingInfo: DisciplinesRequestParams, ): Discipline => ({ ...item, numberOfChildren: item.total_discipline_children || item.total_training_sets || item.total_documents, diff --git a/src/hooks/useLoadAsync.ts b/src/hooks/useLoadAsync.ts index a401c67ac..815a68609 100644 --- a/src/hooks/useLoadAsync.ts +++ b/src/hooks/useLoadAsync.ts @@ -5,7 +5,7 @@ export const loadAsync = async ( params: P, setData: (data: T | null) => void, setError: (error: Error | null) => void, - setLoading: (loading: boolean) => void + setLoading: (loading: boolean) => void, ): Promise => { setLoading(true) diff --git a/src/hooks/useLoadVocabularyItems.ts b/src/hooks/useLoadVocabularyItems.ts index 4291b78c0..b4f900581 100644 --- a/src/hooks/useLoadVocabularyItems.ts +++ b/src/hooks/useLoadVocabularyItems.ts @@ -19,7 +19,7 @@ export type VocabularyItemFromServer = { export const formatVocabularyItemFromServer = ( vocabularyItemFromServer: VocabularyItemFromServer, - apiKey?: string + apiKey?: string, ): VocabularyItem => ({ id: vocabularyItemFromServer.id, word: vocabularyItemFromServer.word, @@ -36,7 +36,7 @@ export const formatVocabularyItemFromServer = ( export const formatVocabularyItemsFromServer = ( vocabularyItemFromServers: VocabularyItemFromServer[], - apiKey?: string + apiKey?: string, ): VocabularyItem[] => vocabularyItemFromServers.map(item => formatVocabularyItemFromServer(item, apiKey)) export const loadVocabularyItems = async ({ diff --git a/src/navigation/BottomTabNavigator.tsx b/src/navigation/BottomTabNavigator.tsx index 2d26ac8eb..2851e4b39 100644 --- a/src/navigation/BottomTabNavigator.tsx +++ b/src/navigation/BottomTabNavigator.tsx @@ -41,7 +41,7 @@ const BottomTabNavigator = (): JSX.Element | null => { const { data: isDevMode } = useLoadAsync(getDevMode, null) const { data: numberOfWordsNeedingRepetition, refresh: refreshRepetitionBadge } = useLoadAsync( RepetitionService.getNumberOfWordsNeedingRepetitionWithUpperBound, - undefined + undefined, ) useFocusEffect(refreshRepetitionBadge) diff --git a/src/routes/__tests__/OverlayMenuScreen.spec.tsx b/src/routes/__tests__/OverlayMenuScreen.spec.tsx index 4369fd543..8ab8b3a77 100644 --- a/src/routes/__tests__/OverlayMenuScreen.spec.tsx +++ b/src/routes/__tests__/OverlayMenuScreen.spec.tsx @@ -14,7 +14,7 @@ describe('OverlayMenu', () => { const { getByTestId } = renderWithTheme( - + , ) const close = getByTestId('close-icon-white') expect(close).toBeTruthy() @@ -31,7 +31,7 @@ describe('OverlayMenu', () => { const { getByText } = renderWithTheme( - + , ) const item = getByText(menuItem) diff --git a/src/routes/__tests__/ProfessionSelectionScreen.spec.tsx b/src/routes/__tests__/ProfessionSelectionScreen.spec.tsx index 998a2e52a..c8327567e 100644 --- a/src/routes/__tests__/ProfessionSelectionScreen.spec.tsx +++ b/src/routes/__tests__/ProfessionSelectionScreen.spec.tsx @@ -36,7 +36,7 @@ describe('ProfessionSelectionScreen', () => { mocked(useReadSelectedProfessions).mockReturnValueOnce(getReturnOf(null)) const { findByText, queryAllByTestId } = render( - + , ) expect(await findByText(getLabels().scopeSelection.skipSelection)).toBeDefined() const profession = await findByText(mockDisciplines()[0].title) @@ -56,7 +56,7 @@ describe('ProfessionSelectionScreen', () => { mocked(useReadSelectedProfessions).mockReturnValueOnce(getReturnOf([mockDisciplines()[0].id])) const { findByText, queryAllByTestId } = render( - + , ) expect(await findByText(getLabels().scopeSelection.confirmSelection)).toBeDefined() const profession = await findByText(mockDisciplines()[0].title) diff --git a/src/routes/__tests__/VocabularyListScreen.spec.tsx b/src/routes/__tests__/VocabularyListScreen.spec.tsx index 3637563eb..4fc621468 100644 --- a/src/routes/__tests__/VocabularyListScreen.spec.tsx +++ b/src/routes/__tests__/VocabularyListScreen.spec.tsx @@ -51,7 +51,7 @@ describe('VocabularyListScreen', () => { mockUseLoadAsyncWithData(vocabularyItems) const { getByText, getAllByText, getAllByTestId } = render( - + , ) expect(getByText(getLabels().exercises.vocabularyList.title)).toBeTruthy() diff --git a/src/routes/add-custom-discipline/AddCustomDisciplineScreen.tsx b/src/routes/add-custom-discipline/AddCustomDisciplineScreen.tsx index f437c3167..09dbc91b6 100644 --- a/src/routes/add-custom-discipline/AddCustomDisciplineScreen.tsx +++ b/src/routes/add-custom-discipline/AddCustomDisciplineScreen.tsx @@ -74,7 +74,7 @@ const AddCustomDiscipline = ({ navigation }: AddCustomDisciplineScreenProps): JS setErrorMessage( error.response?.status === HTTP_STATUS_CODE_FORBIDDEN ? getLabels().addCustomDiscipline.error.wrongCode - : getLabels().addCustomDiscipline.error.technical + : getLabels().addCustomDiscipline.error.technical, ) }) .finally(() => setLoading(false)) diff --git a/src/routes/add-custom-discipline/__tests__/AddCustomDisciplineScreen.spec.tsx b/src/routes/add-custom-discipline/__tests__/AddCustomDisciplineScreen.spec.tsx index d32af9c6d..005ae6599 100644 --- a/src/routes/add-custom-discipline/__tests__/AddCustomDisciplineScreen.spec.tsx +++ b/src/routes/add-custom-discipline/__tests__/AddCustomDisciplineScreen.spec.tsx @@ -45,7 +45,7 @@ describe('AddCustomDisciplineScreen', () => { const submitButton = await findByText(getLabels().addCustomDiscipline.submitLabel) fireEvent.press(submitButton) await waitFor(() => - expect(RNAsyncStorage.setItem).toHaveBeenCalledWith('customDisciplines', '["test","another_test_discipline"]') + expect(RNAsyncStorage.setItem).toHaveBeenCalledWith('customDisciplines', '["test","another_test_discipline"]'), ) await waitFor(() => expect(navigation.goBack).toHaveBeenCalled()) }) @@ -63,7 +63,7 @@ describe('AddCustomDisciplineScreen', () => { it('should show wrong-code-error', async () => { const { findByText, getByText, findByPlaceholderText } = render( - + , ) mocked(loadDiscipline).mockRejectedValueOnce({ response: { status: 403 } }) const textField = await findByPlaceholderText(getLabels().addCustomDiscipline.placeholder) diff --git a/src/routes/choice-exercises/ArticleChoiceExerciseScreen.tsx b/src/routes/choice-exercises/ArticleChoiceExerciseScreen.tsx index a51f13988..cf114db61 100644 --- a/src/routes/choice-exercises/ArticleChoiceExerciseScreen.tsx +++ b/src/routes/choice-exercises/ArticleChoiceExerciseScreen.tsx @@ -21,7 +21,7 @@ const ArticleChoiceExerciseScreen = ({ navigation, route }: ArticleChoiceExercis const answerOptions = ARTICLES.filter(it => it.id !== 0 && it.id !== 4) const singularVocabularyItems = vocabularyItems.filter(it => - answerOptions.some(answerOption => JSON.stringify(it.article) === JSON.stringify(answerOption)) + answerOptions.some(answerOption => JSON.stringify(it.article) === JSON.stringify(answerOption)), ) const vocabularyItemToAnswers = (vocabularyItem: VocabularyItem): Answer[] => diff --git a/src/routes/choice-exercises/__tests__/ArticleChoiceExerciseScreen.spec.tsx b/src/routes/choice-exercises/__tests__/ArticleChoiceExerciseScreen.spec.tsx index a3ddb2eb9..46eb94ee4 100644 --- a/src/routes/choice-exercises/__tests__/ArticleChoiceExerciseScreen.spec.tsx +++ b/src/routes/choice-exercises/__tests__/ArticleChoiceExerciseScreen.spec.tsx @@ -74,7 +74,7 @@ describe('ArticleChoiceExerciseScreen', () => { it('should not allow to skip last vocabularyItem', () => { const { queryByText, getByText, getAllByText } = render( - + , ) expect(getAllByText(/Spachtel/)).toHaveLength(3) diff --git a/src/routes/choice-exercises/components/SingleChoiceExercise.tsx b/src/routes/choice-exercises/components/SingleChoiceExercise.tsx index c78d67991..d2f46dfa1 100644 --- a/src/routes/choice-exercises/components/SingleChoiceExercise.tsx +++ b/src/routes/choice-exercises/components/SingleChoiceExercise.tsx @@ -54,7 +54,7 @@ const ChoiceExerciseScreen = ({ const [currentWord, setCurrentWord] = useState(0) const [selectedAnswer, setSelectedAnswer] = useState(null) const [results, setResults] = useState( - shuffleArray(vocabularyItems.map(vocabularyItem => ({ vocabularyItem, result: null, numberOfTries: 0 }))) + shuffleArray(vocabularyItems.map(vocabularyItem => ({ vocabularyItem, result: null, numberOfTries: 0 }))), ) const { vocabularyItem, numberOfTries, result } = results[currentWord] const [answers, setAnswers] = useState(vocabularyItemToAnswer(vocabularyItem)) @@ -70,11 +70,11 @@ const ChoiceExerciseScreen = ({ if (vocabularyItems.length !== results.length || force) { setCurrentWord(0) setResults( - shuffleArray(vocabularyItems.map(vocabularyItem => ({ vocabularyItem, result: null, numberOfTries: 0 }))) + shuffleArray(vocabularyItems.map(vocabularyItem => ({ vocabularyItem, result: null, numberOfTries: 0 }))), ) } }, - [vocabularyItems, results] + [vocabularyItems, results], ) useEffect(initializeExercise, [initializeExercise]) @@ -100,7 +100,7 @@ const ChoiceExerciseScreen = ({ const onExerciseCheated = async (result: SimpleResult): Promise => { await onExerciseFinished( - results.map(it => ({ ...it, numberOfTries: result === SIMPLE_RESULTS.correct ? 1 : numberOfMaxRetries, result })) + results.map(it => ({ ...it, numberOfTries: result === SIMPLE_RESULTS.correct ? 1 : numberOfMaxRetries, result })), ) } diff --git a/src/routes/exercise-finished/__tests__/ExerciseFinishedScreen.spec.tsx b/src/routes/exercise-finished/__tests__/ExerciseFinishedScreen.spec.tsx index e0009a321..e203cd7f4 100644 --- a/src/routes/exercise-finished/__tests__/ExerciseFinishedScreen.spec.tsx +++ b/src/routes/exercise-finished/__tests__/ExerciseFinishedScreen.spec.tsx @@ -17,7 +17,7 @@ describe('ExerciseFinishedScreen', () => { const getRoute = ( exerciseKey: ExerciseKey, correct: boolean, - unlockedNextExercise: boolean + unlockedNextExercise: boolean, ): RouteProp => ({ key: '', name: 'ExerciseFinished', @@ -64,11 +64,11 @@ describe('ExerciseFinishedScreen', () => { const { getByText } = render() expect( getByText( - `${getLabels().results.unlockExercise.part1}, ${EXERCISES[2].title} ${getLabels().results.unlockExercise.part2}` - ) + `${getLabels().results.unlockExercise.part1}, ${EXERCISES[2].title} ${getLabels().results.unlockExercise.part2}`, + ), ).toBeDefined() expect( - getByText(`4 ${getLabels().results.of} 4 ${getLabels().general.words} ${getLabels().results.correct}`) + getByText(`4 ${getLabels().results.of} 4 ${getLabels().general.words} ${getLabels().results.correct}`), ).toBeDefined() const button = getByText(getLabels().results.action.nextExercise) fireEvent.press(button) diff --git a/src/routes/exercises/StandardExercisesScreen.tsx b/src/routes/exercises/StandardExercisesScreen.tsx index 62086ce4b..16b187ebf 100644 --- a/src/routes/exercises/StandardExercisesScreen.tsx +++ b/src/routes/exercises/StandardExercisesScreen.tsx @@ -78,7 +78,7 @@ const StandardExercisesScreen = ({ route, navigation }: ExercisesScreenProps): J getNumberOfUnlockedExercises(disciplineId) .then(value => setNextExercise(value < EXERCISES.length ? EXERCISES[value] : null)) .catch(reportError) - }, [disciplineId]) + }, [disciplineId]), ) useEffect(() => { diff --git a/src/routes/home/components/__tests__/Card.spec.tsx b/src/routes/home/components/__tests__/Card.spec.tsx index e211e4192..2f4ee0fe3 100644 --- a/src/routes/home/components/__tests__/Card.spec.tsx +++ b/src/routes/home/components/__tests__/Card.spec.tsx @@ -11,7 +11,7 @@ describe('Card', () => { const { getByText } = render( children-text - + , ) const heading = getByText('heading') expect(heading).toBeDefined() diff --git a/src/routes/home/components/__tests__/CustomDisciplineDetails.spec.tsx b/src/routes/home/components/__tests__/CustomDisciplineDetails.spec.tsx index 0f1a3e11f..2e4e306d8 100644 --- a/src/routes/home/components/__tests__/CustomDisciplineDetails.spec.tsx +++ b/src/routes/home/components/__tests__/CustomDisciplineDetails.spec.tsx @@ -12,7 +12,7 @@ describe('CustomDisciplineDetails', () => { it('should handle button click', () => { const discipline = mockDisciplines(false)[0] const { getByText } = render( - + , ) const button = getByText(getLabels().home.start) fireEvent.press(button) diff --git a/src/routes/home/components/__tests__/HomeScreenHeader.spec.tsx b/src/routes/home/components/__tests__/HomeScreenHeader.spec.tsx index 85800a693..b656571f0 100644 --- a/src/routes/home/components/__tests__/HomeScreenHeader.spec.tsx +++ b/src/routes/home/components/__tests__/HomeScreenHeader.spec.tsx @@ -13,7 +13,7 @@ describe('HomeScreenHeader', () => { const { getByTestId } = render( - + , ) const menu = getByTestId('menu-icon-white') diff --git a/src/routes/home/components/__tests__/NextExerciseCard.spec.tsx b/src/routes/home/components/__tests__/NextExerciseCard.spec.tsx index 95b88b5ea..4e19b56a7 100644 --- a/src/routes/home/components/__tests__/NextExerciseCard.spec.tsx +++ b/src/routes/home/components/__tests__/NextExerciseCard.spec.tsx @@ -14,7 +14,7 @@ describe('NextExerciseCard', () => { subheading='subheading' buttonLabel='button' onPress={onPress} - /> + />, ) expect(getByText('heading')).toBeDefined() expect(getByText('subheading')).toBeDefined() diff --git a/src/routes/home/components/__tests__/ProfessionDetails.spec.tsx b/src/routes/home/components/__tests__/ProfessionDetails.spec.tsx index 977b7ecf4..9d1b552c4 100644 --- a/src/routes/home/components/__tests__/ProfessionDetails.spec.tsx +++ b/src/routes/home/components/__tests__/ProfessionDetails.spec.tsx @@ -43,7 +43,7 @@ describe('ProfessionDetails', () => { discipline={mockDisciplines()[0]} navigateToDiscipline={navigateToDiscipline} navigateToNextExercise={navigateToExercise} - /> + />, ) it('should show next exercise details on the card', () => { diff --git a/src/routes/process-user-vocabulary/UserVocabularyProcessScreen.tsx b/src/routes/process-user-vocabulary/UserVocabularyProcessScreen.tsx index f184cb843..954731ef7 100644 --- a/src/routes/process-user-vocabulary/UserVocabularyProcessScreen.tsx +++ b/src/routes/process-user-vocabulary/UserVocabularyProcessScreen.tsx @@ -144,7 +144,7 @@ const UserVocabularyProcessScreen = ({ navigation, route }: UserVocabularyProces await moveFile(image, path) } return { id: index, image: path } - }) + }), ) const audioPath = `file:///${DocumentDirectoryPath}/audio-${id}` diff --git a/src/routes/process-user-vocabulary/__tests__/UserVocabularyProcessScreen.spec.tsx b/src/routes/process-user-vocabulary/__tests__/UserVocabularyProcessScreen.spec.tsx index a5b6b16f1..b2991dc1f 100644 --- a/src/routes/process-user-vocabulary/__tests__/UserVocabularyProcessScreen.spec.tsx +++ b/src/routes/process-user-vocabulary/__tests__/UserVocabularyProcessScreen.spec.tsx @@ -63,7 +63,7 @@ describe('UserVocabularyProcessScreen', () => { + />, ) const deleteThumbnail = getByTestId('delete-on-thumbnail') expect(getByText(getLabels().userVocabulary.creation.addImage)).not.toBeDisabled() @@ -76,7 +76,7 @@ describe('UserVocabularyProcessScreen', () => { jest.spyOn(React, 'useState').mockImplementationOnce(() => [['image-1', 'image-2', 'image-3'], setState]) const { getAllByTestId, getByText } = render( - + , ) const a = getAllByTestId('delete-on-thumbnail') expect(a).toHaveLength(3) @@ -97,7 +97,7 @@ describe('UserVocabularyProcessScreen', () => { it('should fill all fields correctly', async () => { const { getByPlaceholderText, getByTestId, getAllByTestId } = render( - + , ) const textField = getByPlaceholderText(getLabels().userVocabulary.creation.wordPlaceholder) expect(textField.props.value).toEqual(itemToEdit.word) @@ -109,7 +109,7 @@ describe('UserVocabularyProcessScreen', () => { it('should keep all fields except word if only word is updated', async () => { const { getByPlaceholderText, getByText } = render( - + , ) const textField = getByPlaceholderText(getLabels().userVocabulary.creation.wordPlaceholder) fireEvent.changeText(textField, 'new-word') @@ -127,7 +127,7 @@ describe('UserVocabularyProcessScreen', () => { jest.spyOn(ReactNativeFS, 'unlink') const { getByText, getAllByTestId } = render( - + , ) expect(getAllByTestId('delete-on-thumbnail')).toHaveLength(2) const deleteThumbnail = getAllByTestId('delete-on-thumbnail')[0] diff --git a/src/routes/process-user-vocabulary/components/AudioRecordOverlay.tsx b/src/routes/process-user-vocabulary/components/AudioRecordOverlay.tsx index b97293fbe..f4b02c46f 100644 --- a/src/routes/process-user-vocabulary/components/AudioRecordOverlay.tsx +++ b/src/routes/process-user-vocabulary/components/AudioRecordOverlay.tsx @@ -110,7 +110,7 @@ const AudioRecordOverlay = ({ const [recordingTime, setRecordingTime] = useState(recordingTimeInit) const [isPressed, setIsPressed] = useState(false) const { permissionGranted, permissionRequested } = useGrantPermissions( - Platform.OS === 'ios' ? PERMISSIONS.IOS.MICROPHONE : PERMISSIONS.ANDROID.RECORD_AUDIO + Platform.OS === 'ios' ? PERMISSIONS.IOS.MICROPHONE : PERMISSIONS.ANDROID.RECORD_AUDIO, ) const { hold, talk } = getLabels().general.audio const { description } = getLabels().general.audio.noAuthorization diff --git a/src/routes/repetition/RepetitionScreen.tsx b/src/routes/repetition/RepetitionScreen.tsx index 216d8874f..ce4b3d2d2 100644 --- a/src/routes/repetition/RepetitionScreen.tsx +++ b/src/routes/repetition/RepetitionScreen.tsx @@ -56,7 +56,7 @@ const HeaderWrapper = styled.View` const IconWrapper = styled.View` position: absolute; left: ${hp('18%')}px; - top: ${hp('0.2%')}px; ; + top: ${hp('0.2%')}px; ` const ModalContainer = styled.View` display: flex; @@ -73,7 +73,7 @@ const RepetitionScreen = ({ navigation }: RepetitionScreenProps): ReactElement = const { repeatWords, repeatNow, wordsToRepeat, yourLearningProgress } = getLabels().repetition const { data: numberOfWordsNeedingRepetition, refresh: refreshNumberOfWordsNeedingRepetition } = useLoadAsync( RepetitionService.getNumberOfWordsNeedingRepetitionWithUpperBound, - undefined + undefined, ) useFocusEffect(refreshNumberOfWordsNeedingRepetition) diff --git a/src/routes/repetition/__tests__/RepetitionScreen.spec.tsx b/src/routes/repetition/__tests__/RepetitionScreen.spec.tsx index 2485b4efa..f0ee1ac8a 100644 --- a/src/routes/repetition/__tests__/RepetitionScreen.spec.tsx +++ b/src/routes/repetition/__tests__/RepetitionScreen.spec.tsx @@ -17,7 +17,7 @@ describe('RepetitionScreen', () => { it('should render screen correctly', async () => { mocked(RepetitionService.getNumberOfWordsNeedingRepetitionWithUpperBound).mockImplementation(() => - Promise.resolve(2) + Promise.resolve(2), ) const { getByText, getByTestId } = render() await waitFor(() => expect(getByText(`2 ${getLabels().repetition.wordsToRepeat}`)).toBeDefined()) diff --git a/src/routes/repetition/components/RepetitionProgressChart.tsx b/src/routes/repetition/components/RepetitionProgressChart.tsx index 420b1d1cf..3cf48afe8 100644 --- a/src/routes/repetition/components/RepetitionProgressChart.tsx +++ b/src/routes/repetition/components/RepetitionProgressChart.tsx @@ -31,7 +31,7 @@ const RepetitionProgressChart: () => ReactElement = () => { useFocusEffect( useCallback(() => { refresh() - }, [refresh]) + }, [refresh]), ) return ( diff --git a/src/routes/vocabulary-detail-exercise/components/__tests__/AlternativeWords.spec.tsx b/src/routes/vocabulary-detail-exercise/components/__tests__/AlternativeWords.spec.tsx index 7072d7ae7..660ebd7a2 100644 --- a/src/routes/vocabulary-detail-exercise/components/__tests__/AlternativeWords.spec.tsx +++ b/src/routes/vocabulary-detail-exercise/components/__tests__/AlternativeWords.spec.tsx @@ -13,8 +13,8 @@ describe('AlternativeWords', () => { expect(getByText(getLabels().exercises.vocabularyList.alternativeWords)).toBeDefined() expect( getByText( - `${vocabularyItems[0].alternatives[0].article.value} ${vocabularyItems[0].alternatives[0].word}, ${vocabularyItems[0].alternatives[1].article.value} ${vocabularyItems[0].alternatives[1].word}` - ) + `${vocabularyItems[0].alternatives[0].article.value} ${vocabularyItems[0].alternatives[0].word}, ${vocabularyItems[0].alternatives[1].article.value} ${vocabularyItems[0].alternatives[1].word}`, + ), ).toBeDefined() expect(getByText(getLabels().exercises.vocabularyList.suggestAlternative)).toBeDefined() }) diff --git a/src/routes/write-exercise/WriteExerciseScreen.tsx b/src/routes/write-exercise/WriteExerciseScreen.tsx index 8dd7fe80e..233716e3e 100644 --- a/src/routes/write-exercise/WriteExerciseScreen.tsx +++ b/src/routes/write-exercise/WriteExerciseScreen.tsx @@ -38,7 +38,7 @@ const WriteExerciseScreen = ({ route, navigation }: WriteExerciseScreenProps): R const [currentIndex, setCurrentIndex] = useState(0) const [isAnswerSubmitted, setIsAnswerSubmitted] = useState(false) const [vocabularyItemWithResults, setVocabularyItemWithResults] = useState( - shuffleArray(vocabularyItems.map(vocabularyItem => ({ vocabularyItem, result: null, numberOfTries: 0 }))) + shuffleArray(vocabularyItems.map(vocabularyItem => ({ vocabularyItem, result: null, numberOfTries: 0 }))), ) const { isKeyboardVisible } = useKeyboard() @@ -53,21 +53,21 @@ const WriteExerciseScreen = ({ route, navigation }: WriteExerciseScreenProps): R navigation, setCurrentIndex, setIsAnswerSubmitted, - setVocabularyItemWithResults + setVocabularyItemWithResults, ) : new StandardWriteExerciseService( route, navigation, setCurrentIndex, setIsAnswerSubmitted, - setVocabularyItemWithResults + setVocabularyItemWithResults, ), - [contentType, route, navigation] + [contentType, route, navigation], ) const initializeExercise = useCallback( () => writeExerciseService.initializeExercise(vocabularyItems, vocabularyItemWithResults), - [vocabularyItems, vocabularyItemWithResults, writeExerciseService] + [vocabularyItems, vocabularyItemWithResults, writeExerciseService], ) useEffect(initializeExercise, [initializeExercise]) @@ -117,7 +117,7 @@ const WriteExerciseScreen = ({ route, navigation }: WriteExerciseScreenProps): R needsToBeRepeated, vocabularyItemWithResults, vocabularyItems, - isKeyboardVisible + isKeyboardVisible, ) } buttonTheme={BUTTONS_THEME.contained} diff --git a/src/routes/write-exercise/__tests__/WriteExerciseScreen.spec.tsx b/src/routes/write-exercise/__tests__/WriteExerciseScreen.spec.tsx index 44eb6ebfe..22262979f 100644 --- a/src/routes/write-exercise/__tests__/WriteExerciseScreen.spec.tsx +++ b/src/routes/write-exercise/__tests__/WriteExerciseScreen.spec.tsx @@ -125,8 +125,8 @@ describe('WriteExerciseScreen', () => { getByText( `${getLabels().exercises.write.feedback.wrong} ${getLabels().exercises.write.feedback.solution} „${ vocabularyItems[1].article.value - } ${vocabularyItems[1].word}“` - ) + } ${vocabularyItems[1].word}“`, + ), ).toBeDefined() expect(getByText(getLabels().exercises.showResults)).toBeDefined() }) @@ -143,8 +143,8 @@ describe('WriteExerciseScreen', () => { getByText( `${getLabels().exercises.write.feedback.almostCorrect1} „${submission}“ ${ getLabels().exercises.write.feedback.almostCorrect2 - }` - ) + }`, + ), ).toBeDefined() fireEvent.press(getByText(getLabels().exercises.write.checkInput)) @@ -153,8 +153,8 @@ describe('WriteExerciseScreen', () => { getByText( `${getLabels().exercises.write.feedback.wrong} ${getLabels().exercises.write.feedback.solution} „${ vocabularyItems[0].article.value - } ${vocabularyItems[0].word}“` - ) + } ${vocabularyItems[0].word}“`, + ), ).toBeDefined() expect(getByText(getLabels().exercises.next)).toBeDefined() }) @@ -205,7 +205,7 @@ describe('WriteExerciseScreen', () => { input, `${getLabels().exercises.write.feedback.almostCorrect1} „${input}“ ${ getLabels().exercises.write.feedback.almostCorrect2 - }` + }`, ) }) @@ -214,7 +214,7 @@ describe('WriteExerciseScreen', () => { 'das Falsche', `${getLabels().exercises.write.feedback.wrong} ${getLabels().exercises.write.feedback.solution} „${ vocabularyItems[0].article.value - } ${vocabularyItems[0].word}“` + } ${vocabularyItems[0].word}“`, ) }) diff --git a/src/routes/write-exercise/components/__tests__/AnswerReview.spec.tsx b/src/routes/write-exercise/components/__tests__/AnswerReview.spec.tsx index 06be6a486..1724abd39 100644 --- a/src/routes/write-exercise/components/__tests__/AnswerReview.spec.tsx +++ b/src/routes/write-exercise/components/__tests__/AnswerReview.spec.tsx @@ -30,8 +30,8 @@ describe('AnswerReview', () => { queryByText( `${getLabels().exercises.write.feedback.almostCorrect1} „${submission}“ ${ getLabels().exercises.write.feedback.almostCorrect2 - }` - ) + }`, + ), ).toBeTruthy() }) @@ -42,8 +42,8 @@ describe('AnswerReview', () => { queryByText( `${getLabels().exercises.write.feedback.wrong} ${getLabels().exercises.write.feedback.solution} „${ vocabularyItem.article.value - } ${vocabularyItem.word}“` - ) + } ${vocabularyItem.word}“`, + ), ).toBeTruthy() }) it('should render incorrect answer review with retries not exceeded', () => { @@ -53,8 +53,8 @@ describe('AnswerReview', () => { queryByText( `${getLabels().exercises.write.feedback.wrong} ${getLabels().exercises.write.feedback.solution} „${ vocabularyItem.article.value - } ${vocabularyItem.word}“` - ) + } ${vocabularyItem.word}“`, + ), ).toBeTruthy() }) }) diff --git a/src/routes/write-exercise/components/__tests__/InteractionSection.spec.tsx b/src/routes/write-exercise/components/__tests__/InteractionSection.spec.tsx index d98658e03..6b334d4ed 100644 --- a/src/routes/write-exercise/components/__tests__/InteractionSection.spec.tsx +++ b/src/routes/write-exercise/components/__tests__/InteractionSection.spec.tsx @@ -46,20 +46,20 @@ describe('InteractionSection', () => { const renderInteractionSection = ( vocabularyItemWithResult: VocabularyItemResult, - isAnswerSubmitted: boolean + isAnswerSubmitted: boolean, ): RenderAPI => render( + />, ) it('should render correctly if not submitted answer yet', () => { const { getByText, getByPlaceholderText } = renderInteractionSection( { vocabularyItem, result: null, numberOfTries: 0 }, - false + false, ) expect(getByText(getLabels().exercises.write.checkInput)).toBeDisabled() expect(getByPlaceholderText(getLabels().exercises.write.insertAnswer)).toBeDefined() @@ -73,7 +73,7 @@ describe('InteractionSection', () => { it('should show popup if article missing', async () => { const { getByText, getByPlaceholderText, getByTestId } = renderInteractionSection( { vocabularyItem, result: null, numberOfTries: 0 }, - false + false, ) const inputField = getByPlaceholderText(getLabels().exercises.write.insertAnswer) fireEvent.changeText(inputField, 'Spachtel') @@ -85,7 +85,7 @@ describe('InteractionSection', () => { it('should show incorrect if word is not correct', async () => { const { rerender, getByText, getByPlaceholderText } = renderInteractionSection( { vocabularyItem, result: null, numberOfTries: 0 }, - false + false, ) const inputField = getByPlaceholderText(getLabels().exercises.write.insertAnswer) fireEvent.changeText(inputField, 'die WrongAnswer') @@ -99,7 +99,7 @@ describe('InteractionSection', () => { vocabularyItemWithResult={vocabularyItemWithResult} isAnswerSubmitted storeResult={storeResult} - /> + />, ) expect(getByText(getLabels().exercises.write.feedback.wrong, { exact: false })).toBeTruthy() }) @@ -107,7 +107,7 @@ describe('InteractionSection', () => { it('should show similar if word is similar', async () => { const { rerender, getByText, getByPlaceholderText } = renderInteractionSection( { vocabularyItem, result: null, numberOfTries: 0 }, - false + false, ) const inputField = getByPlaceholderText(getLabels().exercises.write.insertAnswer) fireEvent.changeText(inputField, 'die Wachtel') @@ -121,7 +121,7 @@ describe('InteractionSection', () => { vocabularyItemWithResult={vocabularyItemWithResult} isAnswerSubmitted storeResult={storeResult} - /> + />, ) expect(getByText(getLabels().exercises.write.feedback.almostCorrect2, { exact: false })).toBeTruthy() }) @@ -129,7 +129,7 @@ describe('InteractionSection', () => { it('should show similar if word is correct and article similar', async () => { const { rerender, getByText, getByPlaceholderText } = renderInteractionSection( { vocabularyItem, result: null, numberOfTries: 0 }, - false + false, ) const inputField = getByPlaceholderText(getLabels().exercises.write.insertAnswer) fireEvent.changeText(inputField, 'das Spachtel') @@ -143,7 +143,7 @@ describe('InteractionSection', () => { vocabularyItemWithResult={vocabularyItemWithResult} isAnswerSubmitted storeResult={storeResult} - /> + />, ) expect(getByText(getLabels().exercises.write.feedback.almostCorrect2, { exact: false })).toBeTruthy() }) @@ -151,7 +151,7 @@ describe('InteractionSection', () => { it('should show correct', async () => { const { rerender, getByText, getByPlaceholderText } = renderInteractionSection( { vocabularyItem, result: null, numberOfTries: 0 }, - false + false, ) const inputField = getByPlaceholderText(getLabels().exercises.write.insertAnswer) fireEvent.changeText(inputField, 'die Spachtel') @@ -165,7 +165,7 @@ describe('InteractionSection', () => { vocabularyItemWithResult={vocabularyItemWithResult} isAnswerSubmitted storeResult={storeResult} - /> + />, ) expect(getByText('Toll, weiter so!', { exact: false })).toBeTruthy() }) @@ -173,7 +173,7 @@ describe('InteractionSection', () => { it('should show correct for divided words', async () => { const { rerender, getByText, getByPlaceholderText } = renderInteractionSection( { vocabularyItem: dividedVocabularyItem, result: null, numberOfTries: 0 }, - false + false, ) const inputField = getByPlaceholderText(getLabels().exercises.write.insertAnswer) fireEvent.changeText(inputField, 'der kontaktlose Spannungsprüfer') @@ -191,7 +191,7 @@ describe('InteractionSection', () => { vocabularyItemWithResult={vocabularyItemWithResult} isAnswerSubmitted storeResult={storeResult} - /> + />, ) expect(getByText('Toll, weiter so!', { exact: false })).toBeTruthy() }) @@ -199,7 +199,7 @@ describe('InteractionSection', () => { it('should show correct for articels starting with an uppercase letter', async () => { const { rerender, getByText, getByPlaceholderText } = renderInteractionSection( { vocabularyItem, result: null, numberOfTries: 0 }, - false + false, ) const inputField = getByPlaceholderText(getLabels().exercises.write.insertAnswer) fireEvent.changeText(inputField, 'Die Spachtel') @@ -213,7 +213,7 @@ describe('InteractionSection', () => { vocabularyItemWithResult={vocabularyItemWithResult} isAnswerSubmitted storeResult={storeResult} - /> + />, ) expect(getByText('Toll, weiter so!', { exact: false })).toBeTruthy() }) diff --git a/src/routes/write-exercise/services/AbstractWriteExerciseService.ts b/src/routes/write-exercise/services/AbstractWriteExerciseService.ts index e9444bc19..9c81e3c77 100644 --- a/src/routes/write-exercise/services/AbstractWriteExerciseService.ts +++ b/src/routes/write-exercise/services/AbstractWriteExerciseService.ts @@ -14,19 +14,19 @@ export default abstract class AbstractWriteExerciseService { public navigation: StackNavigationProp, public setCurrentIndex: React.Dispatch>, public setIsAnswerSubmitted: React.Dispatch>, - public setVocabularyItemWithResults: React.Dispatch> // eslint-disable-next-line no-empty-function + public setVocabularyItemWithResults: React.Dispatch>, // eslint-disable-next-line no-empty-function ) {} initializeExercise = ( vocabularyItems: VocabularyItem[], vocabularyItemWithResults: VocabularyItemResult[], - force = false + force = false, ): void => { if (vocabularyItems.length !== vocabularyItemWithResults.length || force) { this.setCurrentIndex(0) this.setIsAnswerSubmitted(false) this.setVocabularyItemWithResults( - shuffleArray(vocabularyItems.map(vocabularyItem => ({ vocabularyItem, result: null, numberOfTries: 0 }))) + shuffleArray(vocabularyItems.map(vocabularyItem => ({ vocabularyItem, result: null, numberOfTries: 0 }))), ) } } @@ -34,7 +34,7 @@ export default abstract class AbstractWriteExerciseService { tryLater = ( currentIndex: number, isKeyboardVisible: boolean, - vocabularyItemWithResults: VocabularyItemResult[] + vocabularyItemWithResults: VocabularyItemResult[], ): void => { // ImageViewer is not resized correctly if keyboard is not dismissed before going to next vocabularyItem if (isKeyboardVisible) { @@ -51,7 +51,7 @@ export default abstract class AbstractWriteExerciseService { giveUp = async ( vocabularyItemWithResults: VocabularyItemResult[], current: VocabularyItemResult, - currentIndex: number + currentIndex: number, ): Promise => { this.setIsAnswerSubmitted(true) await this.storeResult( @@ -62,7 +62,7 @@ export default abstract class AbstractWriteExerciseService { }, vocabularyItemWithResults, current, - currentIndex + currentIndex, ) } @@ -71,7 +71,7 @@ export default abstract class AbstractWriteExerciseService { needsToBeRepeated: boolean, vocabularyItemWithResults: VocabularyItemResult[], vocabularyItems: VocabularyItem[], - isKeyboardVisible: boolean + isKeyboardVisible: boolean, ): Promise => { this.setIsAnswerSubmitted(false) if (currentIndex === vocabularyItemWithResults.length - 1 && !needsToBeRepeated) { @@ -87,12 +87,12 @@ export default abstract class AbstractWriteExerciseService { result: VocabularyItemResult, vocabularyItemWithResults: VocabularyItemResult[], current: VocabularyItemResult, - currentIndex: number + currentIndex: number, ) => Promise | void abstract cheatExercise: ( result: SimpleResult, vocabularyItems: VocabularyItem[], - vocabularyItemWithResults: VocabularyItemResult[] + vocabularyItemWithResults: VocabularyItemResult[], ) => void abstract finishExercise: (results: VocabularyItemResult[], vocabularyItems: VocabularyItem[]) => Promise } diff --git a/src/routes/write-exercise/services/RepetitionWriteExerciseService.ts b/src/routes/write-exercise/services/RepetitionWriteExerciseService.ts index 46a3f278a..5bd8f2ea5 100644 --- a/src/routes/write-exercise/services/RepetitionWriteExerciseService.ts +++ b/src/routes/write-exercise/services/RepetitionWriteExerciseService.ts @@ -13,7 +13,7 @@ class RepetitionWriteExerciseService extends AbstractWriteExerciseService { result: VocabularyItemResult, vocabularyItemWithResults: VocabularyItemResult[], current: VocabularyItemResult, - currentIndex: number + currentIndex: number, ): Promise => { const updatedVocabularyItemsWithResults = Array.from(vocabularyItemWithResults) if (current.vocabularyItem.id !== result.vocabularyItem.id) { @@ -28,7 +28,7 @@ class RepetitionWriteExerciseService extends AbstractWriteExerciseService { cheatExercise = async ( result: SimpleResult, vocabularyItems: VocabularyItem[], - vocabularyItemWithResults: VocabularyItemResult[] + vocabularyItemWithResults: VocabularyItemResult[], ): Promise => { const cheatedVocabularyItems = vocabularyItemWithResults.map(it => ({ ...it, numberOfTries: 1, result })) /* eslint-disable no-restricted-syntax */ diff --git a/src/routes/write-exercise/services/StandardWriteExerciseService.ts b/src/routes/write-exercise/services/StandardWriteExerciseService.ts index 7cd04426b..7cb07eddf 100644 --- a/src/routes/write-exercise/services/StandardWriteExerciseService.ts +++ b/src/routes/write-exercise/services/StandardWriteExerciseService.ts @@ -24,7 +24,7 @@ class StandardWriteExerciseService extends AbstractWriteExerciseService { needsToBeRepeated: boolean, vocabularyItemWithResults: VocabularyItemResult[], vocabularyItems: VocabularyItem[], - isKeyboardVisible: boolean + isKeyboardVisible: boolean, ): Promise => { this.setIsAnswerSubmitted(false) @@ -41,7 +41,7 @@ class StandardWriteExerciseService extends AbstractWriteExerciseService { result: VocabularyItemResult, vocabularyItemWithResults: VocabularyItemResult[], current: VocabularyItemResult, - currentIndex: number + currentIndex: number, ): void => { const updatedVocabularyItemsWithResults = Array.from(vocabularyItemWithResults) if (current.vocabularyItem.id !== result.vocabularyItem.id) { @@ -55,7 +55,7 @@ class StandardWriteExerciseService extends AbstractWriteExerciseService { cheatExercise = async ( result: SimpleResult, vocabularyItems: VocabularyItem[], - vocabularyItemWithResults: VocabularyItemResult[] + vocabularyItemWithResults: VocabularyItemResult[], ): Promise => { const cheatedVocabularyItems = vocabularyItemWithResults.map(it => ({ ...it, numberOfTries: 1, result })) await this.finishExercise(cheatedVocabularyItems, vocabularyItems) diff --git a/src/routes/write-exercise/services/__tests__/RepetitionWriteExerciseService.spec.ts b/src/routes/write-exercise/services/__tests__/RepetitionWriteExerciseService.spec.ts index 3a8f481a3..15f43e9fa 100644 --- a/src/routes/write-exercise/services/__tests__/RepetitionWriteExerciseService.spec.ts +++ b/src/routes/write-exercise/services/__tests__/RepetitionWriteExerciseService.spec.ts @@ -47,7 +47,7 @@ describe('RepetitionWriteExerciseService', () => { navigation, setCurrentIndex, setIsAnswerSubmitted, - setVocabularyItemWithResults + setVocabularyItemWithResults, ) } @@ -117,13 +117,13 @@ describe('RepetitionWriteExerciseService', () => { vocabularyItemsWithResults[1], vocabularyItemsWithResults[2], vocabularyItemsWithResults[3], - ]) + ]), ) await waitFor(() => expect(RepetitionService.updateWordNodeCard).toHaveBeenCalledWith({ ...vocabularyItemsWithResults[0], numberOfTries: 1, - }) + }), ) }) }) diff --git a/src/routes/write-exercise/services/__tests__/StandardWriteExerciseService.spec.tsx b/src/routes/write-exercise/services/__tests__/StandardWriteExerciseService.spec.tsx index 5d318dcb2..32d6831c0 100644 --- a/src/routes/write-exercise/services/__tests__/StandardWriteExerciseService.spec.tsx +++ b/src/routes/write-exercise/services/__tests__/StandardWriteExerciseService.spec.tsx @@ -46,7 +46,7 @@ describe('StandardWriteExerciseService', () => { navigation, setCurrentIndex, setIsAnswerSubmitted, - setVocabularyItemWithResults + setVocabularyItemWithResults, ) } diff --git a/src/services/AsyncStorage.ts b/src/services/AsyncStorage.ts index afe832f27..6c6555598 100644 --- a/src/services/AsyncStorage.ts +++ b/src/services/AsyncStorage.ts @@ -85,7 +85,7 @@ export const getExerciseProgress = async (): Promise => { export const setExerciseProgress = async ( disciplineId: number, exerciseKey: ExerciseKey, - score: number + score: number, ): Promise => { const savedProgress = await getExerciseProgress() const newScore = Math.max(savedProgress[disciplineId]?.[exerciseKey] ?? score, score) @@ -96,7 +96,7 @@ export const setExerciseProgress = async ( export const saveExerciseProgress = async ( disciplineId: number, exerciseKey: ExerciseKey, - vocabularyItemsWithResults: VocabularyItemResult[] + vocabularyItemsWithResults: VocabularyItemResult[], ): Promise => { const score = calculateScore(vocabularyItemsWithResults) await setExerciseProgress(disciplineId, exerciseKey, score) @@ -116,7 +116,10 @@ const migrateToNewFavoriteFormat = async (): Promise => { return } await setFavorites( - parsedVocabularyItems.map((item: number) => ({ id: item, vocabularyItemType: VOCABULARY_ITEM_TYPES.lunesStandard })) + parsedVocabularyItems.map((item: number) => ({ + id: item, + vocabularyItemType: VOCABULARY_ITEM_TYPES.lunesStandard, + })), ) await AsyncStorage.removeItem(FAVORITES_KEY) } @@ -198,7 +201,7 @@ export const addUserVocabularyItem = async (vocabularyItem: VocabularyItem): Pro export const editUserVocabularyItem = async ( oldUserVocabularyItem: VocabularyItem, - newUserVocabularyItem: VocabularyItem + newUserVocabularyItem: VocabularyItem, ): Promise => { const userVocabulary = await getUserVocabularyItems() const index = userVocabulary.findIndex(item => JSON.stringify(item) === JSON.stringify(oldUserVocabularyItem)) @@ -212,13 +215,13 @@ export const editUserVocabularyItem = async ( export const deleteUserVocabularyItem = async (userVocabularyItem: VocabularyItem): Promise => { const userVocabulary = await getUserVocabularyItems().then(vocab => - vocab.filter(item => JSON.stringify(item) !== JSON.stringify(userVocabularyItem)) + vocab.filter(item => JSON.stringify(item) !== JSON.stringify(userVocabularyItem)), ) const images = userVocabularyItem.images.map(image => image.image) await Promise.all( images.map(async image => { await unlink(image) - }) + }), ) await removeFavorite({ id: userVocabularyItem.id, vocabularyItemType: VOCABULARY_ITEM_TYPES.userCreated }) await setUserVocabularyItems(userVocabulary) diff --git a/src/services/RepetitionService.ts b/src/services/RepetitionService.ts index 9e9c6c02c..94ee459ab 100644 --- a/src/services/RepetitionService.ts +++ b/src/services/RepetitionService.ts @@ -50,7 +50,7 @@ export class RepetitionService { public static getNumberOfWordsNeedingRepetition = (): Promise => this.getWordNodeCards().then( - wordNodeCards => wordNodeCards.filter(item => this.wordNodeCardNeedsRepetition(item)).length + wordNodeCards => wordNodeCards.filter(item => this.wordNodeCardNeedsRepetition(item)).length, ) public static getNumberOfWordsNeedingRepetitionWithUpperBound = async (): Promise => { @@ -61,7 +61,7 @@ export class RepetitionService { public static getNeedsRepetitionScore = (wordNodeCard: WordNodeCard): number => { const daysSinceRepetitionIsNeeded = millisecondsToDays( new Date().valueOf() - - this.addDays(wordNodeCard.inThisSectionSince, daysToStayInASection[wordNodeCard.section]).valueOf() + this.addDays(wordNodeCard.inThisSectionSince, daysToStayInASection[wordNodeCard.section]).valueOf(), ) const daysToStayInThisSectionWithDivideByZeroProtection = Math.max(daysToStayInASection[wordNodeCard.section], 1) return Math.round(daysSinceRepetitionIsNeeded / daysToStayInThisSectionWithDivideByZeroProtection) @@ -97,7 +97,7 @@ export class RepetitionService { await this.getWordNodeCards().then(wordNodeCards => wordNodeCards.forEach(item => { result[item.section] += 1 - }) + }), ) return result } diff --git a/src/services/__tests__/RepetitionService.spec.ts b/src/services/__tests__/RepetitionService.spec.ts index 48d1c6873..7ba574b92 100644 --- a/src/services/__tests__/RepetitionService.spec.ts +++ b/src/services/__tests__/RepetitionService.spec.ts @@ -25,7 +25,7 @@ describe('RepetitionService', () => { section: 5, inThisSectionSince: RepetitionService.addDays( new Date(), - -(daysToStayInASection[5] + 2 * daysToStayInASection[5]) + -(daysToStayInASection[5] + 2 * daysToStayInASection[5]), ), }, { @@ -33,7 +33,7 @@ describe('RepetitionService', () => { section: 2, inThisSectionSince: RepetitionService.addDays( new Date(), - -(daysToStayInASection[2] + daysToStayInASection[3] + 2) + -(daysToStayInASection[2] + daysToStayInASection[3] + 2), ), }, { @@ -41,7 +41,7 @@ describe('RepetitionService', () => { section: 1, inThisSectionSince: RepetitionService.addDays( new Date(), - -(daysToStayInASection[1] + 2 * daysToStayInASection[4]) + -(daysToStayInASection[1] + 2 * daysToStayInASection[4]), ), }, { @@ -74,7 +74,7 @@ describe('RepetitionService', () => { expect(wordNodeCard.word).toEqual(expected[index].word) expect(wordNodeCard.section).toEqual(expected[index].section) expect(milliSecondsToHours(wordNodeCard.inThisSectionSince.valueOf())).toBeCloseTo( - milliSecondsToHours(expected[index].inThisSectionSince.valueOf()) + milliSecondsToHours(expected[index].inThisSectionSince.valueOf()), ) }) } @@ -101,7 +101,7 @@ describe('RepetitionService', () => { ...item, section: item.section === 0 ? 1 : item.section, inThisSectionSince: new Date(), - })) + })), ) await expect(RepetitionService.getNumberOfWordsNeedingRepetitionWithUpperBound()).resolves.toBe(0) }) @@ -111,7 +111,7 @@ describe('RepetitionService', () => { testData.map((item: WordNodeCard) => ({ ...item, inThisSectionSince: new Date(), - })) + })), ) await expect(RepetitionService.getNumberOfWordsNeedingRepetitionWithUpperBound()).resolves.toBe(2) }) @@ -121,7 +121,7 @@ describe('RepetitionService', () => { testData.map((item: WordNodeCard) => ({ ...item, inThisSectionSince: new Date(2000, 1), - })) + })), ) await expect(RepetitionService.getNumberOfWordsNeedingRepetitionWithUpperBound()).resolves.toBe(8) }) @@ -132,10 +132,10 @@ describe('RepetitionService', () => { word: item, section: 0, inThisSectionSince: new Date(), - })) + })), ) await expect(RepetitionService.getNumberOfWordsNeedingRepetitionWithUpperBound()).resolves.toEqual( - MAX_WORD_NODE_CARDS_FOR_ONE_EXERCISE + MAX_WORD_NODE_CARDS_FOR_ONE_EXERCISE, ) }) @@ -148,7 +148,7 @@ describe('RepetitionService', () => { ? RepetitionService.addDays(new Date(), -daysToStayInASection[item.section]) : new Date(), })) - .filter(item => item.section !== 0) + .filter(item => item.section !== 0), ) await expect(RepetitionService.getNumberOfWordsNeedingRepetitionWithUpperBound()).resolves.toBe(4) }) @@ -162,7 +162,7 @@ describe('RepetitionService', () => { ? RepetitionService.addDays(new Date(), -daysToStayInASection[item.section] + 1) : new Date(), })) - .filter(item => item.section !== 0) + .filter(item => item.section !== 0), ) await expect(RepetitionService.getNumberOfWordsNeedingRepetitionWithUpperBound()).resolves.toBe(0) }) @@ -200,7 +200,7 @@ describe('RepetitionService', () => { section: 5, inThisSectionSince: RepetitionService.addDays( new Date(), - -(daysToStayInASection[5] + 2 * daysToStayInASection[5]) + -(daysToStayInASection[5] + 2 * daysToStayInASection[5]), ), } expect(RepetitionService.getNeedsRepetitionScore(word1)).toBe(2) @@ -210,7 +210,7 @@ describe('RepetitionService', () => { section: 4, inThisSectionSince: RepetitionService.addDays( new Date(), - -(daysToStayInASection[4] + 2 * daysToStayInASection[4]) + -(daysToStayInASection[4] + 2 * daysToStayInASection[4]), ), } expect(RepetitionService.getNeedsRepetitionScore(word2)).toBe(2) @@ -236,13 +236,13 @@ describe('RepetitionService', () => { testData.map((item: WordNodeCard) => ({ ...item, inThisSectionSince: new Date(2000, 1), - })) + })), ) await expect(RepetitionService.getWordNodeCardsForNextRepetition()).resolves.toEqual( testData.map((item: WordNodeCard) => ({ ...item, inThisSectionSince: new Date(2000, 1), - })) + })), ) }) @@ -252,7 +252,7 @@ describe('RepetitionService', () => { ...item, section: item.section === 0 ? 1 : item.section, inThisSectionSince: new Date(), - })) + })), ) await expect(RepetitionService.getWordNodeCardsForNextRepetition()).resolves.toHaveLength(0) }) @@ -322,7 +322,7 @@ describe('RepetitionService', () => { section: 0, inThisSectionSince: new Date(), }, - ]) + ]), ) }) @@ -336,7 +336,7 @@ describe('RepetitionService', () => { section: 0, inThisSectionSince: new Date(), }, - ]) + ]), ) }) diff --git a/src/services/__tests__/helpers.spec.ts b/src/services/__tests__/helpers.spec.ts index 74fc76621..46e79aa3a 100644 --- a/src/services/__tests__/helpers.spec.ts +++ b/src/services/__tests__/helpers.spec.ts @@ -148,7 +148,7 @@ describe('helpers', () => { describe('calculateScore', () => { const getVocabularyItemWithResults = ( numberOfTries: [number, number, number, number], - results: [SimpleResult, SimpleResult, SimpleResult, SimpleResult] + results: [SimpleResult, SimpleResult, SimpleResult, SimpleResult], ): VocabularyItemResult[] => { const vocabularyItems = new VocabularyItemBuilder(4).build() return vocabularyItems.map((vocabularyItem, index) => ({ @@ -160,21 +160,21 @@ describe('helpers', () => { it('should calculate score correctly for different number of tries', () => { const score = calculateScore( - getVocabularyItemWithResults([1, 2, 3, 3], ['correct', 'correct', 'correct', 'incorrect']) + getVocabularyItemWithResults([1, 2, 3, 3], ['correct', 'correct', 'correct', 'incorrect']), ) expect(score).toBe(4) }) it('should calculate score correctly for best result', () => { const score = calculateScore( - getVocabularyItemWithResults([1, 1, 1, 1], ['correct', 'correct', 'correct', 'correct']) + getVocabularyItemWithResults([1, 1, 1, 1], ['correct', 'correct', 'correct', 'correct']), ) expect(score).toBe(10) }) it('should calculate score correctly for bad result with similar results', () => { const score = calculateScore( - getVocabularyItemWithResults([3, 3, 3, 3], ['similar', 'incorrect', 'incorrect', 'incorrect']) + getVocabularyItemWithResults([3, 3, 3, 3], ['similar', 'incorrect', 'incorrect', 'incorrect']), ) expect(score).toBe(0) }) diff --git a/src/services/helpers.ts b/src/services/helpers.ts index 3039bd56b..f98b9c0d3 100644 --- a/src/services/helpers.ts +++ b/src/services/helpers.ts @@ -108,7 +108,7 @@ export const getNextExercise = async (profession: Discipline): Promise getNumberOfUnlockedExercisesByProgress(id, progress) < EXERCISES.length + id => getNumberOfUnlockedExercisesByProgress(id, progress) < EXERCISES.length, ) if (!firstUnfinishedDisciplineId) { @@ -141,7 +141,7 @@ export const getProgress = async (profession: Discipline | null): Promise acc + getNumberOfUnlockedExercisesByProgress(leaf, progress), - 0 + 0, ) const totalExercises = profession.leafDisciplines.length * EXERCISES.length return doneExercises / totalExercises @@ -188,7 +188,7 @@ export const calculateScore = (vocabularyItemsWithResults: VocabularyItemResult[ const normalizeSearchString = (searchString: string): string => { const searchStringWithoutArticle = ARTICLES.map(article => article.value).includes( - searchString.split(' ')[0].toLowerCase() + searchString.split(' ')[0].toLowerCase(), ) ? searchString.substring(searchString.indexOf(' ') + 1) : searchString @@ -197,12 +197,12 @@ const normalizeSearchString = (searchString: string): string => { export const matchAlternative = (vocabularyItem: VocabularyItem, searchString: string): boolean => vocabularyItem.alternatives.filter(alternative => - normalizeStrings(alternative.word).toLowerCase().includes(normalizeSearchString(searchString)) + normalizeStrings(alternative.word).toLowerCase().includes(normalizeSearchString(searchString)), ).length > 0 export const getSortedAndFilteredVocabularyItems = ( vocabularyItems: VocabularyItem[] | null, - searchString: string + searchString: string, ): VocabularyItem[] => { const collator = new Intl.Collator('de-De', { sensitivity: 'base', usage: 'sort' }) @@ -216,7 +216,7 @@ export const getSortedAndFilteredVocabularyItems = ( const filteredVocabularyItems = vocabularyItems?.filter( item => normalizeStrings(item.word).toLowerCase().includes(normalizedSearchString) || - matchAlternative(item, normalizedSearchString) + matchAlternative(item, normalizedSearchString), ) return filteredVocabularyItems?.sort((a, b) => collator.compare(getNouns(a.word), getNouns(b.word))) ?? [] } diff --git a/tools/constants.ts b/tools/constants.ts index 404199f5d..3ecbb6087 100644 --- a/tools/constants.ts +++ b/tools/constants.ts @@ -14,7 +14,7 @@ const PLATFORMS = [PLATFORM_IOS, PLATFORM_ANDROID] const MAIN_BRANCH = 'main' type ReleaseInformation = { - platform: typeof PLATFORMS[number] + platform: (typeof PLATFORMS)[number] versionName: string } const tagId = ({ platform, versionName }: ReleaseInformation): string => `${versionName}-${platform}` diff --git a/tools/git-version.ts b/tools/git-version.ts index 149cd66bd..3af8aea00 100755 --- a/tools/git-version.ts +++ b/tools/git-version.ts @@ -47,7 +47,7 @@ type Options = { const commitAndTag = async ( versionName: string, versionCodeString: string, - { deliverinoPrivateKey, owner, repo, branch }: Options + { deliverinoPrivateKey, owner, repo, branch }: Options, ) => { if (branch !== MAIN_BRANCH) { throw new Error(`Version bumps are only allowed on the ${MAIN_BRANCH} branch!`) @@ -90,8 +90,8 @@ const commitAndTag = async ( owner, repo, platform, - }) - ) + }), + ), ) } @@ -100,7 +100,7 @@ program .description('commits the supplied version name and code to github and tags the commit') .requiredOption( '--deliverino-private-key ', - 'private key of the deliverino github app in pem format with base64 encoding' + 'private key of the deliverino github app in pem format with base64 encoding', ) .requiredOption('--owner ', 'owner of the current repository, usually "digitalfabrik"') .requiredOption('--repo ', 'the current repository, should be lunes-app') diff --git a/tools/github-release.ts b/tools/github-release.ts index 1caad8e5a..ee21f2a48 100755 --- a/tools/github-release.ts +++ b/tools/github-release.ts @@ -17,7 +17,7 @@ const githubRelease = async ( platform: string, newVersionName: string, newVersionCode: string, - { deliverinoPrivateKey, owner, repo, releaseNotes, downloadLinks, betaRelease, dryRun }: Options + { deliverinoPrivateKey, owner, repo, releaseNotes, downloadLinks, betaRelease, dryRun }: Options, ) => { const versionCode = parseInt(newVersionCode, 10) if (Number.isNaN(versionCode)) { @@ -53,7 +53,7 @@ program .description('creates a new release for the specified platform') .requiredOption( '--deliverino-private-key ', - 'private key of the deliverino github app in pem format with base64 encoding' + 'private key of the deliverino github app in pem format with base64 encoding', ) .requiredOption('--owner ', 'owner of the current repository, usually "digitalfabrik"') .requiredOption('--repo ', 'the current repository, should be integreat-app') diff --git a/tools/jira-release.ts b/tools/jira-release.ts index b3310c85d..e534a26e2 100755 --- a/tools/jira-release.ts +++ b/tools/jira-release.ts @@ -103,14 +103,14 @@ const createRelease = async ({ newVersionName, accessToken, privateKey, consumer }, } return jiraApi.updateIssue(issueId, issueUpdate, { notifyUsers: false }) - }) + }), ) } program .command('create ') .description( - 'create a new release with the name on jira and assign all issues resolved since the last release' + 'create a new release with the name on jira and assign all issues resolved since the last release', ) .requiredOption('--project-name ', 'the name of the jira project, e.g. integreat-app') .requiredOption('--access-token ', 'version name of the new release') diff --git a/tools/manage-metadata.ts b/tools/manage-metadata.ts index 78ae1c29a..95d84d562 100644 --- a/tools/manage-metadata.ts +++ b/tools/manage-metadata.ts @@ -93,7 +93,7 @@ const formatDevelopmentNotes = (params: { notes: NoteType[]; platforms: string[] const parseReleaseNotes = ({ source, ios, android, production }: ParseOptions): string => { const platforms: string[] = [android ? PLATFORM_ANDROID : undefined, ios ? PLATFORM_IOS : undefined].filter( - (platform): platform is string => !!platform + (platform): platform is string => !!platform, ) if (platforms.length === 0) { @@ -146,19 +146,19 @@ const parseNotesProgram = (options: ParseOptions) => { program .command('parse-release-notes') .description( - 'parse the release notes and outputs the release notes as JSON string and writes them to the specified file' + 'parse the release notes and outputs the release notes as JSON string and writes them to the specified file', ) .option('--ios', 'include release notes for ios') .option('--android', 'include release notes for android') .option( '--production', - 'whether to hide extra information, e.g. issue keys, hidden notes and platforms and prepare the notes for a store. may not be used with multiple platforms.' + 'whether to hide extra information, e.g. issue keys, hidden notes and platforms and prepare the notes for a store. may not be used with multiple platforms.', ) .option('--destination ', 'if specified the parsed notes are saved to the directory') .requiredOption( '--source ', 'the directory of the release notes to parse', - `../${RELEASE_NOTES_DIR}/${UNRELEASED_DIR}` + `../${RELEASE_NOTES_DIR}/${UNRELEASED_DIR}`, ) .action(parseNotesProgram) @@ -195,7 +195,7 @@ program .description('prepare metadata for store') .option( '--override-version-name ', - 'if specified the release notes will be generated from the specified version name instead of the unreleased notes' + 'if specified the release notes will be generated from the specified version name instead of the unreleased notes', ) .action((storeName: string, options: { overrideVersionName: string }) => { try { diff --git a/tools/move-release-notes.ts b/tools/move-release-notes.ts index 7441a29bd..668ef2168 100755 --- a/tools/move-release-notes.ts +++ b/tools/move-release-notes.ts @@ -106,7 +106,7 @@ program .description("move the release notes in 'unreleased' to a new subdirectory ") .requiredOption( '--deliverino-private-key ', - 'private key of the deliverino github app in pem format with base64 encoding' + 'private key of the deliverino github app in pem format with base64 encoding', ) .requiredOption('--owner ', 'owner of the current repository, usually "digitalfabrik"') .requiredOption('--repo ', 'the current repository, usually "lunes-app"') diff --git a/yarn.lock b/yarn.lock index 0200dfdde..33a67cdc3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10712,7 +10712,7 @@ __metadata: metro-react-native-babel-preset: ^0.77.0 normalize-strings: ^1.1.1 patch-package: ^8.0.0 - prettier: ^2.7.1 + prettier: ^3.2.5 react: 18.2.0 react-dom: 18.2.0 react-is: ^18.2.0 @@ -12185,12 +12185,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.7.1": - version: 2.8.8 - resolution: "prettier@npm:2.8.8" +"prettier@npm:^3.2.5": + version: 3.2.5 + resolution: "prettier@npm:3.2.5" bin: - prettier: bin-prettier.js - checksum: 463ea8f9a0946cd5b828d8cf27bd8b567345cf02f56562d5ecde198b91f47a76b7ac9eae0facd247ace70e927143af6135e8cf411986b8cb8478784a4d6d724a + prettier: bin/prettier.cjs + checksum: ea327f37a7d46f2324a34ad35292af2ad4c4c3c3355da07313339d7e554320f66f65f91e856add8530157a733c6c4a897dc41b577056be5c24c40f739f5ee8c6 languageName: node linkType: hard