We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.
Reproduced with the unit tests in this repo, simply add a dot to one of the keys in tests/lib/rules/no-unused-keys.ts.
tests/lib/rules/no-unused-keys.ts
diff --git a/tests/lib/rules/no-unused-keys.ts b/tests/lib/rules/no-unused-keys.ts index b923ba8..cf550b8 100644 --- a/tests/lib/rules/no-unused-keys.ts +++ b/tests/lib/rules/no-unused-keys.ts @@ -25,7 +25,7 @@ new RuleTester({ "link": "@:messages.hello" }, "hello_dio": "hello underscore DIO!", - "hello {name}": "hello {name}!" + "hello {name}.": "hello {name}!" } </i18n> <template> @@ -36,7 +36,7 @@ new RuleTester({ <script> export default { created () { - this.$i18n.t('hello {name}', { name: 'DIO' }) + this.$i18n.t('hello {name}.', { name: 'DIO' }) this.$t('hello') } }
This will now yield:
398 passing (1s) 1 failing 1) no-unused-keys valid <i18n locale="en"> { "hello": "hello world", "messages": { "hello": "hi DIO!", "link": "@:messages.hello" }, "hello_dio": "hello underscore DIO!", "hello {name}.": "hello {name}!" } </i18n> <template> <div id="app"> <p v-t="'hello_dio'">{{ $t('messages.link') }}</p> </div> </template> <script> export default { created () { this.$i18n.t('hello {name}.', { name: 'DIO' }) this.$t('hello') } } </script>: AssertionError [ERR_ASSERTION]: Should have no errors but had 1: [ { ruleId: 'no-unused-keys', severity: 1, message: `unused '["hello {name}."]' key`, line: 10, column: 7, nodeType: null, endLine: 10, endColumn: 22, suggestions: [ [Object] ] } ] + expected - actual -1 +0 at testValidTemplate (node_modules/eslint/lib/rule-tester/rule-tester.js:697:20) at Context.<anonymous> (node_modules/eslint/lib/rule-tester/rule-tester.js:972:29) at processImmediate (node:internal/timers:464:21)
i.e. hello {name}. is reported as unused, even though it's not.
hello {name}.
The text was updated successfully, but these errors were encountered:
Thank you for posting this issue! Probably fix by #256.
Sorry, something went wrong.
Just realized the no-missing-keys rule has exactly the same problem with keys ending on a .. This results in a false positive.
no-missing-keys
Successfully merging a pull request may close this issue.
Reproduced with the unit tests in this repo, simply add a dot to one of the keys in
tests/lib/rules/no-unused-keys.ts
.This will now yield:
i.e.
hello {name}.
is reported as unused, even though it's not.The text was updated successfully, but these errors were encountered: