Skip to content
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

Fix shorthand-property-no-redundant-values message #6272

Merged
merged 1 commit into from Aug 17, 2022

Conversation

ybiquitous
Copy link
Member

Which issue, if any, is this issue related to?

Part of #5694

Is there anything in the PR that needs further explanation?

This PR fixes the message to use double quotes for consistency with other rules:

- Unexpected longhand value '1px 1px' instead of '1px'
+ Unexpected longhand value "1px 1px" instead of "1px"

This also adds test cases for end positions (#5694).

This change also add test cases for end positions.
@@ -115,6 +115,8 @@ testRule({
message: messages.rejected('1px 1px', '1px'),
line: 1,
column: 5,
endLine: 1,
endColumn: 21,
Copy link
Member Author

Choose a reason for hiding this comment

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

[note] I don't think it's needed to change the arguments passed to report() since it should be helpful that the column range covers a declaration property and value.

report({
message: messages.rejected(value, shortestFormString),
node: decl,
result,
ruleName,
});

a { margin: 1px 1px }
/*  ^^^^^^^^^^^^^^^
    Unexpected longhand value "1px 1px" instead of "1px"
*/

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

Thanks!

@ybiquitous ybiquitous merged commit a51bd7e into main Aug 17, 2022
@ybiquitous ybiquitous deleted the fix-shorthand-property-no-redundant-values-message branch August 17, 2022 00:20
@ybiquitous
Copy link
Member Author

Changelog entry added:

  • Fixed: shorthand-property-no-redundant-values message (#6272).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants