Skip to content

fix(noCommaOperator): disable rule in vue template expressions#9074

Merged
dyc3 merged 1 commit intomainfrom
dyc3/ignore-no-comma-operator-in-vue
Feb 15, 2026
Merged

fix(noCommaOperator): disable rule in vue template expressions#9074
dyc3 merged 1 commit intomainfrom
dyc3/ignore-no-comma-operator-in-vue

Conversation

@dyc3
Copy link
Copy Markdown
Contributor

@dyc3 dyc3 commented Feb 14, 2026

Summary

This PR is a hack that disables the noCommaOperator rule specifically in template expressions in vue files. The reason I chose to do this hack instead of the real fix (#8062) is because its a bit complicated, and I don't want this issue to block the 2.4 release. I also know that this specific v-for syntax is rather common. My test codebase had 14 false positives, despite it being relatively small compared to an enterprise codebase.

I've opened a new issue as a follow up task to remove this hack when v-for is parsed better. #9075

Generated by kimi k2.5. No changeset because the affected behavior has not been released yet.

fixes #9069

Test Plan

Added 2 cli tests to show this only affects vue files. The tests will remain valid after the hack is removed.

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 14, 2026

⚠️ No Changeset found

Latest commit: f725ae3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added A-CLI Area: CLI A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Feb 14, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Feb 14, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 95 skipped benchmarks1


Comparing dyc3/ignore-no-comma-operator-in-vue (f725ae3) with main (fbe460f)

Open in CodSpeed

Footnotes

  1. 95 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@dyc3 dyc3 marked this pull request as ready for review February 15, 2026 00:31
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 15, 2026

Walkthrough

Adds an ignore rule for .opencode/plans/ in .gitignore. Updates the noCommaOperator lint rule to detect Vue template contexts (using JsFileSource) and skip analysis for template expressions such as v-for. Adds tests: one Vue test (no_comma_operator_not_triggered_in_v_for) and two identical Svelte tests (no_comma_operator_triggered_in_svelte_template_expression) validating rule behaviour and console snapshots. No public API signatures were changed.

Suggested reviewers

  • ematipico
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: disabling the noCommaOperator rule in Vue template expressions.
Description check ✅ Passed The description explains the motivation (temporary hack to unblock 2.4 release), references the related issue (#9069), and notes a follow-up task (#9075) to remove the hack.
Linked Issues check ✅ Passed The PR successfully addresses issue #9069 by implementing a runtime check to skip the noCommaOperator rule in Vue template expressions, preventing false positives in v-for syntax.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the noCommaOperator false positive in Vue files: rule logic, test cases, and .gitignore addition are all aligned with the stated objective.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dyc3/ignore-no-comma-operator-in-vue

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

}
}

// HACK: Skip in Vue template expressions (e.g., v-for="(item, index) in items")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add the issue here too, so we can quickly identify the hack to remove?

@dyc3 dyc3 force-pushed the dyc3/ignore-no-comma-operator-in-vue branch from 76a2580 to f725ae3 Compare February 15, 2026 12:45
@dyc3 dyc3 merged commit 25d169d into main Feb 15, 2026
17 checks passed
@dyc3 dyc3 deleted the dyc3/ignore-no-comma-operator-in-vue branch February 15, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 noCommaOperator false positive in Vue v-for

2 participants