Skip to content

Commit

Permalink
Merge pull request #130 from lee-chase/issue125
Browse files Browse the repository at this point in the history
chore: add test for 125
  • Loading branch information
lee-chase authored Jul 9, 2024
2 parents 6c615ed + 10415f0 commit 112e22a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog

- Test added for #125 (fixed by #124)
- Partial fix for #124 (enforceScopes: false)

## 3.0.0
Expand Down
44 changes: 44 additions & 0 deletions src/rules/layout-use/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1552,3 +1552,47 @@ testRule({
},
],
});

testRule({
plugins: [plugin],
ruleName,
customSyntax: 'postcss-scss',
fix: true,
config: true,
reject: [
{
code: `@use "@carbon/type" as type; .foo { padding-left: 16px; }`,
fixed: `@use "@carbon/type" as type; .foo { padding-left: $spacing-05; }`,
description: `v11 reject and fix 'layout' but and add no prefix`,
message: messages.rejected('padding-left', '16px'),
},
{
code: `@use "@carbon/layout" as layout; .foo { padding-left: 16px; }`,
fixed: `@use "@carbon/layout" as layout; .foo { padding-left: $spacing-05; }`,
description: `v11 reject and fix 'layout' but and add no prefix`,
message: messages.rejected('padding-left', '16px'),
},
],
});

// testRule({
// plugins: [plugin],
// ruleName,
// customSyntax: 'postcss-scss',
// fix: true,
// config: [
// true,
// {
// enforceScopes: true,
// },
// ],
// enforceScopes: true,
// reject: [
// {
// code: `@use "@carbon/layout" as layout; .foo { padding-left: 16px; }`,
// fixed: `@use "@carbon/layout" as layout; .foo { padding-left: $spacing-05; }`,
// description: `v11 reject and fix 'layout' and enforce prefix`,
// message: messages.rejected('padding-left', '16px'),
// },
// ],
// });
2 changes: 1 addition & 1 deletion src/rules/motion-duration-use/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ testRule({
// {
// code: `@use "@carbon/layout" as layout; @use "@carbon/motion"; .foo { transition: padding 400ms cubic-bezier(0.25, 0.8, 0.075, 1); }`,
// fixed: `@use "@carbon/layout" as layout; @use "@carbon/motion"; .foo { transition: padding motion.$duration-slow-01 cubic-bezier(0.25, 0.8, 0.075, 1); }`,
// description: `v11 reject and fix 'motion-duration' but and add no prefix`,
// description: `v11 reject and fix 'motion-duration' and enforce prefix`,
// message: messages.rejectedTransition('transition', '400ms'),
// },
// ],
Expand Down

0 comments on commit 112e22a

Please sign in to comment.