Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

@i18next-parser-warning-ignore tag #657

Open
soullivaneuh opened this issue Oct 18, 2022 · 1 comment
Open

@i18next-parser-warning-ignore tag #657

soullivaneuh opened this issue Oct 18, 2022 · 1 comment

Comments

@soullivaneuh
Copy link

soullivaneuh commented Oct 18, 2022

馃殌 Feature Proposal

Provide a @i18next-parser-warning-ignore (or equivalent if you don't like that name ha ha!) comment tag that will silent a warning on a specific code line.

Motivation

For specific reasons, we may have sometime to use dynamic key and then say good bye to the automatic generation.

However, the only way to keep the parser working is to completely ignore any warning by setting failOnWarnings to false.

Deactivate this is not ideal because we are not able anymore to spot some not authorized variable key usage during merge requests review processing.

Using this tag will allow us to be more flexible without losing this security.

Example

const key = 'foo';
const { t } = useTranslation();
// @i18next-parser-warning-ignore
t(key);
@soullivaneuh
Copy link
Author

As an another alternative, we may also provide a ignoreNamespaces option. Indeed, we dedicated our dynamic key usage on a specific catalog named validation (see here for the usage).

Ignoring the complete namespace may also fit our needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant