Commit 3774e88
fix: no-missing-keys rule reports false positive with trailing dot (#394)
* fix: no-missing-keys rule reports false positive with trailing dot
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.
* Create forty-tools-dream.md
---------
Co-authored-by: Yosuke Ota <otameshiyo23@gmail.com>1 parent 5a90ce5 commit 3774e88
File tree
3 files changed
+14
-2
lines changed- .changeset
- lib/utils
- tests/lib/rules
3 files changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
274 | 281 | | |
275 | 282 | | |
276 | 283 | | |
| |||
0 commit comments