-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
More robust stylelint shim to support reporting #7532
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Oct 27, 2022
9794a18
to
981956e
Compare
ce3a751
to
03453e2
Compare
36cdd8c
to
b278c12
Compare
03453e2
to
aab97db
Compare
sam-b-rose
reviewed
Oct 28, 2022
@@ -16,44 +14,42 @@ import {isKeyOf} from '../../utilities/type-guards'; | |||
|
|||
export default createSassMigrator( | |||
'replace-sass-space', | |||
(_, options, context) => { | |||
(_, {methods, options}, context) => { |
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.
Do we need a methods
object or can we import things from an external utility like Stylelint (stylelint.utils.report
)?
b278c12
to
47078fd
Compare
47078fd
to
69e4e0b
Compare
4 tasks
sam-b-rose
approved these changes
Nov 2, 2022
Merged
laurkim
pushed a commit
that referenced
this pull request
Nov 4, 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/[email protected] ### Minor Changes - [#7548](#7548) [`432bdd5fe`](432bdd5) Thanks [@anthonymenecola](https://github.com/anthonymenecola)! - add cancel major icon - [#7620](#7620) [`35be8a003`](35be8a0) Thanks [@rdott](https://github.com/rdott)! - Added inactive location minor and major icons ## @shopify/[email protected] ### Minor Changes - [#7403](#7403) [`8859f5db5`](8859f5d) Thanks [@jesstelford](https://github.com/jesstelford)! - Introduce `migrate-motion` migration for migrating `transition`, `transition-duration`, and `transition-delay` usages of duration values. - [#7606](#7606) [`cf7badbd1`](cf7badb) Thanks [@samrose3](https://github.com/samrose3)! - Renamed and split migrations based on scope and type (react, scss, and styles) - [#7543](#7543) [`8c1989618`](8c19896) Thanks [@jesstelford](https://github.com/jesstelford)! - Expose utilities for SASS Migrations to leverage the Suggestion-on-partial-fix pattern - [#7529](#7529) [`3652eb901`](3652eb9) Thanks [@samrose3](https://github.com/samrose3)! - Add relative option for replace-text-component migration - [#7532](#7532) [`ba576498d`](ba57649) Thanks [@jesstelford](https://github.com/jesstelford)! - Expose the .report() method to SASS migrations for easier aggregation of discovered issues during a migration run. ### Patch Changes - [#7606](#7606) [`cf7badbd1`](cf7badb) Thanks [@samrose3](https://github.com/samrose3)! - Update `createInlineComment` to format text with RegExp - [#7606](#7606) [`cf7badbd1`](cf7badb) Thanks [@samrose3](https://github.com/samrose3)! - Add support to replace Identifiers along with JSXIdentifiers for Text migration - [#7632](#7632) [`1f2ec8bfe`](1f2ec8b) Thanks [@samrose3](https://github.com/samrose3)! - Check for targeted component import before modifying in Text component migration - Updated dependencies \[[`6e9edd3b5`](6e9edd3)]: - @shopify/[email protected] ## @shopify/[email protected] ### Minor Changes - [#7572](#7572) [`20c8cad81`](20c8cad) Thanks [@laurkim](https://github.com/laurkim)! - Replaced usage of text components in component stories with `Text` component - [#7621](#7621) [`6e9edd3b5`](6e9edd3) Thanks [@aveline](https://github.com/aveline)! - - Added border width prop to `Box` - Exported color token subset alias types from tokens package and remove from `Box` - [#7068](#7068) [`ccdcea22e`](ccdcea2) Thanks [@laurkim](https://github.com/laurkim)! - Deprecated `DisplayText`, `Heading`, `Subheading`, `Caption`, `TextStyle`, and `VisuallyHidden` components ### Patch Changes - [#7644](#7644) [`b3e73ee04`](b3e73ee) Thanks [@kyledurand](https://github.com/kyledurand)! - Added horizontal spacing defaults to `Bleed` - [#7530](#7530) [`79d92a820`](79d92a8) Thanks [@samrose3](https://github.com/samrose3)! - Replaced all typography components with the new `Text` component. Added support for `text-inverse` color type on `Text`. Removed references to the following mixins to use the new `Text` or tokens directly in classes: `text-style-body`, `text-style-heading`, `text-style-subheading`, `text-style-caption`, `text-style-button`, `text-style-button-large`, `text-emphasis-subdued`, `text-emphasis-strong`, `nav-item-text-attributes`. - [#7577](#7577) [`db951f855`](db951f8) Thanks [@RickyMarou](https://github.com/RickyMarou)! - Page component: display subtitle even when it's the only header prop set - [#7633](#7633) [`1364be7f1`](1364be7) Thanks [@kyledurand](https://github.com/kyledurand)! - Renamed `alignY` prop to `alignBlock` on `Inline` Added more flex properties to `align` on `Inline` - [#7443](#7443) [`7a6fb7c1c`](7a6fb7c) Thanks [@iAmNathanJ](https://github.com/iAmNathanJ)! - Improve performance of the Scrollable component with React 18 - [#7625](#7625) [`9f8b651dd`](9f8b651) Thanks [@kyledurand](https://github.com/kyledurand)! - Removed wrap children with div from Inline component - [#7593](#7593) [`addd6bcdd`](addd6bc) Thanks [@kyledurand](https://github.com/kyledurand)! - Improved comments across layout components, changed default spacing of Inline component to match AlphaStack - [#7600](#7600) [`f006509be`](f006509) Thanks [@billycai](https://github.com/billycai)! - Add spacing between title and metadata for Page component - [#7563](#7563) [`a9051d678`](a9051d6) Thanks [@chazdean](https://github.com/chazdean)! - Updated `Inline` component docs and default prop values - [#7635](#7635) [`3cb5377a6`](3cb5377) Thanks [@iAmNathanJ](https://github.com/iAmNathanJ)! - Fixed Scrollable component to match existing onScrolledToBottom logic - Updated dependencies \[[`432bdd5fe`](432bdd5), [`6e9edd3b5`](6e9edd3), [`35be8a003`](35be8a0)]: - @shopify/[email protected] - @shopify/[email protected] ## @shopify/[email protected] ### Minor Changes - [#7621](#7621) [`6e9edd3b5`](6e9edd3) Thanks [@aveline](https://github.com/aveline)! - - Added border width prop to `Box` - Exported color token subset alias types from tokens package and remove from `Box` ## @shopify/[email protected] ### Minor Changes - [#7551](#7551) [`d7dc4436f`](d7dc443) Thanks [@aaronccasanova](https://github.com/aaronccasanova)! - Add `stylelint-polaris/coverage` rule ### Patch Changes - [#7589](#7589) [`b7b0ef5a9`](b7b0ef5) Thanks [@aaronccasanova](https://github.com/aaronccasanova)! - Add constraints to `stylelint-polaris/coverage` disable comments - Updated dependencies \[[`6e9edd3b5`](6e9edd3)]: - @shopify/[email protected] ## @shopify/[email protected] ### Patch Changes - Updated dependencies \[[`8859f5db5`](8859f5d), [`cf7badbd1`](cf7badb), [`cf7badbd1`](cf7badb), [`cf7badbd1`](cf7badb), [`8c1989618`](8c19896), [`3652eb901`](3652eb9), [`1f2ec8bfe`](1f2ec8b), [`ba576498d`](ba57649)]: - @shopify/[email protected] ## [email protected] ### Minor Changes - [#7068](#7068) [`ccdcea22e`](ccdcea2) Thanks [@laurkim](https://github.com/laurkim)! - Deprecated `DisplayText`, `Heading`, `Subheading`, `Caption`, `TextStyle`, and `VisuallyHidden` pages and removed examples - [#7609](#7609) [`343865159`](3438651) Thanks [@sarahill](https://github.com/sarahill)! - Added new type style guidance and info to typography docs ### Patch Changes - [#7634](#7634) [`4db441756`](4db4417) Thanks [@laurkim](https://github.com/laurkim)! - Replaced usage of typography components (`DisplayText`, `Heading`, `Subheading`, `Caption`, `VisuallyHidden`, `TextStyle`) with the new `Text` component - [#7604](#7604) [`aa82c82ff`](aa82c82) Thanks [@chazdean](https://github.com/chazdean)! - Updated `Inline` component doc vertical alignment example - [#7568](#7568) [`ab0cf251f`](ab0cf25) Thanks [@chazdean](https://github.com/chazdean)! - Updated `AlphaCard` component guidance and examples - [#7633](#7633) [`1364be7f1`](1364be7) Thanks [@kyledurand](https://github.com/kyledurand)! - Renamed `alignY` prop to `alignBlock` on `Inline` Added more flex properties to `align` on `Inline` - [#7527](#7527) [`924e9e5cd`](924e9e5) Thanks [@chazdean](https://github.com/chazdean)! - Update `Columns` component docs - [#7596](#7596) [`749ee31ee`](749ee31) Thanks [@kyledurand](https://github.com/kyledurand)! - Fixed home promo image layout - [#7563](#7563) [`a9051d678`](a9051d6) Thanks [@chazdean](https://github.com/chazdean)! - Updated `Inline` component docs and default prop values - [#7566](#7566) [`567822218`](5678222) Thanks [@kyledurand](https://github.com/kyledurand)! - Bumped nextjs - [#7602](#7602) [`9931ce0b4`](9931ce0) Thanks [@kyledurand](https://github.com/kyledurand)! - Bumped nextjs to 13.0.1 - [#7571](#7571) [`4c5ccc8fa`](4c5ccc8) Thanks [@chazdean](https://github.com/chazdean)! - Updated `Bleed` component guidance and examples - Updated dependencies \[[`b3e73ee04`](b3e73ee), [`20c8cad81`](20c8cad), [`79d92a820`](79d92a8), [`db951f855`](db951f8), [`432bdd5fe`](432bdd5), [`6e9edd3b5`](6e9edd3), [`ccdcea22e`](ccdcea2), [`1364be7f1`](1364be7), [`7a6fb7c1c`](7a6fb7c), [`9f8b651dd`](9f8b651), [`addd6bcdd`](addd6bc), [`f006509be`](f006509), [`a9051d678`](a9051d6), [`3cb5377a6`](3cb5377), [`35be8a003`](35be8a0)]: - @shopify/[email protected] - @shopify/[email protected] - @shopify/[email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR belongs to a series of proposed changes:
createSassMigrator method to wrap common functionality #7499Add stylelint metadata within shim #7541NOTE: This PR is best viewed with whitespace changes hidden
This enhances the
createSassMigrator
function to support the idea of "Reporting".In our current case, the only reporting we're doing is inserting comments into the code, but with this API matching that of
stylelint
, it should work as an in-editor lint error reporting system also 🎉You'll notice from the output that reports are now inserted as comments, giving an improved DX for people running the cli migrator.