Skip to content

Commit

Permalink
Update linting
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalduez committed Feb 6, 2017
1 parent 329ccfe commit 30e2c62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import postcss, { list } from 'postcss';
import balanced from 'balanced-match';

export default postcss.plugin('postcss-quantity-queries', () => css => {
css.walk(node => {
export default postcss.plugin('postcss-quantity-queries', () => (css) => {
css.walk((node) => {
if (node.type === 'rule') {
return processRule(node);
}
Expand All @@ -21,7 +21,7 @@ function processRule(rule) {
if (!rePseudo.test(rule.selector)) return;

rule.selectors =
rule.selectors.map(s => {
rule.selectors.map((s) => {
const { pre, body } = balanced('(', ')', s);
const args = list.comma(body);
const [selector, quantifier] = pre.split(/:{1,2}/);
Expand Down Expand Up @@ -56,11 +56,11 @@ function processAtRule(atRule) {
}

const cleanIndent = rule =>
rule.walkDecls(decl => {
rule.walkDecls((decl) => {
decl.raws.before = decl.raws.before.replace(/[^\S\x0a\x0d]{2,}/, ' ');
});

const quantitySelectors = (quantifier, last) => (selectors) =>
const quantitySelectors = (quantifier, last) => selectors =>
selectors.map(s =>
`${s}${quantifier}, ${s}${quantifier} ~ ${last || list.space(s).pop()}`);

Expand Down
4 changes: 2 additions & 2 deletions test/control.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ const input = read('control/input.css');
test('control: no options', () =>
postcss([plugin])
.process(input)
.then(result => {
.then((result) => {
expect(result.css).to.equal(expected);
}));

test('control: with options', () =>
postcss([plugin({})])
.process(input)
.then(result => {
.then((result) => {
expect(result.css).to.equal(expected);
}));

Expand Down

0 comments on commit 30e2c62

Please sign in to comment.