mirror of
https://github.com/primer/css.git
synced 2024-12-20 12:42:07 +03:00
replace declaration-block-properties-order rules (deprecated) by stylelint-order plugin
This commit is contained in:
parent
cfac2c6c5d
commit
0fe553ed76
5
index.js
5
index.js
@ -1,7 +1,8 @@
|
||||
module.exports = {
|
||||
"plugins": [
|
||||
"stylelint-scss",
|
||||
"stylelint-selector-no-utility"
|
||||
"stylelint-selector-no-utility",
|
||||
"stylelint-order"
|
||||
],
|
||||
"rules": {
|
||||
"at-rule-blacklist": ["extend"],
|
||||
@ -42,7 +43,7 @@ module.exports = {
|
||||
}
|
||||
],
|
||||
"declaration-block-no-shorthand-property-overrides": true,
|
||||
"declaration-block-properties-order": [
|
||||
"order/properties-order": [
|
||||
"position",
|
||||
"top",
|
||||
"right",
|
||||
|
@ -33,7 +33,8 @@
|
||||
"ava": "*",
|
||||
"eslint": "*",
|
||||
"eslint-plugin-github": "*",
|
||||
"stylelint": "*"
|
||||
"stylelint": "*",
|
||||
"stylelint-order": "^0.4.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"stylelint": "^7.7.1"
|
||||
|
@ -10,6 +10,7 @@ const validCss =
|
||||
|
||||
const invalidCss =
|
||||
`.foo {
|
||||
color: #fff;
|
||||
top: .2em;
|
||||
}
|
||||
`
|
||||
@ -47,7 +48,8 @@ test("a warning with invalid css", t => {
|
||||
const { errored, results } = data
|
||||
const { warnings } = results[0]
|
||||
t.truthy(errored, "errored")
|
||||
t.is(warnings.length, 1, "flags one warning")
|
||||
t.is(warnings[0].text, "Expected a leading zero (number-leading-zero)", "correct warning text")
|
||||
t.is(warnings.length, 2, "flags two warning")
|
||||
t.is(warnings[0].text, 'Expected "top" to come before "color" (order/properties-order)', "correct warning text")
|
||||
t.is(warnings[1].text, "Expected a leading zero (number-leading-zero)", "correct warning text")
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user