Skip to content

Commit b592826

Browse files
committed
Update dev-dependencies
1 parent b57766e commit b592826

File tree

7 files changed

+109
-108
lines changed

7 files changed

+109
-108
lines changed

lib/any.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function ruleSet(query, node, state) {
3939

4040
function rule(query, tree, state) {
4141
var collect = collector(state.one)
42-
var opts = {
42+
var options = {
4343
scopeNodes: tree.type === 'root' ? tree.children : [tree],
4444
iterator: match,
4545
one: state.one,
@@ -50,7 +50,7 @@ function rule(query, tree, state) {
5050
throw new Error('Expected selector without nesting')
5151
}
5252

53-
nest(query, tree, 0, null, configure(query, opts))
53+
nest(query, tree, 0, null, configure(query, options))
5454

5555
return collect.result
5656

lib/nest.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ function topScan(query, node, index, parent, state) {
4040
}
4141

4242
function descendant(query, node, index, parent, state) {
43-
var prev = state.iterator
43+
var previous = state.iterator
4444

4545
state.iterator = iterator
4646

4747
child.apply(this, arguments)
4848

4949
function iterator() {
50-
state.iterator = prev
51-
prev.apply(this, arguments)
50+
state.iterator = previous
51+
previous.apply(this, arguments)
5252
state.iterator = iterator
5353

5454
if (state.one && state.found) {
@@ -64,9 +64,7 @@ function child(query, node, index, parent, state) {
6464
return
6565
}
6666

67-
walkIterator(query, node, state)
68-
.each()
69-
.done()
67+
walkIterator(query, node, state).each().done()
7068
}
7169

7270
function adjacentSibling(query, node, index, parent, state) {

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@
5454
"devDependencies": {
5555
"dtslint": "^3.0.0",
5656
"nyc": "^15.0.0",
57-
"prettier": "^1.0.0",
58-
"remark-cli": "^7.0.0",
59-
"remark-preset-wooorm": "^6.0.0",
57+
"prettier": "^2.0.0",
58+
"remark-cli": "^8.0.0",
59+
"remark-preset-wooorm": "^7.0.0",
6060
"tape": "^4.0.0",
6161
"unist-builder": "^2.0.0",
62-
"xo": "^0.26.0"
62+
"xo": "^0.29.0"
6363
},
6464
"scripts": {
65-
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
65+
"format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix",
6666
"test-api": "node test",
6767
"test-coverage": "nyc --reporter lcov tape test/index.js",
6868
"test-types": "dtslint types",
@@ -85,6 +85,9 @@
8585
"xo": {
8686
"prettier": true,
8787
"esnext": false,
88+
"ignore": [
89+
"types"
90+
],
8891
"rules": {
8992
"max-params": "off",
9093
"unicorn/prefer-reflect-apply": "off",

test/all.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var test = require('tape')
44
var u = require('unist-builder')
55
var selectAll = require('..').selectAll
66

7-
test('all together now', function(t) {
7+
test('all together now', function (t) {
88
t.deepEqual(
99
selectAll(
1010
'a > b[d]:nth-of-type(odd)',

test/matches.js

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,74 +4,74 @@ var test = require('tape')
44
var u = require('unist-builder')
55
var matches = require('..').matches
66

7-
test('select.matches()', function(t) {
8-
t.test('invalid selector', function(st) {
7+
test('select.matches()', function (t) {
8+
t.test('invalid selector', function (st) {
99
st.throws(
10-
function() {
10+
function () {
1111
matches()
1212
},
1313
/Error: Expected `string` as selector, not `undefined`/,
1414
'should throw without selector'
1515
)
1616

1717
st.throws(
18-
function() {
18+
function () {
1919
matches([], u('root', []))
2020
},
2121
/Error: Expected `string` as selector, not ``/,
2222
'should throw w/ invalid selector (1)'
2323
)
2424

2525
st.throws(
26-
function() {
26+
function () {
2727
matches('@supports (transform-origin: 5% 5%) {}', u('root', []))
2828
},
2929
/Error: Rule expected but "@" found./,
3030
'should throw w/ invalid selector (2)'
3131
)
3232

3333
st.throws(
34-
function() {
34+
function () {
3535
matches('[foo%=bar]', u('root', []))
3636
},
3737
/Error: Expected "=" but "%" found./,
3838
'should throw on invalid attribute operators'
3939
)
4040

4141
st.throws(
42-
function() {
42+
function () {
4343
matches(':active', u('root', []))
4444
},
4545
/Error: Unknown pseudo-selector `active`/,
4646
'should throw on invalid pseudo classes'
4747
)
4848

4949
st.throws(
50-
function() {
50+
function () {
5151
matches(':nth-foo(2n+1)', u('root', []))
5252
},
5353
/Error: Unknown pseudo-selector `nth-foo`/,
5454
'should throw on invalid pseudo class “functions”'
5555
)
5656

5757
st.throws(
58-
function() {
58+
function () {
5959
matches('::before', u('root', []))
6060
},
6161
/Error: Unexpected pseudo-element or empty pseudo-class/,
6262
'should throw on invalid pseudo elements'
6363
)
6464

6565
st.throws(
66-
function() {
66+
function () {
6767
matches('foo bar', u('root', []))
6868
},
6969
/Error: Expected selector without nesting/,
7070
'should throw on nested selectors (descendant)'
7171
)
7272

7373
st.throws(
74-
function() {
74+
function () {
7575
matches('foo > bar', u('root', []))
7676
},
7777
/Error: Expected selector without nesting/,
@@ -81,7 +81,7 @@ test('select.matches()', function(t) {
8181
st.end()
8282
})
8383

84-
t.test('parent-sensitive pseudo-selectors', function(st) {
84+
t.test('parent-sensitive pseudo-selectors', function (st) {
8585
var simplePseudos = [
8686
'first-child',
8787
'first-of-type',
@@ -98,19 +98,19 @@ test('select.matches()', function(t) {
9898
'nth-last-of-type'
9999
]
100100

101-
simplePseudos.forEach(function(pseudo) {
101+
simplePseudos.forEach(function (pseudo) {
102102
st.throws(
103-
function() {
103+
function () {
104104
matches(':' + pseudo, u('root', []))
105105
},
106106
new RegExp('Error: Cannot use `:' + pseudo + '` without parent'),
107107
'should throw on `' + pseudo + '`'
108108
)
109109
})
110110

111-
functionalPseudos.forEach(function(pseudo) {
111+
functionalPseudos.forEach(function (pseudo) {
112112
st.throws(
113-
function() {
113+
function () {
114114
matches(':' + pseudo + '()', u('root', []))
115115
},
116116
new RegExp('Error: Cannot use `:' + pseudo + '` without parent'),
@@ -121,7 +121,7 @@ test('select.matches()', function(t) {
121121
st.end()
122122
})
123123

124-
t.test('general', function(st) {
124+
t.test('general', function (st) {
125125
st.notOk(
126126
matches('', u('root', [])),
127127
'false for the empty string as selector'
@@ -136,24 +136,24 @@ test('select.matches()', function(t) {
136136
st.end()
137137
})
138138

139-
t.test('multiple selectors', function(st) {
139+
t.test('multiple selectors', function (st) {
140140
st.ok(matches('a, b', u('a')), 'true')
141141
st.notOk(matches('b, c', u('a')), 'false')
142142

143143
st.end()
144144
})
145145

146-
t.test('tag-names: `div`, `*`', function(st) {
146+
t.test('tag-names: `div`, `*`', function (st) {
147147
st.ok(matches('*', u('a')), 'true for `*`')
148148
st.ok(matches('b', u('b')), 'true if types matches')
149149
st.notOk(matches('b', u('a')), 'false if types don’t matches')
150150

151151
st.end()
152152
})
153153

154-
t.test('id: `#id`', function(st) {
154+
t.test('id: `#id`', function (st) {
155155
st.throws(
156-
function() {
156+
function () {
157157
matches('#one', u('a'))
158158
},
159159
/Error: Invalid selector: id/,
@@ -163,9 +163,9 @@ test('select.matches()', function(t) {
163163
st.end()
164164
})
165165

166-
t.test('class: `.class`', function(st) {
166+
t.test('class: `.class`', function (st) {
167167
st.throws(
168-
function() {
168+
function () {
169169
matches('.one', u('a'))
170170
},
171171
/Error: Invalid selector: class/,
@@ -175,7 +175,7 @@ test('select.matches()', function(t) {
175175
st.end()
176176
})
177177

178-
t.test('attributes, existence: `[attr]`', function(st) {
178+
t.test('attributes, existence: `[attr]`', function (st) {
179179
st.ok(
180180
matches('[foo]', u('a', {foo: 'alpha'})),
181181
'true if attribute exists (string)'
@@ -208,7 +208,7 @@ test('select.matches()', function(t) {
208208
st.end()
209209
})
210210

211-
t.test('attributes, equality: `[attr=value]`', function(st) {
211+
t.test('attributes, equality: `[attr=value]`', function (st) {
212212
st.ok(
213213
matches('[foo=alpha]', u('a', {foo: 'alpha'})),
214214
'true if attribute matches (string)'
@@ -270,7 +270,7 @@ test('select.matches()', function(t) {
270270
st.end()
271271
})
272272

273-
t.test('attributes, begins: `[attr^=value]`', function(st) {
273+
t.test('attributes, begins: `[attr^=value]`', function (st) {
274274
st.ok(
275275
matches('[foo^=al]', u('a', {foo: 'alpha'})),
276276
'true if attribute matches (string)'
@@ -300,7 +300,7 @@ test('select.matches()', function(t) {
300300
st.end()
301301
})
302302

303-
t.test('attributes, ends: `[attr$=value]`', function(st) {
303+
t.test('attributes, ends: `[attr$=value]`', function (st) {
304304
st.ok(
305305
matches('[foo$=ha]', u('a', {foo: 'alpha'})),
306306
'true if attribute matches (string)'
@@ -330,7 +330,7 @@ test('select.matches()', function(t) {
330330
st.end()
331331
})
332332

333-
t.test('attributes, contains: `[attr*=value]`', function(st) {
333+
t.test('attributes, contains: `[attr*=value]`', function (st) {
334334
st.ok(
335335
matches('[foo*=ph]', u('a', {foo: 'alpha'})),
336336
'true if attribute matches (string)'
@@ -359,7 +359,7 @@ test('select.matches()', function(t) {
359359
st.end()
360360
})
361361

362-
t.test('attributes, contains in a list: `[attr~=value]`', function(st) {
362+
t.test('attributes, contains in a list: `[attr~=value]`', function (st) {
363363
st.ok(
364364
matches('[foo~=alpha]', u('a', {foo: 'alpha'})),
365365
'true if attribute matches (string)'
@@ -437,9 +437,9 @@ test('select.matches()', function(t) {
437437
st.end()
438438
})
439439

440-
t.test('pseudo-classes', function(st) {
441-
;[':any', ':matches'].forEach(function(pseudo) {
442-
st.test(pseudo, function(sst) {
440+
t.test('pseudo-classes', function (st) {
441+
;[':any', ':matches'].forEach(function (pseudo) {
442+
st.test(pseudo, function (sst) {
443443
sst.ok(
444444
matches(pseudo + '(a, [b])', u('a')),
445445
'true if any matches (type)'
@@ -461,7 +461,7 @@ test('select.matches()', function(t) {
461461
})
462462
})
463463

464-
st.test(':not()', function(sst) {
464+
st.test(':not()', function (sst) {
465465
sst.notOk(matches(':not(a, [b])', u('a')), 'false if any matches (type)')
466466
sst.notOk(
467467
matches(':not(a, [b])', u('c', {b: 1})),
@@ -476,12 +476,12 @@ test('select.matches()', function(t) {
476476
sst.end()
477477
})
478478

479-
st.test(':has', function(sst) {
480-
sst.doesNotThrow(function() {
479+
st.test(':has', function (sst) {
480+
sst.doesNotThrow(function () {
481481
matches('a:not(:has())', u('b'))
482482
}, 'should not throw on empty selectors')
483483

484-
sst.doesNotThrow(function() {
484+
sst.doesNotThrow(function () {
485485
matches('a:has()', u('b'))
486486
}, 'should not throw on empty selectors')
487487

@@ -583,8 +583,8 @@ test('select.matches()', function(t) {
583583

584584
sst.end()
585585
})
586-
;[':empty', ':blank'].forEach(function(pseudo) {
587-
st.test(pseudo, function(sst) {
586+
;[':empty', ':blank'].forEach(function (pseudo) {
587+
st.test(pseudo, function (sst) {
588588
sst.ok(matches(pseudo, u('a')), 'true for void node')
589589
sst.ok(matches(pseudo, u('a', [])), 'true for parent without children')
590590
sst.notOk(matches(pseudo, u('a', '')), 'false for falsey literal')
@@ -595,12 +595,12 @@ test('select.matches()', function(t) {
595595
})
596596
})
597597

598-
st.test(':root', function(sst) {
598+
st.test(':root', function (sst) {
599599
sst.ok(matches(':root', u('a')), 'true')
600600
sst.end()
601601
})
602602

603-
st.test(':scope', function(sst) {
603+
st.test(':scope', function (sst) {
604604
sst.ok(matches(':scope', u('a')), 'true')
605605
sst.end()
606606
})

0 commit comments

Comments
 (0)