Skip to content

Commit

Permalink
Update link for spacing plugin (#391)
Browse files Browse the repository at this point in the history
* Update spacing.js

* test: update test snapshot
  • Loading branch information
joshblack authored Mar 28, 2024
1 parent a5df094 commit 3c92259
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
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

0 comments on commit 3c92259

Please sign in to comment.