diff --git a/.prettierrc b/.prettierrc index eb7ca14..54356d1 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,14 @@ { "useTabs": true, "singleQuote": true, - "bracketSpacing": false + "trailingComma": "es5", + "bracketSpacing": false, + "overrides": [ + { + "files": ["devcontainer.json"], + "options": { + "trailingComma": "none" + } + } + ] } diff --git a/flow-typed/react-helmet-async.js b/flow-typed/react-helmet-async.js index 2341bab..7b420ec 100644 --- a/flow-typed/react-helmet-async.js +++ b/flow-typed/react-helmet-async.js @@ -1,3 +1,5 @@ +// @flow strict + declare module 'react-helmet-async' { declare class HelmetProvider extends diff --git a/flow-typed/react-hotkeys-hook.js b/flow-typed/react-hotkeys-hook.js index bcb3b46..18df0f3 100644 --- a/flow-typed/react-hotkeys-hook.js +++ b/flow-typed/react-hotkeys-hook.js @@ -1,3 +1,5 @@ +// @flow strict + declare module 'react-hotkeys-hook' { declare type FormTags = | 'input' diff --git a/flow-typed/react-use.js b/flow-typed/react-use.js index dbe0846..df295e4 100644 --- a/flow-typed/react-use.js +++ b/flow-typed/react-use.js @@ -1,3 +1,5 @@ +// @flow strict + declare module 'react-use' { declare function useInterval(callback: () => mixed, delay?: ?number): boolean; diff --git a/index.html b/index.html index 27df7f3..4a00d03 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + diff --git a/package-lock.json b/package-lock.json index 41e33bb..654a1a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "jest": "29.6.1", "jest-environment-jsdom": "29.6.1", "jest-image-snapshot": "6.1.0", - "prettier": "2.8.8", + "prettier": "3.2.4", "vite": "4.4.3", "whatwg-fetch": "3.6.2" }, @@ -10941,15 +10941,15 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", + "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" diff --git a/package.json b/package.json index 7f333e7..1c31189 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "jest": "29.6.1", "jest-environment-jsdom": "29.6.1", "jest-image-snapshot": "6.1.0", - "prettier": "2.8.8", + "prettier": "3.2.4", "vite": "4.4.3", "whatwg-fetch": "3.6.2" }, diff --git a/src/common/CustomSelect.jsx b/src/common/CustomSelect.jsx index 487b31e..1f687d1 100644 --- a/src/common/CustomSelect.jsx +++ b/src/common/CustomSelect.jsx @@ -12,11 +12,11 @@ type Props = $ReadOnly<{ components?: { Option?: React$AbstractComponent< {children: React$Node, data: OptionType, isFocused: boolean, ...}, - mixed + mixed, >, SingleValue?: React$AbstractComponent< {children: React$Node, data: OptionType, ...}, - mixed + mixed, >, }, formatOptionLabel?: (option: OptionType) => React$Node, diff --git a/src/dog/__tests__/drawDogToCanvas.js b/src/dog/__tests__/drawDogToCanvas.js index adfe0a6..446f0ae 100644 --- a/src/dog/__tests__/drawDogToCanvas.js +++ b/src/dog/__tests__/drawDogToCanvas.js @@ -156,7 +156,7 @@ test.each(DRAWDOG_PRESETS)('$name', async (preset: DrawdogPreset) => { preset.customClothesImage != null ? await loadImage( path.resolve(__dirname, '../presets/', preset.customClothesImage) - ) + ) : null, earColor: preset.earColor, expression: preset.expression, @@ -169,7 +169,7 @@ test.each(DRAWDOG_PRESETS)('$name', async (preset: DrawdogPreset) => { hat.customImage != null ? await loadImage( path.resolve(__dirname, '../presets/', hat.customImage) - ) + ) : null, }; }) @@ -178,7 +178,7 @@ test.each(DRAWDOG_PRESETS)('$name', async (preset: DrawdogPreset) => { preset.headSkinImage != null ? await loadImage( path.resolve(__dirname, '../presets/', preset.headSkinImage) - ) + ) : null, skinColor: preset.skinColor, skinOutlineColor: preset.skinOutlineColor, diff --git a/src/dog/editor/DogHairSelectModalLauncher.jsx b/src/dog/editor/DogHairSelectModalLauncher.jsx index cd86743..78d7b30 100644 --- a/src/dog/editor/DogHairSelectModalLauncher.jsx +++ b/src/dog/editor/DogHairSelectModalLauncher.jsx @@ -53,7 +53,7 @@ export default function DogHairSelectModalLauncher({ name: 'None', color: dogState.hats[0].color, }, - ]; + ]; return { ...convertDogEditorStateToPreset(dogState), diff --git a/src/dog/preview/DogPreview.jsx b/src/dog/preview/DogPreview.jsx index 9f32d1c..82cc1a4 100644 --- a/src/dog/preview/DogPreview.jsx +++ b/src/dog/preview/DogPreview.jsx @@ -207,8 +207,8 @@ export default function DogPreview(props: Props): React$Node { typeof hat.hat === 'string' && hatsImages ? hatsImages['hat_' + index] : hat.hat instanceof Image - ? hat.hat - : null, + ? hat.hat + : null, hatLayer2: hatsImages ? hatsImages['hatLayer2_' + index] : null, }; }), diff --git a/src/dog/preview/DogPreviewWithAutoplayAnimation.jsx b/src/dog/preview/DogPreviewWithAutoplayAnimation.jsx index 3872ef6..8f1d820 100644 --- a/src/dog/preview/DogPreviewWithAutoplayAnimation.jsx +++ b/src/dog/preview/DogPreviewWithAutoplayAnimation.jsx @@ -16,7 +16,7 @@ type Props = $ReadOnly<{ DogPreviewProps, { animationIndex: number, - } + }, >, playAnimations: boolean, }>; diff --git a/src/dog/testUtil/drawDogToCanvasTestHelper.js b/src/dog/testUtil/drawDogToCanvasTestHelper.js index 0696a13..dda527f 100644 --- a/src/dog/testUtil/drawDogToCanvasTestHelper.js +++ b/src/dog/testUtil/drawDogToCanvasTestHelper.js @@ -64,8 +64,8 @@ export default async function drawDogToCanvasTestHelper(options: { hatInfo.internalName === 'Custom Hat' && chosenHat.customImage != null ? chosenHat.customImage : hatInfo.imageWithPaddingPath != null - ? await loadImage(hatInfo.imageWithPaddingPath) - : null, + ? await loadImage(hatInfo.imageWithPaddingPath) + : null, hatLayer2: hatInfo.layer2ImagePath != null ? await loadImage(hatInfo.layer2ImagePath) diff --git a/src/dog/types/DogAnimations.js b/src/dog/types/DogAnimations.js index a4fb31b..7249569 100644 --- a/src/dog/types/DogAnimations.js +++ b/src/dog/types/DogAnimations.js @@ -18,7 +18,7 @@ const DOG_ANIMATIONS: Map< y: number, ang: number, }>, - } + }, > = new Map(); DOG_ANIMATIONS.set('idle', { diff --git a/src/header/AppHeaderUndoRedo.jsx b/src/header/AppHeaderUndoRedo.jsx index ae0b9ce..44044df 100644 --- a/src/header/AppHeaderUndoRedo.jsx +++ b/src/header/AppHeaderUndoRedo.jsx @@ -64,5 +64,5 @@ function AppHeaderUndoRedo(props: Props): React$MixedElement { export default (memo(AppHeaderUndoRedo): React$AbstractComponent< React$ElementConfig, - mixed + mixed, >); diff --git a/src/levelEditor/CurrentCoordinatesContext.js b/src/levelEditor/CurrentCoordinatesContext.js index f88af39..91edac0 100644 --- a/src/levelEditor/CurrentCoordinatesContext.js +++ b/src/levelEditor/CurrentCoordinatesContext.js @@ -8,7 +8,7 @@ import convertLevelIdToCoordinates from './util/convertLevelIdToCoordinates'; export function useCurrentCoordinates(): [ ?[number, number, number], - (newCoordinates: [number, number, number]) => mixed + (newCoordinates: [number, number, number]) => mixed, ] { const {levelId} = useParams(); @@ -37,7 +37,7 @@ export function useCurrentCoordinates(): [ export function useCurrentCoordinatesNonNullable(): [ [number, number, number], - (newCoordinates: [number, number, number]) => mixed + (newCoordinates: [number, number, number]) => mixed, ] { const hook = useCurrentCoordinates(); diff --git a/src/levelEditor/LevelDecoAdder.jsx b/src/levelEditor/LevelDecoAdder.jsx index e83a9fb..9725eb9 100644 --- a/src/levelEditor/LevelDecoAdder.jsx +++ b/src/levelEditor/LevelDecoAdder.jsx @@ -7,10 +7,7 @@ import {SPRITES} from './types/SpriteEntities'; import type {SpriteType} from './types/SpriteType'; type Props = $ReadOnly<{ - onAddingEntityLabel: (entity: { - type: 'DECO', - data: SpriteType, - }) => mixed, + onAddingEntityLabel: (entity: {type: 'DECO', data: SpriteType}) => mixed, }>; function LevelDecoAdder(props: Props): React$Node { @@ -84,5 +81,5 @@ function LevelDecoAdder(props: Props): React$Node { export default (memo(LevelDecoAdder): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/levelEditor/LevelInspector.jsx b/src/levelEditor/LevelInspector.jsx index 55633e7..99c9068 100644 --- a/src/levelEditor/LevelInspector.jsx +++ b/src/levelEditor/LevelInspector.jsx @@ -61,7 +61,7 @@ export default function LevelInspector({ // Sidebar const [expandedSidebarPanels, setExpandedSidebarPanels] = useState< - Set + Set, >(new Set(['LEVEL_PROPERTIES', 'OBJECTS'])); const [addingEntityLabel, setAddingEntityLabel] = useState(null); diff --git a/src/levelEditor/common/LevelLayerDropdownSelect.jsx b/src/levelEditor/common/LevelLayerDropdownSelect.jsx index 798b020..abc8782 100644 --- a/src/levelEditor/common/LevelLayerDropdownSelect.jsx +++ b/src/levelEditor/common/LevelLayerDropdownSelect.jsx @@ -39,7 +39,7 @@ export default function LevelLayerDropdownSelect(props: Props): React$Node { { label: string, options: Array>, - } + }, >(); levelIds.forEach((id) => { diff --git a/src/levelEditor/duplicateLevel/DuplicateLevelModal.jsx b/src/levelEditor/duplicateLevel/DuplicateLevelModal.jsx index 5c73e64..a84766e 100644 --- a/src/levelEditor/duplicateLevel/DuplicateLevelModal.jsx +++ b/src/levelEditor/duplicateLevel/DuplicateLevelModal.jsx @@ -27,7 +27,7 @@ export default function DuplicateLevelModal(props: Props): React$Node { useCurrentCoordinatesNonNullable(); const [draftCoordinates, setDraftCoordinates] = useState< - [?number, ?number, ?number] + [?number, ?number, ?number], >([currentCoordinates[0], currentCoordinates[1], currentCoordinates[2]]); const [prevCoordinates, setPrevCoordinates] = useState(currentCoordinates); diff --git a/src/levelEditor/header/LevelSelector.jsx b/src/levelEditor/header/LevelSelector.jsx index fbad253..3077a9f 100644 --- a/src/levelEditor/header/LevelSelector.jsx +++ b/src/levelEditor/header/LevelSelector.jsx @@ -52,7 +52,7 @@ export default function LevelSelector(): React$Node { // Inputs const [draftCoordinates, setDraftCoordinates] = useState< - [?number, ?number, ?number] + [?number, ?number, ?number], >( currentCoordinates ? [currentCoordinates[0], currentCoordinates[1], currentCoordinates[2]] diff --git a/src/levelEditor/preview/LevelPreviewCustomDog.jsx b/src/levelEditor/preview/LevelPreviewCustomDog.jsx index 2c50d83..ed447d6 100644 --- a/src/levelEditor/preview/LevelPreviewCustomDog.jsx +++ b/src/levelEditor/preview/LevelPreviewCustomDog.jsx @@ -28,5 +28,5 @@ function LevelPreviewCustomDog(props: Props): React$MixedElement { export default (memo(LevelPreviewCustomDog): React$AbstractComponent< React$ElementConfig, - mixed + mixed, >); diff --git a/src/levelEditor/preview/LevelPreviewDecos.jsx b/src/levelEditor/preview/LevelPreviewDecos.jsx index 2c6cd8f..3b52a98 100644 --- a/src/levelEditor/preview/LevelPreviewDecos.jsx +++ b/src/levelEditor/preview/LevelPreviewDecos.jsx @@ -103,5 +103,5 @@ function LevelPreviewDecos(props: Props): React$Node { export default (memo(LevelPreviewDecos): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/levelEditor/preview/LevelPreviewObjects.jsx b/src/levelEditor/preview/LevelPreviewObjects.jsx index 6fae92e..b537b8d 100644 --- a/src/levelEditor/preview/LevelPreviewObjects.jsx +++ b/src/levelEditor/preview/LevelPreviewObjects.jsx @@ -104,5 +104,5 @@ function LevelPreviewObjects(props: Props): React$Node { export default (memo(LevelPreviewObjects): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/levelEditor/preview/TransformDiv.jsx b/src/levelEditor/preview/TransformDiv.jsx index febc427..82bbbdc 100644 --- a/src/levelEditor/preview/TransformDiv.jsx +++ b/src/levelEditor/preview/TransformDiv.jsx @@ -171,7 +171,7 @@ export default function TransformDiv({ transform: transforms.length !== 0 ? (centerDiv === true ? 'translate(-50%, -50%) ' : '') + - transforms.join(' ') + transforms.join(' ') : null, transformOrigin, cursor: currentTransformAction === 'MOVE' ? 'move' : 'pointer', diff --git a/src/levelEditor/sidebar/SidebarEntityAdder.jsx b/src/levelEditor/sidebar/SidebarEntityAdder.jsx index e948938..be27aaa 100644 --- a/src/levelEditor/sidebar/SidebarEntityAdder.jsx +++ b/src/levelEditor/sidebar/SidebarEntityAdder.jsx @@ -11,10 +11,7 @@ type Props = $ReadOnly<{ enabled: boolean, entityType: EntityType, nameLabel: string, - onAddingEntityLabel: (entity: { - type: EntityType, - data: Data, - }) => mixed, + onAddingEntityLabel: (entity: {type: EntityType, data: Data}) => mixed, options: | $ReadOnlyArray> | $ReadOnlyArray<{ diff --git a/src/levelEditor/sidebar/SidebarObjectAdder.jsx b/src/levelEditor/sidebar/SidebarObjectAdder.jsx index c33cfa1..3430134 100644 --- a/src/levelEditor/sidebar/SidebarObjectAdder.jsx +++ b/src/levelEditor/sidebar/SidebarObjectAdder.jsx @@ -65,5 +65,5 @@ function SidebarObjectAdder(props: Props): React$Node { export default (memo(SidebarObjectAdder): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/levelEditor/sidebar/SidebarViewMenu.jsx b/src/levelEditor/sidebar/SidebarViewMenu.jsx index 6b81239..a1342fc 100644 --- a/src/levelEditor/sidebar/SidebarViewMenu.jsx +++ b/src/levelEditor/sidebar/SidebarViewMenu.jsx @@ -68,5 +68,5 @@ function SidebarViewMenu(props: Props): React$Node { export default (memo(SidebarViewMenu): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/levelEditor/sidebar/objectsList/SidebarDecoList.jsx b/src/levelEditor/sidebar/objectsList/SidebarDecoList.jsx index 3282f0a..c4ebf1f 100644 --- a/src/levelEditor/sidebar/objectsList/SidebarDecoList.jsx +++ b/src/levelEditor/sidebar/objectsList/SidebarDecoList.jsx @@ -72,5 +72,5 @@ function SidebarObjectList(props: Props): React$MixedElement { export default (memo(SidebarObjectList): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/levelEditor/sidebar/objectsList/SidebarEntityItem.jsx b/src/levelEditor/sidebar/objectsList/SidebarEntityItem.jsx index 3629b00..948d7a1 100644 --- a/src/levelEditor/sidebar/objectsList/SidebarEntityItem.jsx +++ b/src/levelEditor/sidebar/objectsList/SidebarEntityItem.jsx @@ -14,11 +14,11 @@ import styles from './SidebarEntityItem.module.css'; type Props< Entity: GameObjectType | DecorationType, - EntityType: GameEntityType + EntityType: GameEntityType, > = $ReadOnly<{ entity: Entity, entityPropertiesComponent: React$ComponentType< - SidebarEntityPropertiesComponentType + SidebarEntityPropertiesComponentType, >, expandedTime: ?number, getEntityName: (entity: Entity, filter: string) => string, @@ -41,7 +41,7 @@ type Props< function SidebarEntityItem< Entity: GameObjectType | DecorationType, - EntityType: GameEntityType + EntityType: GameEntityType, >(props: Props): React$Node { const item = useRef(null); @@ -136,5 +136,5 @@ function SidebarEntityItem< export default (memo(SidebarEntityItem): React$AbstractComponent< React$ElementConfig, - mixed + mixed, >); diff --git a/src/levelEditor/sidebar/objectsList/SidebarEntityList.jsx b/src/levelEditor/sidebar/objectsList/SidebarEntityList.jsx index 160e8a4..3ea0eed 100644 --- a/src/levelEditor/sidebar/objectsList/SidebarEntityList.jsx +++ b/src/levelEditor/sidebar/objectsList/SidebarEntityList.jsx @@ -14,7 +14,7 @@ import type {ListItemsExpandedReducerAction} from './useListItemsExpandedReducer type Props< Entity: GameObjectType | DecorationType, - EntityType: GameEntityType + EntityType: GameEntityType, > = $ReadOnly<{ dispatchEntitiesListItemsExpanded: ( action: ListItemsExpandedReducerAction @@ -24,7 +24,7 @@ type Props< entityHighlightClassName: string, entityIndexHover: ?number, entityPropertiesComponent: React$ComponentType< - SidebarEntityPropertiesComponentType + SidebarEntityPropertiesComponentType, >, expanded: boolean, getEntityName: (entity: Entity, filter: string) => string, @@ -49,7 +49,7 @@ type Props< export default function SidebarEntityList< Entity: GameObjectType | DecorationType, - EntityType: GameEntityType + EntityType: GameEntityType, >(props: Props): React$MixedElement { const { entities: unfilteredEntities, @@ -87,7 +87,7 @@ export default function SidebarEntityList< .toLowerCase(); return entityName.includes(filterLowercase) ? entity : null; - }) + }) : []; const filteredEntitiesCount = @@ -100,7 +100,7 @@ export default function SidebarEntityList< ? Array.from(expandedUnfilteredEntityIndexes.keys()) : Array.from(expandedUnfilteredEntityIndexes.keys()).filter( (entityIndex) => filteredEntities[entityIndex] != null - ); + ); const unfilteredEntitiesLength = filteredEntities.length; @@ -114,11 +114,11 @@ export default function SidebarEntityList< > {unfilteredEntitiesLength > 0 ? props.name + - ' (' + - (filteredEntitiesCount !== unfilteredEntitiesLength + ' (' + + (filteredEntitiesCount !== unfilteredEntitiesLength ? `${filteredEntitiesCount} of ${unfilteredEntitiesLength} shown` : `${unfilteredEntitiesLength} total`) + - ')' + ')' : 'No ' + props.name.toLowerCase()} diff --git a/src/levelEditor/sidebar/objectsList/SidebarObjectCustomDogLoader.jsx b/src/levelEditor/sidebar/objectsList/SidebarObjectCustomDogLoader.jsx index 141f733..737722d 100644 --- a/src/levelEditor/sidebar/objectsList/SidebarObjectCustomDogLoader.jsx +++ b/src/levelEditor/sidebar/objectsList/SidebarObjectCustomDogLoader.jsx @@ -7,8 +7,8 @@ import type {Props} from '../objectsList/SidebarObjectCustomDog'; import styles from './SidebarObjectCustomDogLoader.module.css'; -const SidebarObjectCustomDog = lazy(() => - import('../objectsList/SidebarObjectCustomDog') +const SidebarObjectCustomDog = lazy( + () => import('../objectsList/SidebarObjectCustomDog') ); export default function SidebarObjectCustomDogLoader(props: Props): React$Node { diff --git a/src/levelEditor/sidebar/objectsList/SidebarObjectList.jsx b/src/levelEditor/sidebar/objectsList/SidebarObjectList.jsx index e2be1f5..8e58ef6 100644 --- a/src/levelEditor/sidebar/objectsList/SidebarObjectList.jsx +++ b/src/levelEditor/sidebar/objectsList/SidebarObjectList.jsx @@ -79,5 +79,5 @@ function SidebarObjectList(props: Props): React$MixedElement { export default (memo(SidebarObjectList): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/levelEditor/sidebar/objectsList/useListItemsExpandedReducer.js b/src/levelEditor/sidebar/objectsList/useListItemsExpandedReducer.js index ee7de68..0d2939a 100644 --- a/src/levelEditor/sidebar/objectsList/useListItemsExpandedReducer.js +++ b/src/levelEditor/sidebar/objectsList/useListItemsExpandedReducer.js @@ -69,7 +69,7 @@ function reducer( export default function useListItemsExpandedReducer(): [ Map, - (action: ListItemsExpandedReducerAction) => void + (action: ListItemsExpandedReducerAction) => void, ] { return useReducer(reducer, new Map()); } diff --git a/src/levelEditor/sidebar/properties/PropertyPaletteInput.jsx b/src/levelEditor/sidebar/properties/PropertyPaletteInput.jsx index 91a0587..9f40caa 100644 --- a/src/levelEditor/sidebar/properties/PropertyPaletteInput.jsx +++ b/src/levelEditor/sidebar/properties/PropertyPaletteInput.jsx @@ -81,5 +81,5 @@ function PropertyPaletteInput({ export default (memo(PropertyPaletteInput): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/levelEditor/sidebar/properties/PropertySelectInput.jsx b/src/levelEditor/sidebar/properties/PropertySelectInput.jsx index a1b02f9..bfa4cb0 100644 --- a/src/levelEditor/sidebar/properties/PropertySelectInput.jsx +++ b/src/levelEditor/sidebar/properties/PropertySelectInput.jsx @@ -48,5 +48,5 @@ function PropertySelectInput({ export default (memo(PropertySelectInput): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/levelEditor/sidebar/properties/SidebarLevelProperties.jsx b/src/levelEditor/sidebar/properties/SidebarLevelProperties.jsx index b305578..c4315f3 100644 --- a/src/levelEditor/sidebar/properties/SidebarLevelProperties.jsx +++ b/src/levelEditor/sidebar/properties/SidebarLevelProperties.jsx @@ -180,5 +180,5 @@ function SidebarLevelProperties(props: Props): React$Node { export default (memo(SidebarLevelProperties): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/levelEditor/toolbar/LevelToolbar.jsx b/src/levelEditor/toolbar/LevelToolbar.jsx index 131400c..77721a3 100644 --- a/src/levelEditor/toolbar/LevelToolbar.jsx +++ b/src/levelEditor/toolbar/LevelToolbar.jsx @@ -131,5 +131,5 @@ function LevelToolbar(props: Props): React$MixedElement { export default (memo(LevelToolbar): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/levelEditor/types/ObjectEditablePropertiesSchema.js b/src/levelEditor/types/ObjectEditablePropertiesSchema.js index 422fc34..33459d9 100644 --- a/src/levelEditor/types/ObjectEditablePropertiesSchema.js +++ b/src/levelEditor/types/ObjectEditablePropertiesSchema.js @@ -11,7 +11,7 @@ import type {EditablePropertiesType} from './EditablePropertiesSchemaType'; const OBJECT_EDITABLE_PROPERTIES_SCHEMA: Map< string, - Array + Array, > = new Map(); OBJECT_EDITABLE_PROPERTIES_SCHEMA.set('objAudioparamsetter', [ diff --git a/src/levelEditor/util/getLevelLabel.js b/src/levelEditor/util/getLevelLabel.js index 2854020..3f771c6 100644 --- a/src/levelEditor/util/getLevelLabel.js +++ b/src/levelEditor/util/getLevelLabel.js @@ -15,8 +15,8 @@ export default function getLevelLabel( ? level.name !== convertCoordinatesToLevelId(coordinates) ? level.name : level.area !== 'none' - ? level.area - : level.palette + ? level.area + : level.palette : ''; return coordinatesText + (sublabel !== '' ? ` (${sublabel})` : ''); diff --git a/src/levelEditor/worldMap/WorldMap.jsx b/src/levelEditor/worldMap/WorldMap.jsx index 167a3fc..da91e0e 100644 --- a/src/levelEditor/worldMap/WorldMap.jsx +++ b/src/levelEditor/worldMap/WorldMap.jsx @@ -28,21 +28,24 @@ export default function WorldMap(): React$Node { ? [maybePlaceholderLevelId] : [] ) - .reduce((previous, levelId) => { - const coordinates = convertLevelIdToCoordinates(levelId); + .reduce( + (previous, levelId) => { + const coordinates = convertLevelIdToCoordinates(levelId); - // check layer - const currentLayer = currentCoordinates ? currentCoordinates[0] : 0; - if (coordinates[0] !== currentLayer) { - return previous; - } + // check layer + const currentLayer = currentCoordinates ? currentCoordinates[0] : 0; + if (coordinates[0] !== currentLayer) { + return previous; + } - minX = Math.min(minX, coordinates[1]); - minY = Math.min(minY, coordinates[2]); + minX = Math.min(minX, coordinates[1]); + minY = Math.min(minY, coordinates[2]); - previous.push(coordinates); - return previous; - }, ([]: Array<[number, number, number]>)) + previous.push(coordinates); + return previous; + }, + ([]: Array<[number, number, number]>) + ) .sort((a, b) => { return sortCompareCoordinates(a, b); }); diff --git a/src/levelEditor/worldMap/WorldMapButton.jsx b/src/levelEditor/worldMap/WorldMapButton.jsx index efa7173..b6cc4cc 100644 --- a/src/levelEditor/worldMap/WorldMapButton.jsx +++ b/src/levelEditor/worldMap/WorldMapButton.jsx @@ -37,7 +37,7 @@ function WorldMapButton(props: Props): React$Node { level.name !== '' ? 'Name: ' + level.name : null, level.area !== '' ? 'Area: ' + level.area : null, level.palette !== '' ? 'Palette: ' + level.palette : null, - ] + ] : []; useEffect(() => { @@ -90,5 +90,5 @@ function WorldMapButton(props: Props): React$Node { export default (memo(WorldMapButton): React$AbstractComponent< Props, - mixed + mixed, >); diff --git a/src/util/shimRequestIdleCallback.js b/src/util/shimRequestIdleCallback.js index d7e1f67..229e98b 100644 --- a/src/util/shimRequestIdleCallback.js +++ b/src/util/shimRequestIdleCallback.js @@ -6,10 +6,7 @@ window.requestIdleCallback = window.requestIdleCallback || function ( - cb: (deadline: { - didTimeout: boolean, - timeRemaining: () => number, - }) => void + cb: (deadline: {didTimeout: boolean, timeRemaining: () => number}) => void ) { const start = Date.now(); diff --git a/vite.config.js b/vite.config.js index 233a34f..45e530d 100644 --- a/vite.config.js +++ b/vite.config.js @@ -35,7 +35,7 @@ export default defineConfig(({command, mode}) => { ? { key: fs.readFileSync(path.resolve(__dirname, env.SSL_KEY_FILE)), cert: fs.readFileSync(path.resolve(__dirname, env.SSL_CRT_FILE)), - } + } : false, port: 3000, @@ -46,7 +46,7 @@ export default defineConfig(({command, mode}) => { host: process.env.GITPOD_WORKSPACE_URL.replace('https://', '3000-'), protocol: 'wss', clientPort: 443, - } + } : true, }, }; @@ -86,7 +86,7 @@ function getServerHeaders(env) { ? process.env.GITPOD_WORKSPACE_URL.replace( 'https://', 'wss://3000-' - ) + ':3000' + ) + ':3000' : '', ].join(' '),