Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@yeonjuan
Copy link
Owner

Checklist

Description

@yeonjuan yeonjuan requested a review from Copilot July 13, 2025 14:47
Copy link
Contributor

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 introduces a new enforceTemplatedAttrValue option to the quotes rule, allowing users to enforce quote styles on templated attribute values.

  • Added support for the enforceTemplatedAttrValue boolean option in the rule schema and implementation
  • Extended tests with valid and invalid cases for templated attribute values
  • Updated documentation to explain and illustrate the new option

Reviewed Changes

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

File Description
packages/eslint-plugin/tests/rules/quotes.test.js Added valid/invalid tests covering the new enforceTemplatedAttrValue behavior
packages/eslint-plugin/lib/rules/quotes.js Introduced the enforceTemplatedAttrValue option and adjusted logic to respect it
docs/rules/quotes.md Updated the rule description, option list, and examples to document the new option
Comments suppressed due to low confidence (2)

docs/rules/quotes.md:37

  • There isn't a matching <!-- prettier-ignore --> for this <!-- prettier-ignore-end -->. Please remove it or add the corresponding start marker.
<!-- prettier-ignore-end -->

packages/eslint-plugin/lib/rules/quotes.js:6

  • [nitpick] The name SingleOrQuoteOption is a bit ambiguous. Consider renaming to QuoteStyleOption or SingleOrDoubleQuoteOption to make it clearer that it covers both quote styles.
 * @typedef {"single" | "double"} SingleOrQuoteOption

Comment on lines +72 to +75
const enforceTemplatedAttrValue =
context.options &&
context.options[1] &&
context.options[1].enforceTemplatedAttrValue;
Copy link

Copilot AI Jul 13, 2025

Choose a reason for hiding this comment

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

[nitpick] You could simplify this by destructuring with a default value, e.g.: const { enforceTemplatedAttrValue = false } = context.options[1] || {}; to make the intention clearer and reduce repetitive context.options checks.

Suggested change
const enforceTemplatedAttrValue =
context.options &&
context.options[1] &&
context.options[1].enforceTemplatedAttrValue;
const { enforceTemplatedAttrValue = false } = context.options[1] || {};

Copilot uses AI. Check for mistakes.
@yeonjuan yeonjuan marked this pull request as ready for review July 14, 2025 15:21
@yeonjuan yeonjuan merged commit bdfef79 into main Jul 14, 2025
5 checks passed
@codecov
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.36%. Comparing base (fa96551) to head (03f6530).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #387   +/-   ##
=======================================
  Coverage   98.36%   98.36%           
=======================================
  Files          81       81           
  Lines        2630     2635    +5     
  Branches      720      725    +5     
=======================================
+ Hits         2587     2592    +5     
  Misses         43       43           
Flag Coverage Δ
unittest 98.36% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
packages/eslint-plugin/lib/rules/quotes.js 98.07% <100.00%> (+0.20%) ⬆️
🚀 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.

@reteps
Copy link

reteps commented Jul 14, 2025

Thank you!

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.

[FEATURE] Apply quotes around templated attribute values

3 participants