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

Document full configs for secondary option examples #4808

Open
IAMtheIAM opened this issue May 27, 2020 · 10 comments
Open

Document full configs for secondary option examples #4808

IAMtheIAM opened this issue May 27, 2020 · 10 comments
Labels
good first issue is good for newcomers status: ask to implement ask before implementing as may no longer be relevant type: documentation an improvement to the documentation

Comments

@IAMtheIAM
Copy link

IAMtheIAM commented May 27, 2020

Clearly describe the bug

The selector-pseudo-element-no-unknown rule needs to accept true and false so it can be overridden when extending from a predefined config which has it set to true.

Which rule, if any, is the bug related to?

selector-pseudo-element-no-unknown

What code is needed to reproduce the bug?

No code

What stylelint configuration is needed to reproduce the bug?

    "selector-pseudo-element-no-unknown": false,

Which version of stylelint are you using?

    "stylelint": "13.5.0",

How are you running stylelint: CLI, PostCSS plugin, Node.js API?

CLI

Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?

"Yes, it's related to SCSS nested properties."

What did you expect to happen?

"No error."

What actually happened (e.g. what warnings or errors did you get)?

Results in error: Invalid Option: Unexpected option value "false" for rule "selector-pseudo-element-no-unknown"
@IAMtheIAM
Copy link
Author

I found that I can do this:

        "selector-pseudo-element-no-unknown": [true, {
            "ignorePseudoElements": ["ng-deep"]
        }],

But I did not understand this clearly from the documentation. It would be really helpful if the rules showed the full config in the options and secondary options, just an idea.

@hudochenkov
Copy link
Member

The selector-pseudo-element-no-unknown rule needs to accept true and false so it can be overridden when extending from a predefined config which has it set to true.

Use null to turn off a rule:

"selector-pseudo-element-no-unknown": null

But I did not understand this clearly from the documentation. It would be really helpful if the rules showed the full config in the options and secondary options, just an idea.

I would agree with you. Style of configuration examples in rule description are rather not user-friendly, and require quite some knowledge about how stylelint works and how it's configured.

E. g. this is what we have in selector-pseudo-element-no-unknown:

Given:

["/^my-/", "pseudo-element"]

This would be much more helpful for users:

Given:

[true, { "ignorePseudoElements": ["/^my-/", "pseudo-element"] }]

@hudochenkov hudochenkov added status: needs discussion triage needs further discussion type: documentation an improvement to the documentation labels May 27, 2020
@jeddy3
Copy link
Member

jeddy3 commented May 31, 2020

This would be much more helpful for users:

Agreed. I'll label the issue as ready to go.

@IAMtheIAM Please consider contributing these changes if you have time.

@jeddy3 jeddy3 added status: ready to implement is ready to be worked on by someone and removed status: needs discussion triage needs further discussion labels May 31, 2020
@jeddy3 jeddy3 changed the title Cannot override selector-pseudo-element-no-unknown with false Document full configs for secondary option examples May 31, 2020
@Mouvedia
Copy link
Member

The initial issue is covered by #5091.

@ybiquitous
Copy link
Member

I agree with @Mouvedia.

If PR #6250 is merged, users will receive a more helpful message, and we've already provided the doc for turning off a rule. I think these are sufficient.

@ybiquitous
Copy link
Member

ybiquitous commented Aug 11, 2022

I've closed merged PR #6250, so I've also completed this issue. Feel free to reopen it if anyone has objections.

@hudochenkov
Copy link
Member

@ybiquitous I think this issue is not about disabling rules, but documentation of configuration in general.

ESLint for every example shows full config value for a rule. Stylelint docs show only part of a value. See my comment above for an example. #4808 (comment)

@ybiquitous
Copy link
Member

Ah, I misunderstood it. Thanks for letting me know, @hudochenkov!

@ybiquitous ybiquitous reopened this Aug 11, 2022
@Mouvedia
Copy link
Member

Mouvedia commented Aug 11, 2022

Given:

["/^my-/", "pseudo-element"]

This would be much more helpful for users:

Given:

[true, { "ignorePseudoElements": ["/^my-/", "pseudo-element"] }]

That would require to edit many more markdown files other than this one.
e.g. alpha-value-notation, selector-pseudo-class-no-unknown, at-rule-no-unknown, selector-type-no-unknown, media-feature-name-no-unknown, annotation-no-unknown, etc.

I don't think this is necessary or the priority should be very low.

Copy link
Contributor

This issue is older than one month. Please ask before opening a pull request, as it may no longer be relevant.

@github-actions github-actions bot added status: ask to implement ask before implementing as may no longer be relevant and removed status: ready to implement is ready to be worked on by someone labels Jan 22, 2024
@Mouvedia Mouvedia added the good first issue is good for newcomers label Apr 26, 2024
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: ask to implement ask before implementing as may no longer be relevant type: documentation an improvement to the documentation
Development

No branches or pull requests

5 participants