Skip to content

Commit

Permalink
Update Prettier version
Browse files Browse the repository at this point in the history
  • Loading branch information
ngyikp committed Jan 27, 2024
1 parent 1446756 commit 24e9ad3
Show file tree
Hide file tree
Showing 44 changed files with 97 additions and 88 deletions.
11 changes: 10 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"useTabs": true,
"singleQuote": true,
"bracketSpacing": false
"trailingComma": "es5",
"bracketSpacing": false,
"overrides": [
{
"files": ["devcontainer.json"],
"options": {
"trailingComma": "none"
}
}
]
}
2 changes: 2 additions & 0 deletions flow-typed/react-helmet-async.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @flow strict

declare module 'react-helmet-async' {
declare class HelmetProvider
extends
Expand Down
2 changes: 2 additions & 0 deletions flow-typed/react-hotkeys-hook.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @flow strict

declare module 'react-hotkeys-hook' {
declare type FormTags =
| 'input'
Expand Down
2 changes: 2 additions & 0 deletions flow-typed/react-use.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @flow strict

declare module 'react-use' {
declare function useInterval(callback: () => mixed, delay?: ?number): boolean;

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
4 changes: 2 additions & 2 deletions src/common/CustomSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ type Props<T> = $ReadOnly<{
components?: {
Option?: React$AbstractComponent<
{children: React$Node, data: OptionType<T>, isFocused: boolean, ...},
mixed
mixed,
>,
SingleValue?: React$AbstractComponent<
{children: React$Node, data: OptionType<T>, ...},
mixed
mixed,
>,
},
formatOptionLabel?: (option: OptionType<T>) => React$Node,
Expand Down
6 changes: 3 additions & 3 deletions src/dog/__tests__/drawDogToCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -169,7 +169,7 @@ test.each(DRAWDOG_PRESETS)('$name', async (preset: DrawdogPreset) => {
hat.customImage != null
? await loadImage(
path.resolve(__dirname, '../presets/', hat.customImage)
)
)
: null,
};
})
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/dog/editor/DogHairSelectModalLauncher.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function DogHairSelectModalLauncher({
name: 'None',
color: dogState.hats[0].color,
},
];
];

return {
...convertDogEditorStateToPreset(dogState),
Expand Down
4 changes: 2 additions & 2 deletions src/dog/preview/DogPreview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}),
Expand Down
2 changes: 1 addition & 1 deletion src/dog/preview/DogPreviewWithAutoplayAnimation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Props = $ReadOnly<{
DogPreviewProps,
{
animationIndex: number,
}
},
>,
playAnimations: boolean,
}>;
Expand Down
4 changes: 2 additions & 2 deletions src/dog/testUtil/drawDogToCanvasTestHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/dog/types/DogAnimations.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DOG_ANIMATIONS: Map<
y: number,
ang: number,
}>,
}
},
> = new Map();

DOG_ANIMATIONS.set('idle', {
Expand Down
2 changes: 1 addition & 1 deletion src/header/AppHeaderUndoRedo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ function AppHeaderUndoRedo(props: Props): React$MixedElement {

export default (memo(AppHeaderUndoRedo): React$AbstractComponent<
React$ElementConfig<typeof AppHeaderUndoRedo>,
mixed
mixed,
>);
4 changes: 2 additions & 2 deletions src/levelEditor/CurrentCoordinatesContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down
7 changes: 2 additions & 5 deletions src/levelEditor/LevelDecoAdder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -84,5 +81,5 @@ function LevelDecoAdder(props: Props): React$Node {

export default (memo<Props>(LevelDecoAdder): React$AbstractComponent<
Props,
mixed
mixed,
>);
2 changes: 1 addition & 1 deletion src/levelEditor/LevelInspector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function LevelInspector({

// Sidebar
const [expandedSidebarPanels, setExpandedSidebarPanels] = useState<
Set<SidebarPanel>
Set<SidebarPanel>,
>(new Set(['LEVEL_PROPERTIES', 'OBJECTS']));
const [addingEntityLabel, setAddingEntityLabel] =
useState<?PlaceableType>(null);
Expand Down
2 changes: 1 addition & 1 deletion src/levelEditor/common/LevelLayerDropdownSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function LevelLayerDropdownSelect(props: Props): React$Node {
{
label: string,
options: Array<OptionType<string>>,
}
},
>();

levelIds.forEach((id) => {
Expand Down
2 changes: 1 addition & 1 deletion src/levelEditor/duplicateLevel/DuplicateLevelModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/levelEditor/header/LevelSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
2 changes: 1 addition & 1 deletion src/levelEditor/preview/LevelPreviewCustomDog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ function LevelPreviewCustomDog(props: Props): React$MixedElement {

export default (memo(LevelPreviewCustomDog): React$AbstractComponent<
React$ElementConfig<typeof LevelPreviewCustomDog>,
mixed
mixed,
>);
2 changes: 1 addition & 1 deletion src/levelEditor/preview/LevelPreviewDecos.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ function LevelPreviewDecos(props: Props): React$Node {

export default (memo<Props>(LevelPreviewDecos): React$AbstractComponent<
Props,
mixed
mixed,
>);
2 changes: 1 addition & 1 deletion src/levelEditor/preview/LevelPreviewObjects.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ function LevelPreviewObjects(props: Props): React$Node {

export default (memo<Props>(LevelPreviewObjects): React$AbstractComponent<
Props,
mixed
mixed,
>);
2 changes: 1 addition & 1 deletion src/levelEditor/preview/TransformDiv.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 1 addition & 4 deletions src/levelEditor/sidebar/SidebarEntityAdder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ type Props<EntityType, Data> = $ReadOnly<{
enabled: boolean,
entityType: EntityType,
nameLabel: string,
onAddingEntityLabel: (entity: {
type: EntityType,
data: Data,
}) => mixed,
onAddingEntityLabel: (entity: {type: EntityType, data: Data}) => mixed,
options:
| $ReadOnlyArray<OptionType<Data>>
| $ReadOnlyArray<{
Expand Down
2 changes: 1 addition & 1 deletion src/levelEditor/sidebar/SidebarObjectAdder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ function SidebarObjectAdder(props: Props): React$Node {

export default (memo<Props>(SidebarObjectAdder): React$AbstractComponent<
Props,
mixed
mixed,
>);
2 changes: 1 addition & 1 deletion src/levelEditor/sidebar/SidebarViewMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ function SidebarViewMenu(props: Props): React$Node {

export default (memo<Props>(SidebarViewMenu): React$AbstractComponent<
Props,
mixed
mixed,
>);
2 changes: 1 addition & 1 deletion src/levelEditor/sidebar/objectsList/SidebarDecoList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ function SidebarObjectList(props: Props): React$MixedElement {

export default (memo<Props>(SidebarObjectList): React$AbstractComponent<
Props,
mixed
mixed,
>);
8 changes: 4 additions & 4 deletions src/levelEditor/sidebar/objectsList/SidebarEntityItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Entity, EntityType>
SidebarEntityPropertiesComponentType<Entity, EntityType>,
>,
expandedTime: ?number,
getEntityName: (entity: Entity, filter: string) => string,
Expand All @@ -41,7 +41,7 @@ type Props<

function SidebarEntityItem<
Entity: GameObjectType | DecorationType,
EntityType: GameEntityType
EntityType: GameEntityType,
>(props: Props<Entity, EntityType>): React$Node {
const item = useRef<?HTMLLIElement>(null);

Expand Down Expand Up @@ -136,5 +136,5 @@ function SidebarEntityItem<

export default (memo(SidebarEntityItem): React$AbstractComponent<
React$ElementConfig<typeof SidebarEntityItem>,
mixed
mixed,
>);
Loading

0 comments on commit 24e9ad3

Please sign in to comment.