Skip to content

Commit 3c3a558

Browse files
committed
Fix linting rules
1 parent 3de4fca commit 3c3a558

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {remark} from 'remark'
1+
import { remark } from 'remark'
22
import find from './index.js'
33

44
remark()

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ function find (tree, condition) {
1818
if (!tree) throw new Error('unist-find requires a tree to search')
1919
if (!condition) throw new Error('unist-find requires a condition')
2020

21-
var predicate = iteratee(condition)
22-
var result
21+
const predicate = iteratee(condition)
22+
let result
2323

2424
visit(tree, function (node) {
2525
if (predicate(node)) {

test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { remark } from 'remark'
33
import find from './index.js'
44

55
test('unist-find', function (t) {
6-
var tree = remark().parse('Some _emphasis_, **strongness**, and `code`.')
6+
const tree = remark().parse('Some _emphasis_, **strongness**, and `code`.')
77

88
t.throws(function () {
99
find()
@@ -14,23 +14,23 @@ test('unist-find', function (t) {
1414
}, 'should fail without condition')
1515

1616
t.test('should find with string condition', function (st) {
17-
var result = find(tree, 'value')
17+
const result = find(tree, 'value')
1818

1919
st.equal(result, tree.children[0].children[0])
2020

2121
st.end()
2222
})
2323

2424
t.test('should find with object condition', function (st) {
25-
var result = find(tree, { type: 'emphasis' })
25+
const result = find(tree, { type: 'emphasis' })
2626

2727
st.equal(result, tree.children[0].children[1])
2828

2929
st.end()
3030
})
3131

3232
t.test('should find with function condition', function (st) {
33-
var result = find(tree, function (node) {
33+
const result = find(tree, function (node) {
3434
return node.type === 'inlineCode'
3535
})
3636

@@ -40,7 +40,7 @@ test('unist-find', function (t) {
4040
})
4141

4242
t.test('should return undefined if no matches', function (st) {
43-
var result = find(tree, 'nope, nope, nope')
43+
const result = find(tree, 'nope, nope, nope')
4444

4545
st.equal(result, undefined)
4646

0 commit comments

Comments
 (0)