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

Update link for spacing plugin #391

Merged
merged 2 commits into from
Mar 28, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions __tests__/spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ testRule({
code: '.x { padding-bottom: 0.3em; }',
unfixable: true,
message:
"Please use a primer spacer variable instead of '0.3em'. Consult the primer docs for a suitable replacement. https://primer.style/css/support/spacing (primer/spacing)",
"Please use a primer spacer variable instead of '0.3em'. Consult the primer docs for a suitable replacement. https://primer.style/css/storybook/?path=/docs/support-spacing--docs (primer/spacing)",
line: 1,
column: 22,
description: 'Errors on non-spacer em values.',
Expand Down Expand Up @@ -90,15 +90,15 @@ testRule({
rule: 'primer/spacing',
severity: 'error',
message:
"Please use a primer spacer variable instead of '6px'. Consult the primer docs for a suitable replacement. https://primer.style/css/support/spacing (primer/spacing)",
"Please use a primer spacer variable instead of '6px'. Consult the primer docs for a suitable replacement. https://primer.style/css/storybook/?path=/docs/support-spacing--docs (primer/spacing)",
},
{
column: 32,
line: 1,
rule: 'primer/spacing',
severity: 'error',
message:
"Please use a primer spacer variable instead of '12px'. Consult the primer docs for a suitable replacement. https://primer.style/css/support/spacing (primer/spacing)",
"Please use a primer spacer variable instead of '12px'. Consult the primer docs for a suitable replacement. https://primer.style/css/storybook/?path=/docs/support-spacing--docs (primer/spacing)",
},
],
},
Expand All @@ -113,7 +113,7 @@ testRule({
rule: 'primer/spacing',
severity: 'error',
message:
"Please use a primer spacer variable instead of '3px'. Consult the primer docs for a suitable replacement. https://primer.style/css/support/spacing (primer/spacing)",
"Please use a primer spacer variable instead of '3px'. Consult the primer docs for a suitable replacement. https://primer.style/css/storybook/?path=/docs/support-spacing--docs (primer/spacing)",
},
{
column: 19,
Expand All @@ -128,7 +128,7 @@ testRule({
code: '.x { padding: $spacer-100; }',
unfixable: true,
message:
"Please use a primer spacer variable instead of '$spacer-100'. Consult the primer docs for a suitable replacement. https://primer.style/css/support/spacing (primer/spacing)",
"Please use a primer spacer variable instead of '$spacer-100'. Consult the primer docs for a suitable replacement. https://primer.style/css/storybook/?path=/docs/support-spacing--docs (primer/spacing)",
line: 1,
column: 15,
description: 'Errors on non-primer spacer.',
Expand All @@ -137,7 +137,7 @@ testRule({
code: '.x { margin-right: (-$spacing-task-item-1); }',
unfixable: true,
message:
"Please use a primer spacer variable instead of '-$spacing-task-item-1'. Consult the primer docs for a suitable replacement. https://primer.style/css/support/spacing (primer/spacing)",
"Please use a primer spacer variable instead of '-$spacing-task-item-1'. Consult the primer docs for a suitable replacement. https://primer.style/css/storybook/?path=/docs/support-spacing--docs (primer/spacing)",
line: 1,
column: 21,
description: 'Errors on non-primer spacer in parens.',
Expand All @@ -153,23 +153,23 @@ testRule({
rule: 'primer/spacing',
severity: 'error',
message:
"Please use a primer spacer variable instead of '3px'. Consult the primer docs for a suitable replacement. https://primer.style/css/support/spacing (primer/spacing)",
"Please use a primer spacer variable instead of '3px'. Consult the primer docs for a suitable replacement. https://primer.style/css/storybook/?path=/docs/support-spacing--docs (primer/spacing)",
},
{
column: 34,
line: 1,
rule: 'primer/spacing',
severity: 'error',
message:
"Please use a primer spacer variable instead of '3px'. Consult the primer docs for a suitable replacement. https://primer.style/css/support/spacing (primer/spacing)",
"Please use a primer spacer variable instead of '3px'. Consult the primer docs for a suitable replacement. https://primer.style/css/storybook/?path=/docs/support-spacing--docs (primer/spacing)",
},
{
column: 53,
line: 1,
rule: 'primer/spacing',
severity: 'error',
message:
"Please use a primer spacer variable instead of '3px'. Consult the primer docs for a suitable replacement. https://primer.style/css/support/spacing (primer/spacing)",
"Please use a primer spacer variable instead of '3px'. Consult the primer docs for a suitable replacement. https://primer.style/css/storybook/?path=/docs/support-spacing--docs (primer/spacing)",
},
],
},
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ruleName = 'primer/spacing'
const messages = stylelint.utils.ruleMessages(ruleName, {
rejected: (value, replacement) => {
if (replacement === null) {
return `Please use a primer spacer variable instead of '${value}'. Consult the primer docs for a suitable replacement. https://primer.style/css/support/spacing`
return `Please use a primer spacer variable instead of '${value}'. Consult the primer docs for a suitable replacement. https://primer.style/css/storybook/?path=/docs/support-spacing--docs`
}

return `Please replace ${value} with spacing variable '${replacement}'.`
Expand Down
Loading