Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Addvue/no-negated-v-if-condition rule#2794

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
waynzh wants to merge12 commits intomaster
base:master
Choose a base branch
Loading
fromfeature/np-negated-condition

Conversation

waynzh
Copy link
Member

@waynzhwaynzh commentedJul 14, 2025
edited
Loading

related#2769

Found that the check and fix logic for ternaries is quite different. So, I extractv-if condition into a separate rule.

I’ll submit a follow-up PR later to implementvue/no-negated-condition as an extension of theno-negated-condition.

Update:#2795

ST-DDT reacted with thumbs up emoji
@waynzhwaynzh requested a review fromCopilotJuly 14, 2025 03:12
@changeset-botchangeset-bot
Copy link

changeset-botbot commentedJul 14, 2025
edited
Loading

🦋 Changeset detected

Latest commit:fa09bb8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
eslint-plugin-vueMinor

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

Copy link

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Introduces a new ESLint rulevue/no-negated-v-if-condition to prohibit negated conditions inv-if/v-else(-if) when there’s anelse branch, with auto-suggestion to invert and swap blocks.

  • Add rule implementation with detection and fix suggestions
  • Add comprehensive tests covering valid/invalid scenarios
  • Register rule in plugin and document it

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
tests/lib/rules/no-negated-v-if-condition.jsNew test suite covering valid/invalid cases
lib/rules/no-negated-v-if-condition.jsRule logic, detection of negated conditions, fix suggestion generators
lib/index.jsPlugin registration for the new rule
docs/rules/no-negated-v-if-condition.mdRule documentation with examples
docs/rules/index.mdAdded rule entry to the rules index
Comments suppressed due to low confidence (1)

docs/rules/no-negated-v-if-condition.md:57

  • [nitpick] In the Related Rules section, this rule currently links to itself. Consider updating it to reference the core ESLint ruleno-negated-condition or another relevant rule instead of duplicating itself.
- [no-negated-v-if-condition](https://eslint.org/docs/rules/no-negated-v-if-condition)

waynzh reacted with thumbs up emoji
Copy link
Member

@FloEdelmannFloEdelmann left a comment

Choose a reason for hiding this comment

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

Really cool, thank you! I have just one minor code style nitpick, the rest looks good to me 🙂

Co-authored-by: Flo Edelmann <git@flo-edelmann.de>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@FloEdelmannFloEdelmannFloEdelmann approved these changes

@ST-DDTST-DDTST-DDT approved these changes

@ota-meshiota-meshiAwaiting requested review from ota-meshi

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Rule suggestion:vue/no-negated-condition forv-if/v-else in the template
3 participants
@waynzh@FloEdelmann@ST-DDT

[8]ページ先頭

©2009-2025 Movatter.jp