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 ESM plugins #7339
Conversation
🦋 Changeset detectedLatest commit: af6d743 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 |
In addition, this change does the following: - improve the migration guide for v16 - rewrite the writing plugin guide for ESM - make the changelog items more consistent Note: I realized that #7279 produced a breaking change in `stylelint.utils.checkAgainstRule`.
96f7d49
to
5672fec
Compare
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.
Fantastic! @ybiquitous It's incredible to see this, and it was only made possible by your immense effort to migrate the entire codebase to ESM!
I've tested this branch locally with a mix of ESM and CommonJS plugins. It all worked well.
I've made some minor suggestions to the wording and code style.
Let's also add something to the migration guide. We can adopt the v15
format of "significant or breaking changes". For example:
# Migrating to 16.0.0
This release contains significant or breaking changes.
## Significant changes
- added support for ESM plugins
### Added support for ESM plugins
You can now create ESM plugins for Stylelint. This involved a year-long effort to migrate our codebase to ESM. We've updated our [developer guide](../developer-guide/plugins.md) with examples of ESM syntax.
## Breaking changes
This release contains breaking changes. We've:
- removed deprecated stylistic rules
- removed support for Node.js less than 18.12.0
- changed `.js` extension to `.mjs` and `.cjs`
- changed Node.js API returned resolved object
- changed Node.js API `stylelint.formatters` object
- changed Node.js API `stylelint.rules` object
- changed Node.js API `stylelint.utils.checkAgainstRule` function
- changed CLI to print problems to stderr
- changed CLI exit code for flag errors
### Removed deprecated stylistic rules
...
The rest of the headings will need to be bumped down a level too.
Let's do another prerelease after this PR is merged.
I'll create a follow-up issue about deprecating CommonJs plugins.
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
@jeddy3 Thanks a lot for the review. I've addressed and resolved all your review comments. 👌🏼 In addition, I've pushed one more improvement (101f65e) in the docs to clarify the -`stylelint.utils.report`
+`stylelint.utils.report()` Any thoughts? |
The changes look good. As part of this PR, let's update the migration guide. |
Done! acd12ed |
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.
Wonderful, LGTM.
(I think we can merge and do another prerelease.)
Okay, I'll merge this PR and release |
Closes #7327
In addition, this change does the following:
Note: I realized that #7279 produced a breaking change in
stylelint.utils.checkAgainstRule
.