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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: no-missing-keys rule reports false positive with trailing dot #394

Merged
merged 2 commits into from Jul 22, 2023
Merged

fix: no-missing-keys rule reports false positive with trailing dot #394

merged 2 commits into from Jul 22, 2023

Conversation

wolfgangwalther
Copy link
Contributor

@wolfgangwalther wolfgangwalther commented Jul 4, 2023

(as noted in #260 (comment))

For a translation key like $t('missing.') the parse function from core utilities returns undefined.

Previously this was turned into an empty array which caused all of those paths to be false positives.

If the given key can't be parsed as "path" properly, the correct handling is to treat it as a single item path with the provided string as the only item.

This also revealed another faulty test, where keypath="'hello'" was passing even though it should not.

@changeset-bot
Copy link

changeset-bot bot commented Jul 4, 2023

🦋 Changeset detected

Latest commit: f578426

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@intlify/eslint-plugin-vue-i18n Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

wolfgangwalther and others added 2 commits July 22, 2023 10:53
For a translation key like $t('missing.') the parse function from core utilities returns undefined.

Previously this was turned into an empty array which caused all of those paths to be false positives.

If the given key can't be parsed as "path" properly, the correct handling is to treat it as a single item path with the provided string as the only item.

This also revealed another faulty test, where keypath="'hello'" was passing even though it should not.
Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@ota-meshi ota-meshi merged commit 3774e88 into intlify:master Jul 22, 2023
12 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants