Skip to content

Conversation

@jesstelford
Copy link
Contributor

@jesstelford jesstelford commented Oct 27, 2022

This PR belongs to a series of proposed changes:

NOTE: This PR is best viewed with whitespace changes hidden


Stylelint rules require some metadata (name, fixable mainly). 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.

@jesstelford jesstelford changed the base branch from main to createsassmigrator October 27, 2022 03:37
fixable: true,
};

return convertStylelintRuleToPostcssProcessor(wrappedRule);
Copy link
Contributor Author

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;
Copy link
Contributor Author

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)

@jesstelford jesstelford force-pushed the createsassmigrator branch 2 times, most recently from f711b74 to 3723b68 Compare October 27, 2022 23:56
Base automatically changed from createsassmigrator to main October 27, 2022 23:57
@jesstelford jesstelford merged commit 141746b into main Oct 28, 2022
@jesstelford jesstelford deleted the stylelint-shim-meta branch October 28, 2022 00:02
@github-actions github-actions bot mentioned this pull request Oct 28, 2022
laurkim pushed a commit that referenced this pull request Oct 28, 2022
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>
@sam-b-rose sam-b-rose mentioned this pull request Oct 31, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants