From 8cfb2422465d24a1888e2b589aa65057a9ece256 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Thu, 21 Nov 2019 18:12:35 -0500 Subject: [PATCH] add various linters --- assets/sass/pages/_home.scss | 52 +++++++++++++++++------------------ assets/sass/pages/_notes.scss | 35 +++++++++++++---------- package.json | 20 +++++++++++--- 3 files changed, 62 insertions(+), 45 deletions(-) diff --git a/assets/sass/pages/_home.scss b/assets/sass/pages/_home.scss index 5f0238d2..16152244 100644 --- a/assets/sass/pages/_home.scss +++ b/assets/sass/pages/_home.scss @@ -8,6 +8,16 @@ body#home { max-width: 1070px; padding: 50px 65px; + a { + // Loop through $colors-home -- the main reason I switched to SASS :) + @each $id, $color in $colors-home { + &##{$id} { + color: $color; + background-image: underline-hack($color); + } + } + } + h1 { margin: 0; font-size: 1.5em; @@ -47,16 +57,6 @@ body#home { height: 160px; } - a { - // Loop through $colors-home -- the main reason I switched to SASS :) - @each $id, $color in $colors-home { - &##{$id} { - color: $color; - background-image: underline-hack($color); - } - } - } - // easter egg emoji cursor a#birthday { &:hover { @@ -94,22 +94,6 @@ body#home { } } - &#panda { - width: 20%; - text-align: center; - font-size: 1.25em; - line-height: 1.4; // magic numbers don't judge - - a { - display: inline-block; - transition: transform 0.2s ease-in-out; - - &:hover { - transform: scale(1.6) rotate(10deg); - } - } - } - &#info { width: 40%; text-align: right; @@ -125,6 +109,22 @@ body#home { } } } + + &#panda { + width: 20%; + text-align: center; + font-size: 1.25em; + line-height: 1.4; // magic numbers don't judge + + a { + display: inline-block; + transition: transform 0.2s ease-in-out; + + &:hover { + transform: scale(1.6) rotate(10deg); + } + } + } } } diff --git a/assets/sass/pages/_notes.scss b/assets/sass/pages/_notes.scss index afa58220..7a2b7750 100644 --- a/assets/sass/pages/_notes.scss +++ b/assets/sass/pages/_notes.scss @@ -33,7 +33,6 @@ body#notes { svg { width: 30px; height: 45px; - width: auto; } span#name { @@ -78,6 +77,7 @@ body#notes { display: flex; justify-content: space-between; + /* stylelint-disable-next-line no-descending-specificity */ a { color: inherit; } @@ -122,20 +122,6 @@ body#notes { main { &#single article div { - &#info { - text-align: center; - - h1 { - margin: 0.3em 0; - font-size: 2em; - line-height: 1.4; - - a { - color: inherit; - } - } - } - &#meta { color: $color-light; font-size: 0.85em; @@ -157,6 +143,20 @@ body#notes { } } + &#info { + text-align: center; + + h1 { + margin: 0.3em 0; + font-size: 2em; + line-height: 1.4; + + a { + color: inherit; + } + } + } + &#content { line-height: 1.8; @@ -275,12 +275,14 @@ body#notes { &#archive section.year { font-size: 1.1em; + /* stylelint-disable-next-line no-descending-specificity */ ul { list-style-type: none; padding-left: 0; display: block; } + /* stylelint-disable-next-line no-descending-specificity */ li { display: flex; @@ -296,15 +298,18 @@ body#notes { clear: both; } + /* stylelint-disable-next-line no-descending-specificity */ &:last-child { margin-bottom: 1.8em; } + /* stylelint-disable-next-line no-descending-specificity */ + li { margin-top: 1.3em; } } + /* stylelint-disable-next-line no-descending-specificity */ h2 { font-size: 1.8em; } diff --git a/package.json b/package.json index eec86fc3..2169ee2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jarv.is", - "version": "1.0.0", + "version": "1.3.37", "homepage": "https://jarv.is/", "license": "MIT", "private": true, @@ -10,8 +10,8 @@ "url": "https://github.com/jakejarvis" }, "scripts": { - "build": "npm run hugo:build && npm run optimize", - "build:preview": "npm run hugo:build-dev && npm run optimize", + "build": "rm -rf public resources && npm run hugo:build && npm run optimize", + "build:preview": "npm run hugo:build-dev", "hugo:build": "hugo --gc --cleanDestinationDir --verbose", "hugo:build-dev": "HUGO_ENV=development hugo -e development -b $DEPLOY_PRIME_URL --gc --cleanDestinationDir --buildDrafts --buildFuture --verbose", "hugo:serve": "hugo server --buildDrafts --buildFuture --port 1313 --bind=0.0.0.0 --verbose", @@ -19,6 +19,8 @@ "netlify:serve": "netlify dev --command 'npm run hugo:serve'", "optimize": "npm run optimize:img", "optimize:img": "find public/ -type d -exec imagemin {}/* --plugin=jpegoptim --plugin=pngquant --plugin=optipng --plugin=svgo --plugin=gifsicle --out-dir={} \\;", + "lint:markdown": "markdownlint content/notes/**/*.md", + "lint:sass": "stylelint assets/sass/**/* --syntax scss", "test": "hugo version; hugo env" }, "dependencies": {}, @@ -29,10 +31,20 @@ "imagemin-optipng": "^7.1.0", "imagemin-pngquant": "^8.0.0", "imagemin-svgo": "^7.0.0", - "netlify-cli": "^2.21.0" + "markdownlint-cli": "~0.19.0", + "netlify-cli": "^2.21.0", + "stylelint": "~12.0.0", + "stylelint-config-recommended-scss": "~4.1.0", + "stylelint-scss": "~3.13.0" }, "repository": { "type": "git", "url": "git+https://github.com/jakejarvis/jarv.is.git" + }, + "stylelint": { + "extends": "stylelint-config-recommended-scss", + "rules": { + "selector-type-no-unknown": null + } } }