Skip to content

Commit

Permalink
Update stylelint and stylelint-config-xo
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 1, 2019
1 parent ee4b6b7 commit 2f49bf9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Stylelint shareable config for XO with 2-space indent",
"license": "MIT",
"repository": "xojs/stylelint-config-xo-space",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
Expand Down Expand Up @@ -45,14 +46,14 @@
"simple"
],
"dependencies": {
"stylelint-config-xo": "^0.15.0"
"stylelint-config-xo": "^0.16.0"
},
"devDependencies": {
"ava": "^1.4.1",
"stylelint": "^10.0.1",
"xo": "^0.24.0"
"ava": "^2.4.0",
"stylelint": "^12.0.0",
"xo": "^0.25.3"
},
"peerDependencies": {
"stylelint": ">=10"
"stylelint": ">=12"
}
}
14 changes: 9 additions & 5 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import test from 'ava';
import stylelint from 'stylelint';
import config from '..';

const hasRule = (errors, ruleId) => errors.some(x => x.rule === ruleId);

const runStylelint = async code => {
const data = await stylelint.lint({
code,
Expand All @@ -12,10 +14,12 @@ const runStylelint = async code => {
};

test('main', async t => {
const results = await runStylelint(`div {
left: .2em;
}
`);
const results = await runStylelint(
`div {
left: .2em;
}
`
);

t.is(results[0].warnings[0].rule, 'number-leading-zero');
t.true(hasRule(results[0].warnings, 'number-leading-zero'));
});

0 comments on commit 2f49bf9

Please sign in to comment.