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

feat: add no-deprecated-v-t rule #580

Merged
merged 6 commits into from
Dec 9, 2024
Merged

Conversation

kazupon
Copy link
Member

@kazupon kazupon commented Dec 6, 2024

background

In vue-i18n v11, v-t custom directive is going to deprecated.
vue-i18n has already published docs for breaking changes.
https://vue-i18n.intlify.dev/guide/migration/breaking11.html#deprecate-custom-directive-v-t

This rule supports migration.

Copy link

changeset-bot bot commented Dec 6, 2024

🦋 Changeset detected

Latest commit: 7e22f02

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 Minor

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

@kazupon kazupon added the Type: Feature Includes new features label Dec 6, 2024
Copy link

cloudflare-workers-and-pages bot commented Dec 6, 2024

Deploying eslint-plugin-vue-i18n with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7e22f02
Status: ✅  Deploy successful!
Preview URL: https://4efd1375.eslint-plugin-vue-i18n.pages.dev
Branch Preview URL: https://feat-no-deprecated-v-t.eslint-plugin-vue-i18n.pages.dev

View logs

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.

The rule seem good, but I have some comments regarding maintenance.

---
title: '@intlify/vue-i18n/no-deprecated-v-t'
description: disallow using deprecated `v-t` custom directive (Deprecated in Vue I18n 11.0.0, removed fully in Vue I18n 12.0.0)
since: v3.2.0
Copy link
Member

Choose a reason for hiding this comment

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

This should be added automatically upon release.

Suggested change
since: v3.2.0

'disallow using deprecated `v-t` custom directive (Deprecated in Vue I18n 11.0.0, removed fully in Vue I18n 12.0.0)',
category: 'Recommended',
url: 'https://eslint-plugin-vue-i18n.intlify.dev/rules/no-deprecated-v-t.html',
recommended: true
Copy link
Member

Choose a reason for hiding this comment

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

Changing shareable configuration may be considered a breaking change.

Suggested change
recommended: true
recommended: false

I think that in the next major version we can clarify the versioning policy and allow configuration to change in minor versions. v10 of eslint-plugin-vue will do that too.

vuejs/eslint-plugin-vue#2630

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that in the next major version we can clarify the versioning policy and allow configuration to change in minor versions. v10 of eslint-plugin-vue will do that too.

I agree too.
eslint-plugin-vue-i18n have not had versioning policy so far.
We should define it.

})

tester.run('no-deprecated-v-t', rule as never, {
valid: [],
Copy link
Member

Choose a reason for hiding this comment

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

Just to be sure, could you add a test case to verify that other directives are not detected?

@kazupon
Copy link
Member Author

kazupon commented Dec 8, 2024

@ota-meshi
Thank you for your reviewing!
I've just fixed your review comments.

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 14dfda5 into master Dec 9, 2024
14 checks passed
@ota-meshi ota-meshi deleted the feat/no-deprecated-v-t branch December 9, 2024 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Includes new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants