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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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"
*/

},
{
code: 'a { margin: 1Px 1pX; }',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/shorthand-property-no-redundant-values/index.js
Expand Up @@ -12,7 +12,7 @@ const ruleName = 'shorthand-property-no-redundant-values';

const messages = ruleMessages(ruleName, {
rejected: (unexpected, expected) =>
`Unexpected longhand value '${unexpected}' instead of '${expected}'`,
`Unexpected longhand value "${unexpected}" instead of "${expected}"`,
});

const meta = {
Expand Down