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 declaration-block-no-shorthand-property-overrides false negatives for border #7585

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/reference/properties.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ const longhandSubPropertiesOfShorthandProperties = new Map([
'border-right-color',
'border-bottom-color',
'border-left-color',
'border-color',
'border-style',
'border-block',
'border-block-end',
'border-block-start',
]),
],
[
Expand Down
5 changes: 5 additions & 0 deletions lib/reference/properties.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ export const longhandSubPropertiesOfShorthandProperties = new Map([
'border-right-color',
'border-bottom-color',
'border-left-color',
'border-color',
'border-style',
'border-block',
'border-block-end',
'border-block-start',
Mouvedia marked this conversation as resolved.
Show resolved Hide resolved
]),
],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,46 @@ testRule({
endLine: 1,
endColumn: 32,
},
{
code: 'a { border-block: 1px solid; border: 20px dashed black; }',
message: messages.rejected('border', 'border-block'),
line: 1,
column: 30,
endLine: 1,
endColumn: 36,
},
{
code: 'a { border-block-end: 1px solid; border: 20px dashed black; }',
message: messages.rejected('border', 'border-block-end'),
line: 1,
column: 34,
endLine: 1,
endColumn: 40,
},
{
code: 'a { border-block-start: 1px solid; border: 20px dashed black; }',
message: messages.rejected('border', 'border-block-start'),
line: 1,
column: 36,
endLine: 1,
endColumn: 42,
},
Mouvedia marked this conversation as resolved.
Show resolved Hide resolved
{
code: 'a { border-color: red; border: 1px solid black; }',
message: messages.rejected('border', 'border-color'),
line: 1,
column: 24,
endLine: 1,
endColumn: 30,
},
{
code: 'a { border-style: dotted; border: 1px solid black; }',
message: messages.rejected('border', 'border-style'),
line: 1,
column: 27,
endLine: 1,
endColumn: 33,
},
{
code: 'a { pAdDiNg-lEfT: 10Px; pAdDiNg: 20Px; }',
message: messages.rejected('pAdDiNg', 'pAdDiNg-lEfT'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ const rule = (primary) => {
properties.longhandSubPropertiesOfShorthandProperties
).get(unprefixedProp);

if (!overrideables) {
declarations.set(prop.toLowerCase(), prop);
declarations.set(prop.toLowerCase(), prop);

if (!overrideables) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const rule = (primary) => {
longhandSubPropertiesOfShorthandProperties
).get(unprefixedProp);

if (!overrideables) {
declarations.set(prop.toLowerCase(), prop);
Mouvedia marked this conversation as resolved.
Show resolved Hide resolved
declarations.set(prop.toLowerCase(), prop);
Mouvedia marked this conversation as resolved.
Show resolved Hide resolved

if (!overrideables) {
return;
}

Expand Down