Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Pre-commit fails if locale files are not loaded #1598

Closed
1 task done
obulat opened this issue Aug 1, 2022 · 0 comments · Fixed by #1599
Closed
1 task done

Pre-commit fails if locale files are not loaded #1598

obulat opened this issue Aug 1, 2022 · 0 comments · Fixed by #1599
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon

Comments

@obulat
Copy link
Contributor

obulat commented Aug 1, 2022

First reported by @ritesh-pandey.

Description

Pre-commit hooks try to run tests and fail if the locale files do not exist.

Reproduction

  1. Remove all untracked files inside the src/locales/ folder, if you have any (in particular, delete the src/locales/ar.json file).
  2. Try making some changes and committing them using `git commit -m "Commit message".
  3. Commit fails with the following error:
test/playwright/utils/navigation.ts:15:25 - error TS2307: Cannot find module '~/locales/ar.json' or its corresponding type declarations.

15 import rtlMessages from '~/locales/ar.json'
                          ~~~~~~~~~~~~~~~~~~~


Found 1 error in test/playwright/utils/navigation.ts:15

 ELIFECYCLE  Command failed with exit code 2.
husky - pre-commit hook exited with code 1 (error)

Additional context

If you run pnpm dev or pnpm i18n, locale files are loaded, and pre-commit hooks succeed even without this change.

Resolution

  • 🙋 I would be interested in resolving this bug.
@obulat obulat added 🟨 priority: medium Not blocking but should be addressed soon 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository labels Aug 1, 2022
@obulat obulat self-assigned this Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant