Skip to content

Commit

Permalink
Stylelint v15 update (#276)
Browse files Browse the repository at this point in the history
* Update npm dependencies

* Remove deprecated stylelint rules

* Drop support for node 12 and add support for node 18
  • Loading branch information
bjankord committed Mar 13, 2023
1 parent ae478e3 commit a742dc1
Show file tree
Hide file tree
Showing 7 changed files with 2,667 additions and 468 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12, 14, 16]
node: [14, 16, 18]
os: [ubuntu-latest]

steps:
Expand Down
16 changes: 8 additions & 8 deletions __tests__/unit/qualifying-element.spec.js
Expand Up @@ -31,14 +31,14 @@ test("Qualifying element scss", t => {
.then(checkResult)
.catch(logError)

function checkResult(result) {
t.equal(result.warnings().length, 5, "flags 5 warning")
t.is(result.warnings()[0].text, "Expected \"div#thing\" to have no more than 0 ID selectors (selector-max-id)", "correct warning text")
t.is(result.warnings()[1].text, "Unexpected qualifying type selector (selector-no-qualifying-type)", "correct warning text")
t.is(result.warnings()[2].text, "Unexpected qualifying type selector (selector-no-qualifying-type)", "correct warning text")
t.is(result.warnings()[3].text, "Unexpected qualifying type selector (selector-no-qualifying-type)", "correct warning text")
t.is(result.warnings()[4].text, "Unexpected qualifying type selector (selector-no-qualifying-type)", "correct warning text")
}
function checkResult(result) {
t.equal(result.warnings().length, 5, "flags 5 warning")
t.is(result.warnings()[0].text, "Expected \"div#thing\" to have no more than 0 ID selectors (selector-max-id)", "correct warning text")
t.is(result.warnings()[1].text, "Unexpected qualifying type selector \"div#thing\" (selector-no-qualifying-type)", "correct warning text")
t.is(result.warnings()[2].text, "Unexpected qualifying type selector \"ul.list\" (selector-no-qualifying-type)", "correct warning text")
t.is(result.warnings()[3].text, "Unexpected qualifying type selector \"li.item\" (selector-no-qualifying-type)", "correct warning text")
t.is(result.warnings()[4].text, "Unexpected qualifying type selector \"a[href=\'place\']\" (selector-no-qualifying-type)", "correct warning text")
}
})

function logError(err) {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/unit/shorthand.spec.js
Expand Up @@ -21,7 +21,7 @@ test("Shorthand scss", t => {

function checkResult(result) {
t.equal(result.warnings().length, 1, "flags 1 warning")
t.is(result.warnings()[0].text, "Unexpected longhand value \'1px 1px 1px 1px\' instead of \'1px\' (shorthand-property-no-redundant-values)", "correct warning text")
t.is(result.warnings()[0].text, "Expected \"1px 1px 1px 1px\" to be \"1px\" (shorthand-property-no-redundant-values)", "correct warning text")
}
})

Expand Down
34 changes: 0 additions & 34 deletions __tests__/unit/single-line-per-property.spec.js

This file was deleted.

18 changes: 0 additions & 18 deletions index.js
Expand Up @@ -6,30 +6,18 @@ module.exports = {
"at-rule-no-unknown": null,
"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-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-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": [
1,
Expand All @@ -43,10 +31,6 @@ module.exports = {
}
],
"media-feature-name-no-vendor-prefix": true,
"media-feature-parentheses-space-inside": "never",
"no-missing-end-of-source-newline": true,
"number-leading-zero": "always",
"number-no-trailing-zeros": true,
"order/order": [
[
"custom-properties",
Expand Down Expand Up @@ -97,15 +81,13 @@ module.exports = {
"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
}
}

0 comments on commit a742dc1

Please sign in to comment.