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

Deprecation Warning: stylelint unit blacklist & whitelist has been deprecated #39

Open
atatarenko opened this issue Jan 19, 2022 · 3 comments

Comments

@atatarenko
Copy link
Member

Context

Running a command in my project's directory dreact lint styles 'src/**/*.css'

Actual result

All lints pass but here is the warning in the console:

Deprecation Warning: 'declaration-property-unit-blacklist' has been deprecated. Instead use 'declaration-property-unit-disallowed-list'. See: https://github.com/stylelint/stylelint/blob/13.7.0/lib/rules/declaration-property-unit-blacklist/README.md
Deprecation Warning: 'declaration-property-unit-whitelist' has been deprecated. Instead use 'declaration-property-unit-allowed-list'. See: https://github.com/stylelint/stylelint/blob/13.7.0/lib/rules/declaration-property-unit-whitelist/README.md
Deprecation Warning: 'unit-whitelist' has been deprecated. Instead use 'unit-allowed-list'. See: https://github.com/stylelint/stylelint/blob/13.7.0/lib/rules/unit-whitelist/README.md

Expected result

No warning.

@ezhlobo
Copy link
Member

ezhlobo commented Jan 26, 2022

@atatarenko thank you for notice. We are not actively support dreact at the moment, so it may take a while to fix the things.

So far I can suggest you to change your project's ./config/stylelint.config.js:

+ 'declaration-property-unit-blacklist': null,
+ 'declaration-property-unit-whitelist': null,
+ 'unit-whitelist': null,

If you still care about units, you can add the contraint about no pixels:

+ 'unit-disallowed-list': [
+   'px',
+   {
+     'ignoreProperties': {
+       'px': [
+         '/^(border(?!-radius))/'
+       ]
+     }
+   }
+ ],

@atatarenko
Copy link
Member Author

@ezhlobo thank you for giving a tip on how we can mitigate an issue. I'd prefer to keep this one open until we find a proper fix if you don't mind.

@ohmycthulhu
Copy link

I will take a look and try fixing this issue

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

No branches or pull requests

3 participants