@mrhenry/stylelint-mrhenry-prop-order 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +9 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -20,11 +20,16 @@ const ignoredAtRules = [
20
20
  'property'
21
21
  ];
22
22
 
23
- const ruleFunction = (primaryOption, secondaryOptionObject, context) => {
23
+ /** @type {import('stylelint').Rule<true|null>} */
24
+ const ruleFunction = (primaryOption, secondaryOption, context) => {
24
25
  return (postcssRoot, postcssResult) => {
25
- if (!primaryOption) {
26
- return;
27
- }
26
+ const validPrimary = stylelint.utils.validateOptions(postcssResult, ruleName, {
27
+ actual: primaryOption,
28
+ possible: [true]
29
+ });
30
+
31
+ /* c8 ignore next */
32
+ if (!validPrimary) return;
28
33
 
29
34
  postcssRoot.walk((container) => {
30
35
  if (container.type !== 'atrule' && container.type !== 'rule') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrhenry/stylelint-mrhenry-prop-order",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Mr. Henry's preferred order for CSS properties",
5
5
  "type": "module",
6
6
  "main": "index.mjs",