Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rule-selector-property-disallowed-list secondary options #6688

Closed
clshortfuse opened this issue Feb 28, 2023 · 5 comments · Fixed by #6723
Closed

Fix rule-selector-property-disallowed-list secondary options #6688

clshortfuse opened this issue Feb 28, 2023 · 5 comments · Fixed by #6723
Labels
good first issue is good for newcomers status: wip is being worked on by someone type: bug a problem with a feature or rule

Comments

@clshortfuse
Copy link

What steps are needed to reproduce the bug?

Try to add a message parameter to rule-selector-property-disallowed-list.

See REPL: https://stylelint.io/demo#N4Igxg9gJgpiBcICGACYLIBsICd4pxigG4UBfAHQDtqQAaEAZwE8qAXJADwXEcfvAQqAMwCWAcx7BqKFBRA4ArphiN5+aVVmz5SlQFpGMFWDa59ABxwQLMHG2b6ooxkkzYA7kX2YXbdSgA2jLaspqhofJIAcGC2DjydHIgAPQAtkg44qJUKfIAunQhEckpwhAQeQiljKIAXjBVxdpkRVol4SXJaaqu4jAB8gByEGwobp5E8s2ylO2y+SFzZCBkQA

Removing the array (and the message) with an object works:

https://stylelint.io/demo#N4Igxg9gJgpiBcICGACYLIBsICd4pxigG4UBfAHQDtqQAaEAZwE8qAXJADwXEcfvAQqAMwCWAcx7BqKFBRA4ArphiN5+aVVmz5SlQFpGMFWDa59ABxwQLMHG2b6ooxkkzYA7kX2YXbdXJa2rKawcHySAEA2vJYuPJ0ciAA9AC2SDjiolTJ8gC6dDJhOinCEBC5CEnJjKIAXjCVRcGUQa1kIGRAA

What Stylelint configuration is needed to reproduce the bug?

{
  "rules": {
    "rule-selector-property-disallowed-list": [
      {
        "a": ["color", "/margin/"],
        "/foo/": "/size/"
      },
       {
        "message": "Not allowed"
      }
    ]
  }
}

How did you run Stylelint?

npx stylelint test.css

Which version of Stylelint are you using?

15.2.0

What did you expect to happen?

Should support messages

What actually happened?

Rule is ignored

Does the bug relate to non-standard syntax?

No response

Proposal to fix the bug

Check code with declaration-property-value-disallowed-list which does work.

@ybiquitous ybiquitous added status: ready to implement is ready to be worked on by someone type: bug a problem with a feature or rule good first issue is good for newcomers labels Mar 1, 2023
@ybiquitous
Copy link
Member

@clshortfuse Thank you for the report with the detailed reproduction!

The rule's primaryOptionArray setting seems wrong.

The rule's primary option type is an object, not an array:

`object`: `{ "selector": ["array", "of", "properties", "/regex/", /regex/]|"property"|"/regex/"|/regex/`

I've labeled the issue as ready to implement. Please consider contributing if you have time.

There are steps on how to fix a bug in a rule in the Developer guide.

@ybiquitous ybiquitous changed the title rule-selector-property-disallowed-list does not actually support messages Fix rule-selector-property-disallowed-list secondary options Mar 1, 2023
@Mouvedia
Copy link
Member

Mouvedia commented Mar 1, 2023

Small nitpick, it seems that the in https://stylelint.io/user-guide/rules/rule-selector-property-disallowed-list don't align properly.

@ybiquitous
Copy link
Member

Good catch. Please open a PR to fix the typo on the doc.

@cherieliu
Copy link

Hi @ybiquitous, is anyone working on this issue? If not, I'm interested!

@ybiquitous ybiquitous added status: wip is being worked on by someone and removed status: ready to implement is ready to be worked on by someone labels Mar 24, 2023
@ybiquitous
Copy link
Member

@cherieliu Thank you for your proposal. But unfortunately, PR #6723 is opened. 😅
(I just updated the label to wip, sorry)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue is good for newcomers status: wip is being worked on by someone type: bug a problem with a feature or rule
Development

Successfully merging a pull request may close this issue.

4 participants