From d69654162f1be6074b27edf39ce41ecbc79f5b0b Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Tue, 25 Jan 2022 10:30:57 +0100 Subject: [PATCH] Updating lining for css and js. --- .eslintignore | 1 + .stylelintignore | 1 + .stylelintrc.yaml | 7 +++- assets/js/lozadinit.js | 2 +- assets/js/search.js | 12 +++--- assets/sass/_init.scss | 2 +- assets/sass/_variables.scss | 12 +++--- .../responsive-video/_responsive-video.scss | 4 +- assets/sass/reset/forms/_forms.scss | 2 + assets/sass/styles.scss | 8 ++-- package-lock.json | 42 +++++++++++++++++++ 11 files changed, 73 insertions(+), 20 deletions(-) create mode 100644 .stylelintignore diff --git a/.eslintignore b/.eslintignore index 7f74b6f..b1f8c81 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ +*.compact.js *.min.js umbrella.js diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 0000000..e350727 --- /dev/null +++ b/.stylelintignore @@ -0,0 +1 @@ +typey/ diff --git a/.stylelintrc.yaml b/.stylelintrc.yaml index 20dc383..65faf0b 100644 --- a/.stylelintrc.yaml +++ b/.stylelintrc.yaml @@ -1,9 +1,11 @@ plugins: - stylelint-scss +extends: + - stylelint-config-recommended-scss rules: at-rule-disallowed-list: - debug - at-rule-no-unknown: + at-rule-no-unknown: null at-rule-no-vendor-prefix: true block-no-empty: true block-opening-brace-space-before: always @@ -46,6 +48,7 @@ rules: - include media-feature-name-no-vendor-prefix: true media-feature-parentheses-space-inside: never + no-descending-specificity: null no-missing-end-of-source-newline: true number-leading-zero: never number-no-trailing-zeros: true @@ -64,9 +67,11 @@ rules: - scss scss/at-mixin-pattern: "^[a-z]+([a-z0-9-]+[a-z0-9]+)?$" scss/at-rule-no-unknown: true + scss/comment-no-empty: null #scss/dollar-variable-colon-space-after: always scss/dollar-variable-colon-space-before: never scss/dollar-variable-pattern: "^[_]?[a-z]+([a-z0-9-]+[a-z0-9]+)?$" + scss/no-global-function-names: null #scss/percent-placeholder-pattern: "^[a-z]+([a-z0-9-]+[a-z0-9]+)?$" #scss/selector-no-redundant-nesting-selector: true selector-class-pattern: diff --git a/assets/js/lozadinit.js b/assets/js/lozadinit.js index 65cfaaa..d8c97ea 100644 --- a/assets/js/lozadinit.js +++ b/assets/js/lozadinit.js @@ -3,7 +3,7 @@ 'use strict'; // Lazy load images with lozad.js. - const observer = window.lozad(); // + const observer = window.lozad(); observer.observe(); diff --git a/assets/js/search.js b/assets/js/search.js index 9ac173b..9e464dd 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -1,4 +1,4 @@ -/* eslint-disable no-undef */ +/* eslint-disable no-undef, guard-for-in */ /** * @file @@ -47,10 +47,10 @@ limit: {{ site.Params.searchLimit | default 20 }} }); const items = {}; - results.forEach( function(result) { - result.result.forEach( function(r) { - items[r.id] = r.doc; - }); + results.forEach(function (result) { + result.result.forEach(function (r) { + items[r.id] = r.doc; + }); }); showResults(items); } @@ -78,7 +78,7 @@ .then(function (data) { data.forEach(function (item) { index.add(item); - }) + }); }); } diff --git a/assets/sass/_init.scss b/assets/sass/_init.scss index cc58e80..6b5caea 100644 --- a/assets/sass/_init.scss +++ b/assets/sass/_init.scss @@ -1,5 +1,5 @@ // Initialization partial -// + // To make it easier to use all variables and mixins in any Sass file in this // project, each .scss file has a `@import 'init';` declaration. The _init.scss // file is in charge of importing all the other partials needed for the diff --git a/assets/sass/_variables.scss b/assets/sass/_variables.scss index 0023a5b..67dd858 100644 --- a/assets/sass/_variables.scss +++ b/assets/sass/_variables.scss @@ -1,10 +1,12 @@ +// stylelint-disable value-keyword-case + // Variables -// + // Set variables for this site before a library sets its !default value. // Font faces, stacks and sizes. -// + // Font styling and line heights are controlled by the several variables that // used by mixins like `type-layout()`, `margin-top()`, and `margin-bottom()`. // These variable and mixins are documented on the [Typey @@ -102,7 +104,7 @@ $rem-fallback: false; $auto-print-sizing: false; // Breakpoints -// + // Use the `respond-to()` mixin to use named breakpoints. $breakpoints: ( @@ -132,9 +134,9 @@ $l-radius: 1rem; // Miscellaneous variables -// + // `$indent-amount` controls the amount lists, blockquotes and comments are indented. -// + // `$include-rtl` controls whether RTL styles are output. $indent-amount: 2 * $base-font-size; diff --git a/assets/sass/components/responsive-video/_responsive-video.scss b/assets/sass/components/responsive-video/_responsive-video.scss index 7f51844..3e78b22 100644 --- a/assets/sass/components/responsive-video/_responsive-video.scss +++ b/assets/sass/components/responsive-video/_responsive-video.scss @@ -10,7 +10,7 @@ .responsive-video, %responsive-video { position: relative; - padding-bottom: (9/16)*100%; // 16:9 aspect ratio + padding-bottom: (9 / 16) * 100%; // 16:9 aspect ratio padding-top: 25px; // Height of video controls height: 0; @@ -27,6 +27,6 @@ } &--4-3 { - padding-bottom: (3/4)*100%; // 4:3 aspect ratio + padding-bottom: (3 / 4) * 100%; // 4:3 aspect ratio } } diff --git a/assets/sass/reset/forms/_forms.scss b/assets/sass/reset/forms/_forms.scss index 706afc5..174afa3 100644 --- a/assets/sass/reset/forms/_forms.scss +++ b/assets/sass/reset/forms/_forms.scss @@ -1,3 +1,5 @@ +// stylelint-disable property-no-vendor-prefix + // Form defaults. input, diff --git a/assets/sass/styles.scss b/assets/sass/styles.scss index 7019c82..3e59474 100644 --- a/assets/sass/styles.scss +++ b/assets/sass/styles.scss @@ -1,6 +1,6 @@ -// -// The major stylesheet for this theme. -// +// stylelint-disable no-invalid-position-at-import-rule + +// The main stylesheet for this theme. // Colors and Sass @@ -31,7 +31,7 @@ @import 'layouts/layouts'; // Components -// + // Design components are reusable designs that can be applied using just the CSS // class names specified in the component. diff --git a/package-lock.json b/package-lock.json index 5a15180..cf29340 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1375,6 +1375,12 @@ "integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==", "dev": true }, + "postcss-scss": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.3.tgz", + "integrity": "sha512-j4KxzWovfdHsyxwl1BxkUal/O4uirvHgdzMKS1aWJBAV0qh2qj5qAZqpeBfVUYGWv+4iK9Az7SPyZ4fyNju1uA==", + "dev": true + }, "postcss-selector-parser": { "version": "6.0.9", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.9.tgz", @@ -1761,6 +1767,42 @@ } } }, + "stylelint-config-recommended": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-6.0.0.tgz", + "integrity": "sha512-ZorSSdyMcxWpROYUvLEMm0vSZud2uB7tX1hzBZwvVY9SV/uly4AvvJPPhCcymZL3fcQhEQG5AELmrxWqtmzacw==", + "dev": true + }, + "stylelint-config-recommended-scss": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-5.0.2.tgz", + "integrity": "sha512-b14BSZjcwW0hqbzm9b0S/ScN2+3CO3O4vcMNOw2KGf8lfVSwJ4p5TbNEXKwKl1+0FMtgRXZj6DqVUe/7nGnuBg==", + "dev": true, + "requires": { + "postcss-scss": "^4.0.2", + "stylelint-config-recommended": "^6.0.0", + "stylelint-scss": "^4.0.0" + } + }, + "stylelint-config-standard": { + "version": "24.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-24.0.0.tgz", + "integrity": "sha512-+RtU7fbNT+VlNbdXJvnjc3USNPZRiRVp/d2DxOF/vBDDTi0kH5RX2Ny6errdtZJH3boO+bmqIYEllEmok4jiuw==", + "dev": true, + "requires": { + "stylelint-config-recommended": "^6.0.0" + } + }, + "stylelint-config-standard-scss": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-3.0.0.tgz", + "integrity": "sha512-zt3ZbzIbllN1iCmc94e4pDxqpkzeR6CJo5DDXzltshuXr+82B8ylHyMMARNnUYrZH80B7wgY7UkKTYCFM0UUyw==", + "dev": true, + "requires": { + "stylelint-config-recommended-scss": "^5.0.2", + "stylelint-config-standard": "^24.0.0" + } + }, "stylelint-scss": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-4.1.0.tgz",