-
-
Notifications
You must be signed in to change notification settings - Fork 628
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
error Unsafe assignment of an any
value
#2011
Comments
workaraound: - console.log("hoge: ", i18next.t("d", { val: i18next.t("a") }));
+ console.log("hoge: ", i18next.t("d", { val: i18next.t("a") as string })); |
@adrai Thank you for reply. It's true that the errors can be resolved with that workaround, but what concerns me is whether the change from string type to any type aligns with the implementer's intention. If this is intentional, it's going to be tough, but I plan to make the necessary adjustments in the parts where i18next is being used. If it's not intentional and can be addressed on the i18next side, I intend to wait for that. |
Need to wait for @pedrodurek feedback |
What version of Typescript are you using? Using v5 fixed the error for me (see: #2008) |
https://github.com/koji--/i18n-test/blob/main/package.json#L32
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm experiencing a similar issue, with ESLint complaining about using an Previously I've worked around it by doing EDIT: if it makes a difference, I'm fetching the translations at runtime using |
I'm still experiencing the same ESLint error with v23.5.0. I realise this GitHub issue was originally about the second argument of the I've tried to recreate a somewhat minimal repro here: https://codesandbox.io/s/pensive-feather-lwwpwz?file=/src/App.tsx:222-270. Unfortunately I haven't managed ESLint to bring the said error forward, but the question remains, why does the result from the |
@marcalexiei Thank you. I also solved it with v23.5.0. |
@jbanulso Actually, I'm having the same error with a different cause. I'm going to see if I can create an issue for that, but it seems like it would be a good idea for you to create a separate issue as well. |
💥 Regression Report
When update from v22.5.1 to v23.4.1, eslint gives title error.
When embedding a value in the second argument of the
t()
function, if there was a place where thet()
function was used, it seemed to cause an error.Last working version
Worked up to version: 22.5.1
Stopped working in version: 23.4.1(Probably from 23.0.0)
To Reproduce
Steps to reproduce the behavior:
I am trying in the following environment.
https://github.com/koji--/i18n-test
Expected behavior
No errors in eslint like it did with v22.5.1.
Your Environment
The text was updated successfully, but these errors were encountered: