Replace gulp with plain npm for linting.

This commit is contained in:
Fredrik Jonsson 2021-06-21 19:20:17 +02:00
commit d4117c730b
26 changed files with 1782 additions and 3864 deletions

View file

@ -1,7 +1,11 @@
extends: eslint:recommended
env:
browser: true,
es6: true
browser: true
es2021: true
extends: 'eslint:recommended'
plugins:
- template
parserOptions:
ecmaVersion: 12
globals:
jQuery: true
u: true
@ -17,7 +21,6 @@ rules:
comma-dangle:
- "error"
- never
comma-spacing: "error"
comma-style:
- "error"
- last

View file

@ -1,124 +0,0 @@
# Documentation for the sass-lint Linters is available at:
# https://github.com/sasstools/sass-lint/tree/master/docs/rules
options:
formatter: stylish
merge-default-rules: true
rules:
# Extends
extends-before-mixins: 2
extends-before-declarations: 2
placeholder-in-extend: 2
# Mixins
mixins-before-declarations:
- 2
- exclude:
- 'breakpoint'
- 'mq'
- 'respond-to'
- 'rtl'
- 'zen-breakpoint'
- 'zen-layout'
- 'zen-mq'
- 'zen-respond-to'
# Line Spacing
one-declaration-per-line: 2
empty-line-between-blocks:
- 2
- ignore-single-line-rulesets: false
single-line-per-selector: 2
# Disallows
no-attribute-selectors: 0
no-color-hex: 2
no-color-keywords: 2
no-color-literals: 2
no-combinators: 0
no-css-comments: 2
no-debug: 2
no-disallowed-properties: 2
no-duplicate-properties: 2
no-empty-rulesets: 0
no-extends: 0
no-ids: 2
no-important: 2
no-invalid-hex: 2
no-mergeable-selectors: 2
no-misspelled-properties:
- 2
- extra-properties:
- '*font-family'
- '*height'
- 'interpolation-mode'
- '*margin-left'
- '*vertical-align'
- '*width'
no-qualifying-elements: 0
no-trailing-whitespace: 2
no-trailing-zero: 2
no-transition-all: 0
no-universal-selectors: 0
no-url-protocols: 2
no-vendor-prefixes: 2
no-warn: 2
property-units: 0
# Nesting
force-attribute-nesting: 0
force-element-nesting: 0
force-pseudo-nesting: 0
# Name Formats
class-name-format:
- 2
- convention: hyphenatedbem
function-name-format: 2
id-name-format: 2
mixin-name-format:
- 2
- convention: hyphenatedbem
placeholder-name-format:
- 2
- convention: hyphenatedbem
variable-name-format: 2
# Style Guide
attribute-quotes: 2
bem-depth: 0
border-zero: 2
brace-style:
- 2
- style: stroustrup
- allow-single-line: false
clean-import-paths: 2
empty-args: 0
hex-length: 2
hex-notation: 2
indentation: 2
leading-zero: 2
nesting-depth:
- 2
- max-depth: 4
property-sort-order: 0
pseudo-element: 1
quotes: 2
shorthand-values: 2
url-quotes: 2
variable-for-property: 2
zero-unit: 2
# Inner Spacing
space-after-comma: 2
space-before-colon: 2
space-after-colon: 2
space-before-brace: 2
space-before-bang: 2
space-after-bang: 2
space-between-parens: 0
space-around-operator: 0
# Final Items
trailing-semicolon: 2
final-newline: 2

84
.stylelintrc.yaml Normal file
View file

@ -0,0 +1,84 @@
plugins:
- stylelint-scss
rules:
at-rule-disallowed-list:
- debug
at-rule-no-unknown:
at-rule-no-vendor-prefix: true
block-no-empty: true
block-opening-brace-space-before: always
color-hex-case: lower
color-hex-length: short
color-named: never
color-no-hex: true
color-no-invalid-hex: true
declaration-bang-space-after: never
declaration-bang-space-before: always
declaration-block-semicolon-newline-after: always
declaration-block-semicolon-space-before: never
declaration-block-single-line-max-declarations: 1
declaration-block-trailing-semicolon: always
declaration-colon-space-after: always-single-line
declaration-colon-space-before: never
declaration-no-important: true
declaration-property-value-disallowed-list:
border:
- none
border-top:
- none
border-right:
- none
border-bottom:
- none
border-left:
- none
function-comma-space-after: always-single-line
function-parentheses-space-inside: never
function-url-quotes: always
indentation: 2
length-zero-no-unit: true
max-nesting-depth:
- 3
- ignoreAtRules:
- each
- media
- supports
- include
media-feature-name-no-vendor-prefix: true
media-feature-parentheses-space-inside: never
no-missing-end-of-source-newline: true
number-leading-zero: never
number-no-trailing-zeros: true
property-no-unknown: true
property-no-vendor-prefix: true
rule-empty-line-before:
- always-multi-line
- except:
- first-nested
ignore:
- after-comment
scss/at-extend-no-missing-placeholder: true
scss/at-function-pattern: "^[a-z]+([a-z0-9-]+[a-z0-9]+)?$"
scss/at-import-no-partial-leading-underscore: true
scss/at-import-partial-extension-blacklist:
- scss
scss/at-mixin-pattern: "^[a-z]+([a-z0-9-]+[a-z0-9]+)?$"
scss/at-rule-no-unknown: true
#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/percent-placeholder-pattern: "^[a-z]+([a-z0-9-]+[a-z0-9]+)?$"
#scss/selector-no-redundant-nesting-selector: true
selector-class-pattern:
- "^[a-z0-9\\-]+$"
- message: Selector should be written in lowercase with hyphens (selector-class-pattern)
selector-list-comma-newline-after: always
selector-max-compound-selectors: 3
selector-max-id: 0
#selector-no-qualifying-type: true
selector-no-vendor-prefix: true
selector-pseudo-element-colon-notation: double
selector-pseudo-element-no-unknown: true
shorthand-property-no-redundant-values: true
string-quotes: single
value-no-vendor-prefix: true

View file

@ -1,3 +1,4 @@
/* eslint-disable no-undef */
(function () {
'use strict';

View file

@ -3,10 +3,10 @@
* A JavaScript file for the theme.
*/
(function ($) {
(function () {
'use strict';
// Place your code here.
})(u);
})();

View file

@ -1,3 +1,5 @@
/* eslint-disable no-undef */
/**
* @file
* A JavaScript file for flexsearch.
@ -36,7 +38,7 @@
results.appendChild(fragment);
}
function doSearch () {
function doSearch() {
const query = document.querySelector('.search-text').value.trim();
const results = flexSearch.search({
query: query,
@ -45,21 +47,21 @@
showResults(results);
}
function enableUI () {
function enableUI() {
const searchform = document.querySelector('.search-form');
searchform.addEventListener('submit', function (e) {
e.preventDefault();
doSearch();
})
});
searchform.addEventListener('keyup', function () {
doSearch();
})
});
document.querySelector('.search-loading').classList.add('hidden');
document.querySelector('.search-input').classList.remove('hidden');
document.querySelector('.search-text').focus();
}
function buildIndex () {
function buildIndex() {
document.querySelector('.search-loading').classList.remove('hidden');
fetch('/searchindex.json')
.then(function (response) {

View file

@ -1,3 +1,5 @@
/* eslint-disable no-undef */
/**
* @file
* A JavaScript file for analytic tracking.

View file

@ -1,3 +1,3 @@
// sass-lint:disable no-css-comments, no-color-hex, no-color-literals
// stylelint-disable color-no-hex, color-named
// Site custom styles

View file

@ -83,7 +83,6 @@ aside {
}
article {
& > header {
color: $text-meta;
}

View file

@ -1,4 +1,4 @@
// sass-lint:disable no-vendor-prefixes
// stylelint-disable property-no-vendor-prefix
// Document
//

View file

@ -1,4 +1,4 @@
// sass-lint:disable no-vendor-prefixes, no-css-comments
// stylelint-disable property-no-vendor-prefix
// Form defaults
//

View file

@ -14,7 +14,7 @@
a,
%link {
color: $link;
// sass-lint:disable no-vendor-prefixes
// stylelint-disable property-no-vendor-prefix
// Remove gaps in links underline in iOS 8+ and Safari 8+.
-webkit-text-decoration-skip: objects;
}

View file

@ -10,7 +10,7 @@
abbr[title] {
// Remove the bottom border in Chrome 57- and Firefox 39-.
border-bottom: 0;
// sass-lint:disable no-duplicate-properties
// stylelint-disable no-duplicate-properties
// Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
text-decoration: underline;
text-decoration: underline dotted;
@ -31,7 +31,7 @@ strong {
font-weight: inherit;
}
// sass-lint:disable no-mergeable-selectors
// stylelint-disable no-mergeable-selectors
b,
strong {
// Add the correct font weight in Chrome, Edge, and Safari.

View file

@ -14,7 +14,7 @@ button,
[type='button'],
[type='reset'],
[type='submit'] {
// sass-lint:disable no-color-hex, no-color-literals
// stylelint-disable color-no-hex, color-named
@extend %button--disabled;
@include typeface(headings);
@include margin-right(.75);
@ -38,7 +38,7 @@ button,
border-bottom-color: #b4b4b4;
border-radius: 2px;
// sass-lint:disable no-vendor-prefixes
// stylelint-disable property-no-vendor-prefix
// Correct the inability to style clickable types in iOS and Safari.
-moz-appearance: button;
-webkit-appearance: button;
@ -53,7 +53,7 @@ button,
&:-moz-focusring {
outline: 1px dotted ButtonText;
}
// sass-lint:enable no-vendor-prefixes
// sass-lint:enable property-no-vendor-prefix
&:hover,
&:focus,

View file

@ -3,11 +3,11 @@
.cookieconsent {
@include type-layout(s, 1);
position: sticky;
bottom: 0;
bottom: 0;
width: 100%;
color: $warning;
background-color: $warning-bg;
border-top: 4px solid $warning-border;
border-top: 4px solid $warning-border;
text-align: center;
transform: translateY(100vh);
transition: all 130ms ease-in;

View file

@ -1,3 +1,5 @@
// stylelint-disable selector-max-compound-selectors
// Inline sibling
//
// An element that needs to appear inline with the content that follows.

View file

@ -14,7 +14,7 @@
font-size: 75px;
line-height: 1;
text-align: center;
// sass-lint:disable no-color-literals
// stylelint-disable no-color-literals
text-shadow: 0 0 1px rgba(0, 0, 0, .1);
word-wrap: break-word;
}

View file

@ -9,7 +9,6 @@ $with-wireframes: false !default;
// variable: `$with-wireframes: true;`
@if $with-wireframes {
.wireframe,
%wireframe {
outline: 1px solid $border;
@ -31,5 +30,4 @@ $with-wireframes: false !default;
@extend %wireframe;
}
}
}

View file

@ -1,4 +1,4 @@
// sass-lint:disable no-color-keywords; no-color-hex
// stylelint-disable color-no-hex, color-named
// Base colors.
$black: #000;

View file

@ -102,7 +102,7 @@ $typefaces: (
// We could also specify the following property:
// letter-spacing: .5px,
),
);
); // stylelint-disable indentation
// Output a horizontal grid to help with debugging typography.
$typey-debug: false;

Some files were not shown because too many files have changed in this diff Show more