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

fix(no-v-html): add CallExpression support to ignorePattern option#2950

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
kzhrk wants to merge3 commits intovuejs:master
base:master
Choose a base branch
Loading
fromkzhrk:fix-2949

Conversation

@kzhrk
Copy link

Closes#2949

Extends theignorePattern option to support CallExpression (function call)
patterns like$sanitize(test), previously only supporting simple identifiers.

This allows users to ignore sanitized HTML expressions using patterns such as
^\$sanitize\(.

@changeset-bot
Copy link

changeset-botbot commentedNov 8, 2025
edited
Loading

🦋 Changeset detected

Latest commit:72e48a4

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

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

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

kzhrk reacted with eyes emoji

@kzhrkkzhrk marked this pull request as draftNovember 8, 2025 06:07
…uejs#2949)This commit extends the `ignorePattern` option to support function call expressionslike `$sanitize(test)`, not just simple variable identifiers like `htmlSafe`.Changes:- Add new `shouldIgnore()` helper function that handles both Identifier and  CallExpression expression types- For Identifiers, use the `name` property directly for optimal performance- For CallExpressions and other expression types, use `sourceCode.getText()`  to get the full expression text- Update the visitor to pass `sourceCode` to the new helper functionThis allows users to configure patterns like `^\$sanitize\(` to match functioncall expressions where the function name matches the pattern.Tests:- Add test case for CallExpression matching with ignorePattern `^\$sanitize\(`- All existing tests continue to pass
@kzhrkkzhrk marked this pull request as ready for reviewNovember 8, 2025 06:14
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.

Thanks for looking into it and fixing the core issue! This looks really good 🙂

I just have two minor suggestion.

kzhrk reacted with heart emoji
Copy link
Contributor

CopilotAI 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

This PR extends theignorePattern option in theno-v-html rule to support matching complex expressions likeCallExpression (e.g.,$sanitize(test)), not just simple identifiers. This allows users to whitelist sanitization function calls.

Key changes:

  • Refactored the ignore pattern matching logic into a reusableshouldIgnore helper function
  • Added support for matching any expression type by getting the full text when it's not a simple identifier
  • Added a test case demonstrating the new CallExpression pattern matching capability

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
lib/rules/no-v-html.jsIntroducedshouldIgnore helper function to handle pattern matching for both Identifiers and complex expressions like CallExpression
tests/lib/rules/no-v-html.jsAdded valid test case for CallExpression pattern matching with$sanitize() function
.changeset/add-callexpression-support.mdAdded changeset documenting the patch-level fix

💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.

FloEdelmannand others added2 commitsNovember 10, 2025 09:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kzhrk
Copy link
Author

@FloEdelmann
Thanks for the fixes and the quick follow-up commits!😊

FloEdelmann reacted with thumbs up emoji

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

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

@waynzhwaynzhAwaiting requested review from waynzh

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

vue/no-v-html ignorePattern regex escaping causes different behavior in VS Code vs CLI

2 participants

@kzhrk@FloEdelmann

[8]ページ先頭

©2009-2025 Movatter.jp