Skip to content

Commit

Permalink
Fix rule-selector-property-disallowed-list secondary options (#6723)
Browse files Browse the repository at this point in the history
* Fix `rule-selector-property-disallowed-list` secondary options

* Adds custom message regression test

* Fix position of `↑` in rule docs

---------

Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
  • Loading branch information
mattxwang and ybiquitous committed Mar 29, 2023
1 parent 13efb86 commit fe4a86f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-avocados-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `rule-selector-property-disallowed-list` secondary options
2 changes: 1 addition & 1 deletion lib/rules/rule-selector-property-disallowed-list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Specify a list of disallowed properties for selectors within rules.
<!-- prettier-ignore -->
```css
a { color: red; }
/** ↑
/** ↑ ↑
* Selector and property name */
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,16 @@ testRule({
},
],
});

testRule({
ruleName,
config: [{ a: 'color' }, { message: 'foo' }],

reject: [
{
code: 'a { color: red; }',
message: 'foo',
description: 'custom message',
},
],
});
2 changes: 0 additions & 2 deletions lib/rules/rule-selector-property-disallowed-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ const rule = (primary) => {
};
};

rule.primaryOptionArray = true;

rule.ruleName = ruleName;
rule.messages = messages;
rule.meta = meta;
Expand Down

0 comments on commit fe4a86f

Please sign in to comment.