From b16c056c320077b604047182a0ea56d5bfe0ff4c Mon Sep 17 00:00:00 2001 From: Jonathan Belcher Date: Thu, 1 Nov 2018 17:03:00 -0400 Subject: [PATCH] Makes stylelint config match prettier settings (https://github.com/woocommerce/woocommerce-admin/pull/733) * Makes stylelint config match prettier settings * Fix/all css lints (https://github.com/woocommerce/woocommerce-admin/pull/734) * Fix all sass lints! * Delete settings.json * Update newline rule, which also conflicts with prettier * Fix remaining stylelint issues * Disable stylelint rule for a line to avoid prettier/linter fights --- plugins/woocommerce-admin/.stylelintrc.json | 7 +++++-- .../woocommerce-admin/client/components/card/style.scss | 2 +- .../woocommerce-admin/client/components/chart/style.scss | 2 +- .../woocommerce-admin/client/components/table/style.scss | 2 +- .../client/header/activity-panel/style.scss | 4 ++-- .../client/stylesheets/abstracts/_breakpoints.scss | 8 ++++++-- .../client/stylesheets/abstracts/_variables.scss | 2 ++ 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/plugins/woocommerce-admin/.stylelintrc.json b/plugins/woocommerce-admin/.stylelintrc.json index 648e2272055..d474b1568d3 100644 --- a/plugins/woocommerce-admin/.stylelintrc.json +++ b/plugins/woocommerce-admin/.stylelintrc.json @@ -5,6 +5,7 @@ "at-rule-no-unknown": null, "comment-empty-line-before": null, "declaration-block-no-duplicate-properties": null, + "declaration-colon-newline-after": null, "declaration-property-unit-whitelist": null, "font-weight-notation": null, "max-line-length": null, @@ -12,6 +13,8 @@ "no-duplicate-selectors": null, "rule-empty-line-before": null, "selector-class-pattern": null, - "value-keyword-case": null + "string-quotes": "single", + "value-keyword-case": null, + "value-list-comma-newline-after": null } -} \ No newline at end of file +} diff --git a/plugins/woocommerce-admin/client/components/card/style.scss b/plugins/woocommerce-admin/client/components/card/style.scss index 79692ccce57..3467cd738d7 100644 --- a/plugins/woocommerce-admin/client/components/card/style.scss +++ b/plugins/woocommerce-admin/client/components/card/style.scss @@ -2,7 +2,7 @@ .woocommerce-card { margin-bottom: $gap-large; - background: white; + background: $white; border: 1px solid $core-grey-light-700; @include breakpoint( '<782px' ) { diff --git a/plugins/woocommerce-admin/client/components/chart/style.scss b/plugins/woocommerce-admin/client/components/chart/style.scss index c563f0d3546..ad1919bd3fc 100644 --- a/plugins/woocommerce-admin/client/components/chart/style.scss +++ b/plugins/woocommerce-admin/client/components/chart/style.scss @@ -2,7 +2,7 @@ .woocommerce-chart { margin-top: -$gap; margin-bottom: $gap-large; - background: white; + background: $white; border: 1px solid $core-grey-light-700; border-top: 0; diff --git a/plugins/woocommerce-admin/client/components/table/style.scss b/plugins/woocommerce-admin/client/components/table/style.scss index ab2bfd7f21a..3c527f3ab31 100644 --- a/plugins/woocommerce-admin/client/components/table/style.scss +++ b/plugins/woocommerce-admin/client/components/table/style.scss @@ -123,7 +123,7 @@ padding-top: $gap; padding-bottom: $gap; z-index: 1; - background: white; + background: $white; position: relative; } } diff --git a/plugins/woocommerce-admin/client/header/activity-panel/style.scss b/plugins/woocommerce-admin/client/header/activity-panel/style.scss index e484927c772..6d687a46c07 100644 --- a/plugins/woocommerce-admin/client/header/activity-panel/style.scss +++ b/plugins/woocommerce-admin/client/header/activity-panel/style.scss @@ -10,7 +10,7 @@ @include breakpoint( '<782px' ) { position: relative; - background: #fff; + background: $white; margin: 0; padding: 0; top: -3px; @@ -167,7 +167,7 @@ position: absolute; padding: 1px; background: $core-orange; - border: 2px solid white; + border: 2px solid $white; width: 4px; height: 4px; display: inline-block; diff --git a/plugins/woocommerce-admin/client/stylesheets/abstracts/_breakpoints.scss b/plugins/woocommerce-admin/client/stylesheets/abstracts/_breakpoints.scss index 145f8768eab..e89ab3a779b 100644 --- a/plugins/woocommerce-admin/client/stylesheets/abstracts/_breakpoints.scss +++ b/plugins/woocommerce-admin/client/stylesheets/abstracts/_breakpoints.scss @@ -1,5 +1,7 @@ /** @format */ +/* stylelint-disable block-closing-brace-newline-after */ + // Breakpoints // Forked from https://github.com/Automattic/wp-calypso/blob/46ae24d8800fb85da6acf057a640e60dac988a38/assets/stylesheets/shared/mixins/_breakpoints.scss @@ -44,14 +46,16 @@ $breakpoints: 320px, 400px, 600px, 782px, 960px, 1100px, 1365px; @each $breakpoint in $breakpoints { $sizes: $sizes + ' ' + $breakpoint; } - @warn "ERROR in breakpoint( #{ $size } ) : You can only use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth( $breakpoints, 1 ) } >#{ nth( $breakpoints, 1 ) } #{ nth( $breakpoints, 1 ) }-#{ nth( $breakpoints, 2 ) } ]"; + @warn 'ERROR in breakpoint( #{ $size } ) : You can only use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth( $breakpoints, 1 ) } >#{ nth( $breakpoints, 1 ) } #{ nth( $breakpoints, 1 ) }-#{ nth( $breakpoints, 2 ) } ]'; } } @else { $sizes: ''; @each $breakpoint in $breakpoints { $sizes: $sizes + ' ' + $breakpoint; } - @error "ERROR in breakpoint( #{ $size } ) : Please wrap the breakpoint $size in parenthesis. You can use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth( $breakpoints, 1 ) } >#{ nth( $breakpoints, 1 ) } #{ nth( $breakpoints, 1 ) }-#{ nth( $breakpoints, 2 ) } ]"; + @error 'ERROR in breakpoint( #{ $size } ) : Please wrap the breakpoint $size in parenthesis. You can use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth( $breakpoints, 1 ) } >#{ nth( $breakpoints, 1 ) } #{ nth( $breakpoints, 1 ) }-#{ nth( $breakpoints, 2 ) } ]'; } } } + +/* stylelint-enable */ diff --git a/plugins/woocommerce-admin/client/stylesheets/abstracts/_variables.scss b/plugins/woocommerce-admin/client/stylesheets/abstracts/_variables.scss index 1dc88782b44..c6b45806ebe 100644 --- a/plugins/woocommerce-admin/client/stylesheets/abstracts/_variables.scss +++ b/plugins/woocommerce-admin/client/stylesheets/abstracts/_variables.scss @@ -24,7 +24,9 @@ $dark-gray-300: $core-grey-dark-300; $dark-gray-900: $core-grey-dark-900; $alert-red: $error-red; +/* stylelint-disable */ :export { gaplarge: $gap-large; gap: $gap; } +/* stylelint-enable */