Skip to content

JS-2216 Implement S9145: Vue components should not use the deprecated "vue-class-component" or "vue-property-decorator" libraries - #7721

Merged
guillemsarda merged 3 commits into
masterfrom
JS-2216-new-rule-S9145-avoid-vue-class-component
Aug 10, 2026
Merged

JS-2216 Implement S9145: Vue components should not use the deprecated "vue-class-component" or "vue-property-decorator" libraries#7721
guillemsarda merged 3 commits into
masterfrom
JS-2216-new-rule-S9145-avoid-vue-class-component

Conversation

@guillemsarda

@guillemsarda guillemsarda commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary by Gitar

  • New rules:
    • Implemented S9145 to detect deprecated vue-class-component and vue-property-decorator usage in Vue components
  • Testing:
    • Added fixtures and unit tests for rule S9145 across various Vue project versions

This will update automatically on new commits.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Aug 7, 2026

Copy link
Copy Markdown

JS-2216

Comment thread packages/analysis/src/jsts/rules/S9145/rule.ts
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Ruling Report

No changes to ruling expected issues in this PR

@guillemsarda
guillemsarda requested a review from nathsou August 7, 2026 13:52
@sonarqube-next

sonarqube-next Bot commented Aug 7, 2026

Copy link
Copy Markdown

@nathsou nathsou left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Image

@guillemsarda
guillemsarda merged commit 943e595 into master Aug 10, 2026
46 checks passed
@guillemsarda
guillemsarda deleted the JS-2216-new-rule-S9145-avoid-vue-class-component branch August 10, 2026 09:02
@gitar-bot

gitar-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Implements rule S9145 to detect deprecated vue-class-component and vue-property-decorator usage in Vue components, addressing the default-export import detection issue. Comprehensive unit tests and fixtures have been added.

✅ 1 resolved
Bug: Default-export imports from vue-class-component are not detected

📄 packages/analysis/src/jsts/rules/S9145/rule.ts:34-48 📄 packages/analysis/src/jsts/rules/S9145/rule.ts:88-102 📄 packages/analysis/src/jsts/rules/S9145/rule.ts:129-137
getFullyQualifiedName returns the bare module name ('vue-class-component') for default imports, so it never matches the .Component/.Options/.Vue-suffixed FQNs used here. This misses the canonical (vue-class-component v7 / Vue 2.7) pattern documented in the library's own README: import Component from 'vue-class-component' + @Component on a class, and the import Vue from 'vue-class-component' default base class. Such components go unreported even on Vue >=2.7. Consider matching the bare 'vue-class-component' FQN for the default decorator import (and default base-class import) in addition to the named ones.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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.

2 participants