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 support for stylelint v16 #19

Open
paulfalgout opened this issue Dec 18, 2023 · 1 comment
Open

Add support for stylelint v16 #19

paulfalgout opened this issue Dec 18, 2023 · 1 comment

Comments

@paulfalgout
Copy link

In v16 the formatters were changed to Promises
https://github.com/stylelint/stylelint/blob/main/docs/migration-guide/to-16.md#changed-nodejs-api-stylelintformatters-object

So the defaults no longer work.

@cascornelissen
Copy link
Owner

Thanks for reporting this. My initial reaction is that this should be a simple (hopefully backwards-compatible) change where we'd need some additional async/await keywords in the following part.

formatter: (() => {
if ( get(stylelint, 'formatters.string') ) {
return stylelint.formatters.string;
} else if ( moduleAvailable('stylelint/dist/formatters/stringFormatter') ) {
return require('stylelint/dist/formatters/stringFormatter').default;
}
})()

I'm open to a PR if anyone wants to try this out. As mentioned I'd love to support this in a backwards-compatible way so let's ensure it works with v16 but also with earlier versions so that we can maintain the current level of flexibility.

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

2 participants