Skip to content

Commit ead405c

Browse files
committed
Update dev-dependencies
1 parent 2d3d569 commit ead405c

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
coverage/
2+
*.json
3+
*.md

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ var convert = require('unist-util-is/convert')
55

66
module.exports = filter
77

8-
function filter(tree, opts, test) {
8+
function filter(tree, options, test) {
99
var is
1010
var cascade
1111

1212
if (!test) {
13-
test = opts
14-
opts = {}
13+
test = options
14+
options = {}
1515
}
1616

17-
cascade = opts.cascade
17+
cascade = options.cascade
1818
cascade = cascade === null || cascade === undefined ? true : cascade
1919
is = convert(test)
2020

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
"@types/mdast": "^3.0.0",
3838
"dtslint": "^3.0.0",
3939
"nyc": "^15.0.0",
40-
"prettier": "^1.0.0",
41-
"remark-cli": "^7.0.0",
42-
"remark-preset-wooorm": "^6.0.0",
43-
"tape": "^4.0.0",
40+
"prettier": "^2.0.0",
41+
"remark-cli": "^8.0.0",
42+
"remark-preset-wooorm": "^7.0.0",
43+
"tape": "^5.0.0",
4444
"unist-builder": "^2.0.0",
45-
"xo": "^0.26.0"
45+
"xo": "^0.32.0"
4646
},
4747
"scripts": {
48-
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
48+
"format": "remark . -qfo && prettier . --write && xo --fix",
4949
"test-api": "node test",
5050
"test-coverage": "nyc --reporter lcov tape test.js",
5151
"test-types": "dtslint types",
@@ -68,6 +68,10 @@
6868
"xo": {
6969
"prettier": true,
7070
"esnext": false,
71+
"rules": {
72+
"unicorn/no-fn-reference-in-iterator": "off",
73+
"unicorn/no-reduce": "off"
74+
},
7175
"ignores": [
7276
"unist-util-position.js"
7377
]

test.js

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

7-
test('should not traverse into children of filtered out nodes', function(t) {
7+
test('should not traverse into children of filtered out nodes', function (t) {
88
var tree = u('root', [u('node', [u('leaf', '1')]), u('leaf', '2')])
99
var types = {}
1010

@@ -19,7 +19,7 @@ test('should not traverse into children of filtered out nodes', function(t) {
1919
}
2020
})
2121

22-
test('should return `null` if root node is filtered out', function(t) {
22+
test('should return `null` if root node is filtered out', function (t) {
2323
var tree = u('root', [u('node', [u('leaf', '1')]), u('leaf', '2')])
2424

2525
t.deepEqual(filter(tree, predicate), null)
@@ -31,7 +31,7 @@ test('should return `null` if root node is filtered out', function(t) {
3131
}
3232
})
3333

34-
test('should cascade-remove parent nodes', function(t) {
34+
test('should cascade-remove parent nodes', function (t) {
3535
var tree = u('root', [u('node', [u('leaf', '1')]), u('leaf', '2')])
3636

3737
t.deepEqual(filter(tree, notOne), u('root', [u('leaf', '2')]))
@@ -48,15 +48,15 @@ test('should cascade-remove parent nodes', function(t) {
4848
}
4949
})
5050

51-
test('should not cascade-remove nodes that were empty initially', function(t) {
51+
test('should not cascade-remove nodes that were empty initially', function (t) {
5252
var tree = u('node', [u('node', []), u('node', [u('leaf')])])
5353

5454
t.deepEqual(filter(tree, 'node'), u('node', [u('node', [])]))
5555

5656
t.end()
5757
})
5858

59-
test('should call iterator with `index` and `parent` args', function(t) {
59+
test('should call iterator with `index` and `parent` args', function (t) {
6060
var tree = u('root', [u('node', [u('leaf', '1')]), u('leaf', '2')])
6161
var callLog = []
6262

@@ -77,7 +77,7 @@ test('should call iterator with `index` and `parent` args', function(t) {
7777
}
7878
})
7979

80-
test('should support type and node tests', function(t) {
80+
test('should support type and node tests', function (t) {
8181
var tree = u('node', [u('node', [u('leaf', '1')]), u('leaf', '2')])
8282

8383
t.deepEqual(filter(tree, 'node'), null)
@@ -90,7 +90,7 @@ test('should support type and node tests', function(t) {
9090
t.end()
9191
})
9292

93-
test('opts.cascade', function(t) {
93+
test('opts.cascade', function (t) {
9494
var tree = u('root', [u('node', [u('leaf', '1')]), u('leaf', '2')])
9595

9696
t.deepEqual(
@@ -112,7 +112,7 @@ test('opts.cascade', function(t) {
112112
}
113113
})
114114

115-
test('example from README', function(t) {
115+
test('example from README', function (t) {
116116
var tree = u('root', [
117117
u('leaf', '1'),
118118
u('node', [u('leaf', '2'), u('node', [u('leaf', '3')])]),

0 commit comments

Comments
 (0)