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

Remove import-lazy and change stylelint.rules Promise-based #7279

Merged
merged 8 commits into from Nov 6, 2023

Conversation

ybiquitous
Copy link
Member

Which issue, if any, is this issue related to?

Ref #5291

Is there anything in the PR that needs further explanation?

This commit makes the following changes, including a breaking:

  • Remove the import-lazy dependency
  • Make the stylelint.rules object Promise-based (breaking)

Thanks to these changes, the test suite is executed for ESM rules (lib/rules/*/index.mjs), instead of CJS ones (*.cjs).

This commit makes the following changes, including a breaking:

- Remove the `import-lazy` dependency
- Make the `stylelint.rules` object Promise-based (breaking)

Thanks to these changes, the test suite is executed for ESM rules (`lib/rules/*/index.mjs`), instead of CJS ones (`*.cjs`).
@changeset-bot
Copy link

changeset-bot bot commented Oct 25, 2023

🦋 Changeset detected

Latest commit: 5d45c61

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Major

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

@ybiquitous ybiquitous marked this pull request as ready for review October 25, 2023 13:42
@ybiquitous ybiquitous mentioned this pull request Oct 25, 2023

```diff js
-const rule = stylelint.rules['block-no-empty'];
+const rule = await stylelint.rules['block-no-empty'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question

This looks like a breaking change.
Do we know if there are popular downstream packages that will be impacted?
While searching on GitHub, I found some developer guides and one deprecated plugin that were affected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this is a breaking change. But I believe there should be no big impact.

See also:
https://github.com/search?q=%22stylelint.rules%22+AND+%28language%3AJavaScript+OR+language%3ATypeScript%29&type=code

And I realized the developer guide also needs to be updated, so I'll do that with this PR.

Copy link
Member

@Mouvedia Mouvedia Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See also:
github.com/search?q=%22stylelint.rules%22+AND+%28language%3AJavaScript+OR+language%3ATypeScript%29&type=code

Based on these results, we ought to inform, beforehand, the maintainers of these popular projects :

  • openstyles/stylus
  • stylelint/vscode-stylelint
  • SonarSource/SonarJS

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think the migration guide will be insufficient? I think that idea is not limited since we lack our resources.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tophf, @ota-meshi, @saberduck

I thought that you might want to be informed in advance of that breaking change so you will be able to schedule a version shortly after the release of version 16.

Copy link
Member

@Mouvedia Mouvedia Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tophf, @ota-meshi, @saberduck

You can test the next release.
see #6930 (comment)

@ybiquitous ybiquitous mentioned this pull request Oct 30, 2023
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

@ybiquitous ybiquitous merged commit aa9be6f into v16 Nov 6, 2023
12 of 14 checks passed
@ybiquitous ybiquitous deleted the remove-import-lazy branch November 6, 2023 07:15
@ybiquitous
Copy link
Member Author

Thanks for the review. We can now proceed with #7280.

ybiquitous added a commit that referenced this pull request Nov 14, 2023
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`.
ybiquitous added a commit that referenced this pull request Nov 15, 2023
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`.
ybiquitous added a commit that referenced this pull request Nov 15, 2023
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`.

Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants