1
1
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:
nguyenmanh1507 2017-05-26 22:14:21 +07:00
parent cfac2c6c5d
commit 0fe553ed76
3 changed files with 9 additions and 5 deletions

View File

@ -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",

View File

@ -33,7 +33,8 @@
"ava": "*",
"eslint": "*",
"eslint-plugin-github": "*",
"stylelint": "*"
"stylelint": "*",
"stylelint-order": "^0.4.4"
},
"peerDependencies": {
"stylelint": "^7.7.1"

View File

@ -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")
})
})