-
Notifications
You must be signed in to change notification settings - Fork 449
Lint: Start cleanup of the i18n imports #7327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 14 commits
23802f4
7f74ca0
68b3362
7c961ee
895c9f3
c95ccf7
48f3bc1
7dc00f2
e5d4afd
3e4d560
ff6ce88
0bb7179
cff1626
63221b1
41f742a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import path from 'node:path' | ||
|
|
||
| export default { | ||
| './**/*.js': (stagedFiles: string[]) => formatAndEslint(stagedFiles), | ||
|
|
||
| './**/*.{ts,tsx,vue,mts}': (stagedFiles: string[]) => [ | ||
| ...formatAndEslint(stagedFiles), | ||
| 'pnpm typecheck' | ||
| ] | ||
| } | ||
|
|
||
| function formatAndEslint(fileNames: string[]) { | ||
| // Convert absolute paths to relative paths for better ESLint resolution | ||
| const relativePaths = fileNames.map((f) => path.relative(process.cwd(), f)) | ||
| const joinedPaths = relativePaths.map((p) => `"${p}"`).join(' ') | ||
| return [ | ||
| `pnpm exec prettier --cache --write ${joinedPaths}`, | ||
| `pnpm exec oxlint --fix ${joinedPaths}`, | ||
| `pnpm exec eslint --cache --fix --no-warn-ignored ${joinedPaths}` | ||
| ] | ||
| } | ||
DrJKL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -197,14 +197,16 @@ export const i18n = createI18n({ | |
| }) | ||
|
|
||
| /** Convenience shorthand: i18n.global */ | ||
| /** @deprecated use useI18n */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait does useI18n work outside component (setup) context?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll find out! |
||
| export const { t, te, d } = i18n.global | ||
|
|
||
| /** | ||
| * Safe translation function that returns the fallback message if the key is not found. | ||
| * | ||
| * @param key - The key to translate. | ||
| * @param fallbackMessage - The fallback message to use if the key is not found. | ||
| * @deprecated Remove, use the defaultMsg overload | ||
| */ | ||
| export function st(key: string, fallbackMessage: string) { | ||
| return te(key) ? t(key) : fallbackMessage | ||
| return t(key, fallbackMessage) | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.