Skip to content

Commit

Permalink
Update dependency prettier-plugin-tailwindcss to v0.5.11 (#3862)
Browse files Browse the repository at this point in the history
* Update dependency prettier-plugin-tailwindcss to v0.5.11

* Bump precommit `prettier-plugin-tailwindcss` version and update prettier.config.js to use a string instead of require() for importing prettier-plugin-tailwindcss

* Update prettier to v3.x

* Update prettier to v3.x

* Update prettier to v3.x

* Cleanup docs

---------

Co-authored-by: zackdotcat <[email protected]>
  • Loading branch information
openverse-bot and zackkrida authored Mar 4, 2024
1 parent f61fbc5 commit ae60f00
Show file tree
Hide file tree
Showing 18 changed files with 88 additions and 64 deletions.
8 changes: 5 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ repos:

# Use the `.prettierignore` and `.prettier.config.js` files to configure project-specific requirements.
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.1.0
hooks:
- id: prettier
# Must include any plugins defined in prettier.config.js, along with TypeScript and Prettier themselves
# Versions must be manually kept in sync with those in the pnpm-lock.yaml file to prevent drift.
additional_dependencies:
- prettier@2.8.3
- prettier-plugin-tailwindcss@0.3.0
- prettier@3.2.5
- prettier-plugin-tailwindcss@0.5.11
- [email protected]

- repo: https://github.com/koalaman/shellcheck-precommit
Expand Down
2 changes: 1 addition & 1 deletion frontend/.remake/story/remake-name.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Canvas, Meta, Story } from '@storybook/addon-docs';
import { Canvas, Meta, Story } from "@storybook/addon-docs"

import <%= name %> from '~/components/<%= name %>/<%= name %>.vue'

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html {{ HTML_ATTRS }}>
<head {{ HEAD_ATTRS }}>
{{ HEAD }}
Expand Down
32 changes: 24 additions & 8 deletions frontend/src/assets/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
font-family: Inter;
font-style: normal;
font-weight: 400;
src: local("Inter-Regular"), local("Inter Regular"),
src:
local("Inter-Regular"),
local("Inter Regular"),
url("~assets/fonts/Inter-Regular.woff2") format("woff2"),
url("~assets/fonts/Inter-Regular.woff") format("woff");
}
Expand All @@ -34,7 +36,9 @@
font-family: Inter;
font-style: italic;
font-weight: 100 900;
src: local("Inter-Italic"), local("Inter Italic"),
src:
local("Inter-Italic"),
local("Inter Italic"),
url("~assets/fonts/Inter-Italic.woff2") format("woff2"),
url("~assets/fonts/Inter-Italic.woff") format("woff");
}
Expand All @@ -44,7 +48,9 @@
font-family: Inter;
font-style: normal;
font-weight: 600;
src: local("Inter-SemiBold"), local("Inter SemiBold"),
src:
local("Inter-SemiBold"),
local("Inter SemiBold"),
url("~assets/fonts/Inter-SemiBold.woff2") format("woff2"),
url("~assets/fonts/Inter-SemiBold.woff") format("woff");
}
Expand All @@ -54,7 +60,9 @@
font-family: Inter;
font-style: italic;
font-weight: 600;
src: local("Inter-SemiBoldItalic"), local("Inter SemiBoldItalic"),
src:
local("Inter-SemiBoldItalic"),
local("Inter SemiBoldItalic"),
url("~assets/fonts/Inter-SemiBoldItalic.woff2") format("woff2"),
url("~assets/fonts/Inter-SemiBoldItalic.woff") format("woff");
}
Expand All @@ -64,7 +72,9 @@
font-family: Inter;
font-style: normal;
font-weight: 700;
src: local("Inter-Bold"), local("Inter Bold"),
src:
local("Inter-Bold"),
local("Inter Bold"),
url("~assets/fonts/Inter-Bold.woff2") format("woff2"),
url("~assets/fonts/Inter-Bold.woff") format("woff");
}
Expand All @@ -74,7 +84,9 @@
font-family: Inter;
font-style: italic;
font-weight: 700;
src: local("Inter-BoldItalic"), local("Inter BoldItalic"),
src:
local("Inter-BoldItalic"),
local("Inter BoldItalic"),
url("~assets/fonts/Inter-BoldItalic.woff2") format("woff2"),
url("~assets/fonts/Inter-BoldItalic.woff") format("woff");
}
Expand All @@ -85,7 +97,9 @@
font-style: normal;
font-weight: 400;
font-display: swap;
src: local("JetBrainsMono-Regular"), local("JetBrains Mono Regular"),
src:
local("JetBrainsMono-Regular"),
local("JetBrains Mono Regular"),
url("~assets/fonts/JetBrainsMono-Regular.woff2") format("woff2"),
url("~assets/fonts/JetBrainsMono-Regular.woff") format("woff"),
url("~assets/fonts/JetBrainsMono-Regular.otf") format("opentype");
Expand All @@ -95,7 +109,9 @@
font-style: normal;
font-weight: 600;
font-display: swap;
src: local("JetBrainsMono-Bold"), local("JetBrains Mono Bold"),
src:
local("JetBrainsMono-Bold"),
local("JetBrains Mono Bold"),
url("~assets/fonts/JetBrainsMono-Bold.woff2") format("woff2"),
url("~assets/fonts/JetBrainsMono-Bold.woff") format("woff"),
url("~assets/fonts/JetBrainsMono-Bold.otf") format("opentype");
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/VCheckbox/VCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
localCheckedState
? ['bg-white', 'translate-x-[1.125rem]']
: disabled
? ['bg-dark-charcoal-40']
: ['bg-dark-charcoal']
? ['bg-dark-charcoal-40']
: ['bg-dark-charcoal']
"
aria-hidden="true"
/>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/VSearchResultsGrid/VAudioList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export default defineComponent({
return !uiStore.isBreakpoint("sm")
? "s"
: uiStore.isBreakpoint("xl")
? "l"
: "m"
? "l"
: "m"
}
})
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/VSearchResultsGrid/VAudioResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export default defineComponent({
props.kind === "related"
? "VRelatedAudio"
: props.layout === "box"
? "VAllResultsGrid"
: "AudioSearch"
? "VAllResultsGrid"
: "AudioSearch"
sendCustomEvent("AUDIO_INTERACTION", { ...data, component })
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/composables/use-i18n-utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ function getCountKey(resultsCount: number) {
return resultsCount === 0
? "noResult"
: resultsCount >= 10000
? "more"
: "result"
? "more"
: "result"
}

/**
Expand Down
13 changes: 8 additions & 5 deletions frontend/src/data/media-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { AUDIO, type SupportedMediaType } from "~/constants/media"
import type { AxiosResponse } from "axios"

export interface MediaResult<
T extends Media | Media[] | Record<string, Media>
T extends Media | Media[] | Record<string, Media>,
> {
result_count: number
page_count: number
Expand Down Expand Up @@ -38,10 +38,13 @@ class MediaService<T extends Media> {
const mediaResults = <T[]>data.results ?? []
return {
...data,
results: mediaResults.reduce((acc, item) => {
acc[item.id] = decodeMediaData(item, this.mediaType)
return acc
}, {} as Record<string, T>),
results: mediaResults.reduce(
(acc, item) => {
acc[item.id] = decodeMediaData(item, this.mediaType)
return acc
},
{} as Record<string, T>
),
}
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/stores/feature-flag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const useFeatureFlagStore = defineStore(FEATURE_FLAG, {
state: () =>
({
flags: featureData.features,
} as FeatureFlagState),
}) as FeatureFlagState,
getters: {
/**
* Get the state of the named feature, based on config and cookie.
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/stores/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export const useSearchStore = defineStore("search", {
isAnyFilterApplied() {
const filterEntries = Object.entries(this.searchFilters) as [
string,
FilterItem[]
FilterItem[],
][]
return filterEntries.some(([, filterItems]) =>
filterItems.some((filter) => filter.checked)
Expand Down
4 changes: 2 additions & 2 deletions frontend/test/playwright/utils/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export const setContentSwitcherState = async (
!isDesktop
? "#content-settings-button"
: contentSwitcherKind === "filters"
? "#filter-button"
: "#search-type-button"
? "#filter-button"
: "#search-type-button"
)

const isPressed = await getSelectorPressed(buttonLocator)
Expand Down
2 changes: 1 addition & 1 deletion frontend/test/unit/specs/plugins/api-token.server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const getMockContext = ($config: $config = defaultConfig) =>
captureException: jest.fn(),
},
$config: $config,
} as unknown as Context)
}) as unknown as Context

const mockInject = jest.fn()

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
},
"devDependencies": {
"@openverse/eslint-plugin": "workspace:0.0.0",
"prettier": "2.8.8",
"prettier-plugin-tailwindcss": "0.4.1",
"prettier": "3.2.5",
"prettier-plugin-tailwindcss": "0.5.11",
"typescript": "5.2.2",
"vue-tsc": "1.8.27"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { TSESTree } from "@typescript-eslint/utils"
type Options = readonly [
{
reservedPropNames: string[]
}
},
]

const messages = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ tester.run(
data: { eventName: eventName.replace(/'/g, "") },
},
],
} as const)
}) as const
),
...invalidPayloadTypes.map(
(payloadType) =>
Expand All @@ -78,7 +78,7 @@ tester.run(
}
`,
errors: [{ messageId: "emptyPayloadType" }],
} as const)
}) as const
),
...mockReservedPropNames.map(
(propName) =>
Expand All @@ -100,7 +100,7 @@ tester.run(
errors: [
{ messageId: "reservedPayloadPropNames", data: { propName } },
],
} as const)
}) as const
),
...invalidPayloadValueTypes.map(
(payloadPropType) =>
Expand All @@ -115,7 +115,7 @@ tester.run(
}
`,
errors: [{ messageId: "invalidPayloadFormat" }],
} as const)
}) as const
),
],
valid: [
Expand All @@ -129,7 +129,7 @@ tester.run(
${eventName}: never
}
`,
} as const)
}) as const
),
{
...baseTestCase,
Expand Down Expand Up @@ -169,7 +169,7 @@ tester.run(
}
}
`,
} as const)
}) as const
),
],
}
Expand Down
Loading

0 comments on commit ae60f00

Please sign in to comment.