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

Upgrade stylelint-polaris to stylelint v16 #12337

Merged
merged 29 commits into from
Jul 8, 2024

Conversation

aaronccasanova
Copy link
Member

@aaronccasanova aaronccasanova commented Jul 3, 2024

WHAT is this pull request doing?

This PR upgrades stylelint-polaris to stylelint v16 and drops support for v15 and v16.

As part of this upgrade, the following updates were made:

  • Upgraded dependencies
    • stylelint to ^16.6.1
    • stylelint-scss to ^6.3.2
    • @shopify/eslint-plugin to ^45.0.0
    • @shopify/stylelint-plugin to ^14.0.0
    • eslint to ^8.56.0
    • jest-preset-stylelint to ^7.0.1
    • prettier to ^3.2.2
  • Patched stylelint to report errors on async rules. See Stylelint issue for more details: Fix stylelint.utils.checkAgainstRule() for Promise-based rules stylelint/stylelint#7820
  • Added --experimental-vm-modules flag to jest calls to enable support for async plugins
  • Updated relevant stylelint-polaris plugins and stylelint APIs to be asynchronous
  • Updated prettier.format calls to be asynchronous
  • Resolved eslint and stylelint failures after dependency upgrades
  • Temporarily removed the styles-insert-stylelint-disable migration as result.messages nodes are now detached from the root AST. Calls such as node.prev() and node.before(comment) now throw exceptions as the reported nodes don't have access to properties and methods previously exposed. The consensus speaking with @kyledurand and @sophschneider is that we can revisit adding support for this migration if and when it is needed again.

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

🎩 checklist

@aaronccasanova
Copy link
Member Author

/snapit

@aaronccasanova aaronccasanova marked this pull request as ready for review July 5, 2024 20:23
Copy link
Contributor

github-actions bot commented Jul 5, 2024

🫰✨ Thanks @aaronccasanova! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/polaris-migrator": "0.0.0-snapshot-20240705202418",
"@shopify/stylelint-polaris": "0.0.0-snapshot-20240705202418"

Copy link
Contributor

@kyledurand kyledurand left a comment

Choose a reason for hiding this comment

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

Looks good. I'd like to revert the max class / combinators / compound selectors and specificity if possible because the css is already too complex IMO but that can be a follow up

Comment on lines +12 to +15
'selector-max-class': 5,
'selector-max-combinators': 5,
'selector-max-compound-selectors': 5,
'selector-max-specificity': '0,5,0',
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm concerned about these changes but I understand the need to ship this PR and how difficult it would be to refactor the css to make these tests pass. @jesstelford did you try just block disabling the rules here? Would that be possible?

@aaronccasanova
Copy link
Member Author

/snapit

Copy link
Contributor

github-actions bot commented Jul 8, 2024

🫰✨ Thanks @aaronccasanova! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/polaris-migrator": "0.0.0-snapshot-20240708173140",
"@shopify/stylelint-polaris": "0.0.0-snapshot-20240708173140"

@aaronccasanova aaronccasanova merged commit b2d2da4 into main Jul 8, 2024
13 checks passed
@aaronccasanova aaronccasanova deleted the upgrade-stylelint-polaris branch July 8, 2024 21:02
@jesstelford jesstelford restored the upgrade-stylelint-polaris branch July 9, 2024 03:14
jesstelford added a commit that referenced this pull request Jul 9, 2024
jesstelford added a commit that referenced this pull request Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants