From 8d69dceb2e03882cfb2040c96c1d6578b1ac61f8 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 15 Aug 2019 10:55:02 +0300 Subject: [PATCH 1/2] Tighten stylint config. --- .stylintrc | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) diff --git a/.stylintrc b/.stylintrc index 05316154a9c46..8dd7db519782c 100644 --- a/.stylintrc +++ b/.stylintrc @@ -1,10 +1,117 @@ { + "blocks": false, + "brackets": { + "expect": false, + "error": true + }, "colons": { "expect": "never", "error": true }, + "colors": false, + "commaSpace": { + "expect": "always", + "error": true + }, + "commentSpace": { + "expect": "always", + "error": true + }, + "cssLiteral": { + "expect": "never", + "error": true + }, + "depthLimit": false, + "duplicates":{ + "expect": true, + "error": true + }, + "efficient": { + "expect": "always", + "error": true + }, + "exclude": [], + "extendPref": "@extends", + "globalDupe": false, + "groupOutputByFile": true, "indentPref": { "expect": 2, "error": true - } + }, + "leadingZero": { + "expect": "always", + "error": true + }, + "maxErrors": false, + "maxWarnings": false, + "mixed": { + "expect": true, + "error": true + }, + "namingConvention": { + "expect": "lowercase-dash", + "error": true + }, + "namingConventionStrict": { + "expect": true, + "error": true + }, + "none": { + "expect": "always", + "error": true + }, + "noImportant": false, + "parenSpace": { + "expect": "never", + "error": true + }, + "placeholders": { + "expect": "always", + "error": true + }, + "prefixVarsWithDollar": { + "expect": "always", + "error": true + }, + "quotePref": { + "expect": "single", + "error": true + }, + "reporterOptions": { + "columns": [ + "lineData", + "severity", + "description", + "rule" + ], + "columnSplitter": " ", + "showHeaders": false, + "truncate": true + }, + "semicolons": { + "expect": "never", + "error": true + }, + "sortOrder": false, + "stackedProperties": { + "expect": "never", + "error": true + }, + "trailingWhitespace": { + "expect": "never", + "error": true + }, + "universal": { + "expect": "never", + "error": true + }, + "valid": { + "expect": true, + "error": true + }, + "zeroUnits": { + "expect": "never", + "error": true + }, + "zIndexNormalize": false } From ce299133a86984e036be28c20d44cf0a4b7a93c3 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 15 Aug 2019 13:20:07 +0300 Subject: [PATCH 2/2] Adhere to the stricter stylint rules. --- layouts/css/_base.styl | 2 +- layouts/css/layout/_lists.styl | 2 +- layouts/css/layout/_sticky-footer.styl | 2 +- layouts/css/page-modules/_anchorLinks.styl | 2 +- layouts/css/page-modules/_download.styl | 12 ++++++------ layouts/css/page-modules/_header.styl | 6 +++--- layouts/css/page-modules/_home.styl | 4 ++-- layouts/css/page-modules/_prev-next-navigation.styl | 2 +- layouts/css/page-modules/_scrollToTop.styl | 2 ++ layouts/css/styles.styl | 4 +++- 10 files changed, 21 insertions(+), 17 deletions(-) diff --git a/layouts/css/_base.styl b/layouts/css/_base.styl index 96763c6d8fc48..423af19c6b073 100644 --- a/layouts/css/_base.styl +++ b/layouts/css/_base.styl @@ -88,5 +88,5 @@ blockquote top 0 left 0 background-color rgba(0, 0, 0, 0.14) - content "" + content '' display block diff --git a/layouts/css/layout/_lists.styl b/layouts/css/layout/_lists.styl index 5b427a2f9cdb2..04faba7148d53 100644 --- a/layouts/css/layout/_lists.styl +++ b/layouts/css/layout/_lists.styl @@ -7,7 +7,7 @@ + li:before content '|' - padding 0 .3em 0 .1em + padding 0 0.3em 0 0.1em color $light-gray @media screen and (max-width: 480px) diff --git a/layouts/css/layout/_sticky-footer.styl b/layouts/css/layout/_sticky-footer.styl index 02533dfb2d20d..c67d43b13ae73 100644 --- a/layouts/css/layout/_sticky-footer.styl +++ b/layouts/css/layout/_sticky-footer.styl @@ -1,6 +1,6 @@ // Modernizr test for IE10 and IE11 // see: http://thatemil.com/blog/2013/11/03/sticky-footers-flexbox-and-ie10/ -.flexboxtweener +.flexboxtweener, .flexboxtweener body height 100% diff --git a/layouts/css/page-modules/_anchorLinks.styl b/layouts/css/page-modules/_anchorLinks.styl index 8c6f305129be1..68d016367af8d 100644 --- a/layouts/css/page-modules/_anchorLinks.styl +++ b/layouts/css/page-modules/_anchorLinks.styl @@ -2,7 +2,7 @@ .anchor color $light-gray2 background none - padding 0 .25em + padding 0 0.25em &:link &:active diff --git a/layouts/css/page-modules/_download.styl b/layouts/css/page-modules/_download.styl index e1b0497ca284c..ff72b753ff276 100644 --- a/layouts/css/page-modules/_download.styl +++ b/layouts/css/page-modules/_download.styl @@ -13,7 +13,7 @@ .download-header::after display block clear both - content "" + content '' .download-hero margin-bottom 1em @@ -99,7 +99,7 @@ height 100% width 100% text-align center - font-size 0.8em; + font-size 0.8em a:hover, a:active background $node-green @@ -153,7 +153,7 @@ td.download-table-last flex-basis 160px .tag - font-size .6em + font-size 0.6em .download-matrix display block @@ -168,13 +168,13 @@ td.download-table-last td display block - border 0 + border none a text-align left .download-table - border 0 + border none > thead display none @@ -217,4 +217,4 @@ td.download-table-last li font-size 1em .tag - font-size .4em + font-size 0.4em diff --git a/layouts/css/page-modules/_header.styl b/layouts/css/page-modules/_header.styl index a99ef2a514b9a..97b63250c7640 100644 --- a/layouts/css/page-modules/_header.styl +++ b/layouts/css/page-modules/_header.styl @@ -79,13 +79,13 @@ header header li $border-width = 14px - padding-bottom 12px; + padding-bottom 12px &.active:after top 100% left 50% border solid transparent - content " " + content ' ' height 0 width 0 position absolute @@ -138,7 +138,7 @@ header img display block - margin .5em auto 0 auto + margin 0.5em auto 0 border none max-height 75px max-width 180px diff --git a/layouts/css/page-modules/_home.styl b/layouts/css/page-modules/_home.styl index 012368d63d55e..bd5e394a4c9d3 100644 --- a/layouts/css/page-modules/_home.styl +++ b/layouts/css/page-modules/_home.styl @@ -42,7 +42,7 @@ .home-banner opacity 1 - transition opacity .2s ease-in-out + transition opacity 0.2s ease-in-out &:hover opacity 0.85 @@ -65,7 +65,7 @@ font-size 30px font-weight 400 - transition background-color .2s ease-in-out + transition background-color 0.2s ease-in-out &:hover background-color $node-green diff --git a/layouts/css/page-modules/_prev-next-navigation.styl b/layouts/css/page-modules/_prev-next-navigation.styl index 73b78f2d82f23..255b501ce4bac 100644 --- a/layouts/css/page-modules/_prev-next-navigation.styl +++ b/layouts/css/page-modules/_prev-next-navigation.styl @@ -1,5 +1,5 @@ .btn-navigation - padding .1em .5em + padding 0.1em 0.5em &.btn-prev float left diff --git a/layouts/css/page-modules/_scrollToTop.styl b/layouts/css/page-modules/_scrollToTop.styl index eea98f0789d3c..7d2ae176c01d8 100644 --- a/layouts/css/page-modules/_scrollToTop.styl +++ b/layouts/css/page-modules/_scrollToTop.styl @@ -1,6 +1,8 @@ // For smooth scroll behavior html + // @stylint off scroll-behavior smooth + // @stylint on #scroll-to-top font-size 1rem diff --git a/layouts/css/styles.styl b/layouts/css/styles.styl index 5846240ceef4a..c58fec7d6695e 100644 --- a/layouts/css/styles.styl +++ b/layouts/css/styles.styl @@ -99,10 +99,12 @@ a:hover .color-lightgray border-radius 2px margin-top 1em + // @stylint off & *:first-child + // @stylint on margin-top 0.5rem -html[dir="rtl"] +html[dir='rtl'] .has-side-nav aside float right