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

Add config overrides option #4311

Closed
soullivaneuh opened this issue Sep 27, 2019 · 2 comments
Closed

Add config overrides option #4311

soullivaneuh opened this issue Sep 27, 2019 · 2 comments

Comments

@soullivaneuh
Copy link

soullivaneuh commented Sep 27, 2019

What is the problem you're trying to solve?

We are working on a global CS tool including stylelint for both .css and .scss file (with the scss plugin).

Some CSS rules does not have to apply on .scss file. Please see our issue for details: https://gitlab.com/nexylan/pretty/issues/23

The only workaround I have now is to completely disable the function-name-case rule, even for .css files.

What solution would you like to see?

Have the possibility to define a overrides section on the configuration file.

The way eslint does it seem pretty good: https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files

We may do something like this:

plugins:
  - stylelint-scss
extends:
  - stylelint-config-standard
  - stylelint-config-recommended-scss
  - stylelint-config-prettier
overrides:
  files:
    - '*.scss'
  rules:
    function-name-case: null

Or include the plugin on overrides:

extends:
  - stylelint-config-standard
  - stylelint-config-prettier
overrides:
  files:
    - '*.scss'
  plugins:
    - stylelint-scss
  extends:
    - stylelint-config-recommended-scss

As overrides would be able to handle any config as the root one, you have a lot of possibilities.

Regards

@hudochenkov
Copy link
Member

Duplicates #3128

@soullivaneuh
Copy link
Author

Oh didn't see that one, thanks and sorry for the duplicate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants