diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e8949c..a26fbb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog +- Test added for #125 (fixed by #124) - Partial fix for #124 (enforceScopes: false) ## 3.0.0 diff --git a/src/rules/layout-use/__tests__/index.js b/src/rules/layout-use/__tests__/index.js index 44fe369..b59c04f 100644 --- a/src/rules/layout-use/__tests__/index.js +++ b/src/rules/layout-use/__tests__/index.js @@ -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'), +// }, +// ], +// }); diff --git a/src/rules/motion-duration-use/__tests__/index.js b/src/rules/motion-duration-use/__tests__/index.js index 0f08098..0b6762c 100644 --- a/src/rules/motion-duration-use/__tests__/index.js +++ b/src/rules/motion-duration-use/__tests__/index.js @@ -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'), // }, // ],