-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add stylelint metadata within shim #7541
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
Conversation
| fixable: true, | ||
| }; | ||
|
|
||
| return convertStylelintRuleToPostcssProcessor(wrappedRule); |
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.
By splitting the shim out into its own function, the entire convertStylelintRuleToPostcssProcessor can be deleted once we're running on stylelint, and this simplified to:
- return convertStylelintRuleToPostcssProcessor(wrappedRule);
+ return wrappedRule;Without any changes to any of the migrations 🎉
| } | ||
|
|
||
| export function createSassMigrator(name: string, ruleFn: PolarisMigrator) { | ||
| const wrappedRule = ruleFn as StylelintRule; |
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 gives us a logical point to inject further functionality (see the next PR where we also shim stylelint's report() method)
7886de6 to
e9271e4
Compare
ce3a751 to
03453e2
Compare
f711b74 to
3723b68
Compare
03453e2 to
aab97db
Compare
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @shopify/polaris-migrator@0.7.0 ### Minor Changes - [#7499](#7499) [`85c0c3290`](85c0c32) Thanks [@jesstelford](https://github.com/jesstelford)! - Add `createSassMigrator` utility to stash common logic, starting with only parsing each event once. - [#7541](#7541) [`141746b5b`](141746b) Thanks [@jesstelford](https://github.com/jesstelford)! - Internally setup stylelint metadata for SASS migrations in preparation for switching to stylelint as our migration runner. ## @shopify/plugin-polaris@0.0.15 ### Patch Changes - Updated dependencies \[[`85c0c3290`](85c0c32), [`141746b5b`](141746b)]: - @shopify/polaris-migrator@0.7.0 ## @shopify/polaris@10.10.1 ### Patch Changes - [#7561](#7561) [`fc78fcc48`](fc78fcc) Thanks [@kyledurand](https://github.com/kyledurand)! - Fix typo in box property, remove PropsWithChildren ## polaris-for-figma@0.0.28 ### Patch Changes - Updated dependencies \[[`fc78fcc48`](fc78fcc)]: - @shopify/polaris@10.10.1 ## polaris.shopify.com@0.23.3 ### Patch Changes - Updated dependencies \[[`fc78fcc48`](fc78fcc)]: - @shopify/polaris@10.10.1 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This PR belongs to a series of proposed changes:
createSassMigrator method to wrap common functionality #7499NOTE: This PR is best viewed with whitespace changes hidden
Stylelint rules require some metadata (name,
fixablemainly). This PR ensures that data is set, and also takes a best-guess at a URL for linking to rules directly from in-IDE prompts.