Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: intlify/eslint-plugin-vue-i18n
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.0-next.5
Choose a base ref
...
head repository: intlify/eslint-plugin-vue-i18n
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.0-next.6
Choose a head ref
  • 4 commits
  • 6 files changed
  • 5 contributors

Commits on Jan 22, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    79c6aa7 View commit details

Commits on Jan 23, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    13e7d06 View commit details

Commits on Feb 20, 2024

  1. fix: adds I18nT keyword into key collection (#471)

    * fix: adds I18nT keyword into key collection
    
    * Create khaki-eyes-serve.md
    
    * refactor: replace lowercase node name with pascal case raw name
    
    ---------
    
    Co-authored-by: Yosuke Ota <otameshiyo23@gmail.com>
    advisciglio and ota-meshi authored Feb 20, 2024
    Copy the full SHA
    a12cbec View commit details
  2. chore: release @intlify/eslint-plugin-vue-i18n (next) (#473)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Feb 20, 2024
    Copy the full SHA
    4eb031d View commit details
Showing with 36 additions and 5 deletions.
  1. +5 −0 .changeset/khaki-eyes-serve.md
  2. +1 −0 .changeset/pre.json
  3. +6 −0 CHANGELOG.md
  4. +6 −3 lib/utils/collect-keys.ts
  5. +2 −2 package.json
  6. +16 −0 tests/lib/rules/no-unused-keys.ts
5 changes: 5 additions & 0 deletions .changeset/khaki-eyes-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@intlify/eslint-plugin-vue-i18n": minor
---

fix: adds I18nT keyword into key collection
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
"changesets": [
"forty-tools-dream",
"fresh-squids-build",
"khaki-eyes-serve",
"olive-chairs-invent",
"shiny-colts-search",
"ten-insects-deny"
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## 3.0.0-next.2

## 3.0.0-next.6

### Minor Changes

- [#471](https://github.com/intlify/eslint-plugin-vue-i18n/pull/471) [`a12cbec`](https://github.com/intlify/eslint-plugin-vue-i18n/commit/a12cbecf17a9886076da6c31db4d219a5c176d70) Thanks [@advisciglio](https://github.com/advisciglio)! - fix: adds I18nT keyword into key collection

## 3.0.0-next.5

### Minor Changes
9 changes: 6 additions & 3 deletions lib/utils/collect-keys.ts
Original file line number Diff line number Diff line change
@@ -212,11 +212,14 @@ export function collectKeysFromAST(
if (
(node.key.name === 'path' &&
(node.parent.parent.name === 'i18n' ||
node.parent.parent.name === 'i18n-t')) ||
(node.key.name === 'keypath' && node.parent.parent.name === 'i18n-t')
node.parent.parent.name === 'i18n-t' ||
node.parent.parent.rawName === 'I18nT')) ||
(node.key.name === 'keypath' &&
(node.parent.parent.name === 'i18n-t' ||
node.parent.parent.rawName === 'I18nT'))
) {
debug(
"call VElement:matches([name=i18n], [name=i18n-t]) > VStartTag > VAttribute[key.name='path'] handling ..."
"call VElement:matches([name=i18n], [name=i18n-t], [name=I18nT]) > VStartTag > VAttribute[key.name='path'] handling ..."
)

const key = getKeyFromI18nComponent(node)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@intlify/eslint-plugin-vue-i18n",
"description": "ESLint plugin for Vue I18n",
"version": "3.0.0-next.5",
"version": "3.0.0-next.6",
"license": "MIT",
"homepage": "https://github.com/intlify/eslint-plugin-vue-i18n#readme",
"keywords": [
@@ -29,7 +29,7 @@
"engines": {
"node": ">=16.0.0"
},
"packageManager": "pnpm@8.14.1",
"packageManager": "pnpm@8.14.3",
"type": "commonjs",
"files": [
"dist"
16 changes: 16 additions & 0 deletions tests/lib/rules/no-unused-keys.ts
Original file line number Diff line number Diff line change
@@ -94,6 +94,22 @@ new RuleTester({
</i18n>
`
},
{
// <I18nT> component
filename: 'test.vue',
code: `
<template>
<I18nT keypath="message_key" tag="p" />
</template>
<i18n>
{
"en": {
"message_key": "hi"
}
}
</i18n>
`
},
{
// yaml supports
filename: 'test.vue',