diff --git a/src/composables/types.js b/src/composables/types.js deleted file mode 100644 index 54e0d5023f..0000000000 --- a/src/composables/types.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @template T - * @typedef {import('@nuxtjs/composition-api').Ref} Ref - */ - -/** - * @template T - * @typedef {import('@nuxtjs/composition-api').ToRefs} ToRefs - */ - -/** - * @template T - * @typedef {import('@nuxtjs/composition-api').Ref | T} MaybeRef - */ - -export default {} diff --git a/src/composables/use-i18n-utilities.js b/src/composables/use-i18n-utilities.ts similarity index 89% rename from src/composables/use-i18n-utilities.js rename to src/composables/use-i18n-utilities.ts index 1364ffa4ed..6bf01203f3 100644 --- a/src/composables/use-i18n-utilities.js +++ b/src/composables/use-i18n-utilities.ts @@ -18,11 +18,7 @@ export function useI18nResultsCount() { const i18n = useI18n() const getLocaleFormattedNumber = useGetLocaleFormattedNumber() - /** - * @param {number} resultsCount - * @returns {string} - */ - const getI18nCount = (resultsCount) => { + const getI18nCount = (resultsCount: number) => { const countKey = resultsCount === 0 ? 'noResult' diff --git a/tsconfig.json b/tsconfig.json index 801d262f5d..c72461ae35 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -88,10 +88,15 @@ "src/components/VModal/VInputModal.vue", "src/pages/feedback.vue", "src/pages/search-help.vue", - "src/composables/types.js", - // This section cannot be converted to TypeScript because it's used in non-TS contexts (like Tailwind configuration) - "src/constants/screens.js", + /** + * Some files from this section cannot be converted to TypeScript because they are + * used in non-TS contexts (like Tailwind configuration). Therefore they're left as + * "vanilla JavaScript" with JSDoc based type annotations. This allows us to check + * them with TypeScript without introducing syntax changes that are not compatible + * with other tools we rely on. + */ + "src/constants/**/*", "src/server-middleware/healthcheck.js" ], "exclude": ["node_modules"],