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
Avoid import-lazy
in formatters
#7184
Conversation
This commit avoids using the `import-lazy` package in the `formatters` module. As a result, `formatters` can be a pure ESM module, which means `require` is no longer needed. In addition, this change accepts a `Promise` function as a custom formatter.
🦋 Changeset detectedLatest commit: 2fac227 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
Are you aware of who our big downstream consumers of the stylelint.formatters
API is? Perhaps we can let them know of this change in advance and solicit any feedback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you first consult the creator of the downstream plugins?
@@ -45,6 +45,15 @@ async function lint() { | |||
|
|||
If you use `stylelint.lint()` to lint files, the `code` property will always be `undefined`. | |||
|
|||
## Changed Node.js API returned `formatters` object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor
…returned by the…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the heading above:
## Changed Node.js API returned resolved object
But it seems they're not so good. Let me know if you have a better idea.
Thanks for the review, guys. I'm going to merge this to continue the migration to ESM. If necessary, we can revisit this change before shipping 16.0.0. Note: @jeddy3 has been offline "until the start of November," as he commented in #7140 (comment). |
This commit avoids using the `import-lazy` package in the `formatters` module. As a result, `formatters` can be a pure ESM module, which means `require` is no longer needed. In addition, this change accepts a `Promise` function as a custom formatter.
This commit avoids using the `import-lazy` package in the `formatters` module. As a result, `formatters` can be a pure ESM module, which means `require` is no longer needed. In addition, this change accepts a `Promise` function as a custom formatter.
Related to #5291
This commit avoids using the
import-lazy
package in theformatters
module.As a result,
formatters
can be a pure ESM module, which meansrequire
is no longer needed.In addition, this change accepts a
Promise
function as a custom formatter.Note that
import-lazy
is still used: