8000 fix: handle template expression in no-invalid-role by yeonjuan · Pull Request #335 · yeonjuan/html-eslint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: handle template expression in no-invalid-role #335

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

Merged
merged 2 commits into from
May 7, 2025
Merged

Conversation

yeonjuan
Copy link
Owner
@yeonjuan yeonjuan commented May 7, 2025

@yeonjuan yeonjuan requested a review from Copilot May 7, 2025 13:35
Copy link
Contributor
@Copilot Copilot AI 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 fixes an issue with the "no-invalid-role" rule by handling template expressions correctly in both the rule implementation and its tests.

  • Updated test cases to include template expressions for role attributes.
  • Modified the rule to bypass validation when a template expression is detected.

Reviewed Changes

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

File Description
packages/eslint-plugin/tests/rules/no-invalid-role.test.js Added a test case for template expressions in role attributes.
packages/eslint-plugin/lib/rules/no-invalid-role.js Introduced an early return to bypass template expressions during role validation.
Comments suppressed due to low confidence (1)

packages/eslint-plugin/lib/rules/no-invalid-role.js:257

  • [nitpick] Consider adding an inline comment to explain why template expressions are skipped in the role validation, which would improve the code's maintainability and clarity for future developers.
if (role.value && role.value.parts.some((part) => part.type === NodeTypes.Template)) {

Copy link
codecov bot commented May 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.54%. Comparing base (09bafbb) to head (abae582).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #335   +/-   ##
=======================================
  Coverage   98.53%   98.54%           
=======================================
  Files          76       76           
  Lines        2324     2329    +5     
  Branches      636      639    +3     
=======================================
+ Hits         2290     2295    +5     
  Misses         34       34           
Flag Coverage Δ
unittest 98.54% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ackages/eslint-plugin/lib/rules/no-invalid-role.js 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yeonjuan yeonjuan merged commit 85fe773 into main May 7, 2025
1 check passed
@yeonjuan yeonjuan deleted the fixes/334 branch May 7, 2025 13:41
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.

[BUG] no-invalid-role should not report error for dynamic role attribute in template expression
1 participant
0