Skip to content

Commit

Permalink
Update xo
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 1, 2021
1 parent 88493cb commit 8f5e24a
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 50 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"unist-builder": "^3.0.0",
"vfile": "^5.0.0",
"vfile-find-down": "^6.0.0",
"xo": "^0.39.0"
"xo": "^0.42.0"
},
"scripts": {
"postinstall": "lerna bootstrap --no-ci",
Expand Down
5 changes: 2 additions & 3 deletions packages/rehype-remove-comments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ import {isConditionalComment} from 'hast-util-is-conditional-comment'
export default function rehypeRemoveComments(options = {}) {
const force = options.removeConditional

return (tree) => {
return (tree) =>
// `undefined` is never returned because we don’t remove nodes (but TS
// doesn’t know it.)
/* c8 ignore next */
return filter(tree, {cascade: false}, force ? hard : soft) || undefined
}
filter(tree, {cascade: false}, force ? hard : soft) || undefined
}

/**
Expand Down
6 changes: 3 additions & 3 deletions script/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
* @property {string} name
*/

import fs from 'fs'
import path from 'path'
import zlib from 'zlib'
import fs from 'node:fs'
import path from 'node:path'
import zlib from 'node:zlib'
import fetch from 'node-fetch'
import {bail} from 'bail'
import {unified} from 'unified'
Expand Down
4 changes: 2 additions & 2 deletions script/build-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* @property {string[]} [plugins]
*/

import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'
import chalk from 'chalk'
import {bail} from 'bail'
import {trough} from 'trough'
Expand Down
6 changes: 3 additions & 3 deletions script/pipeline-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* @typedef {import('type-fest').PackageJson} PackageJson
*/

import fs from 'fs'
import path from 'path'
import {exec} from 'child_process'
import fs from 'node:fs'
import path from 'node:path'
import {exec} from 'node:child_process'
import {toVFile} from 'to-vfile'
import {findDown} from 'vfile-find-down'
import {trough} from 'trough'
Expand Down
4 changes: 2 additions & 2 deletions script/pipeline-presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* @typedef {import('type-fest').PackageJson} PackageJson
*/

import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'
import {toVFile} from 'to-vfile'
import {trough} from 'trough'

Expand Down
6 changes: 3 additions & 3 deletions script/pipeline-readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* @typedef {import('mdast').Root} Root
*/

import fs from 'fs'
import path from 'path'
import {inspect} from 'util'
import fs from 'node:fs'
import path from 'node:path'
import {inspect} from 'node:util'
import {parse} from 'comment-parser'
import remark from 'remark'
import {rehype} from 'rehype'
Expand Down
54 changes: 26 additions & 28 deletions script/pipeline-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @typedef {Element['children'][number]} ElementChild
*/

import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'
import bytes from 'bytes'
import {u} from 'unist-builder'
import {h} from 'hastscript'
Expand Down Expand Up @@ -102,32 +102,30 @@ export const pipelineRoot = trough()
/** @type {import('unified').Plugin<[], Root>} */
function attacher() {
return (tree) => {
zone(tree, name, (start, _, end) => {
return [
start,
{
type: 'list',
spread: false,
ordered: false,
children: list.map((name) => ({
type: 'listItem',
children: [
{
type: 'paragraph',
children: [
{
type: 'link',
url: './packages/' + name,
children: [{type: 'inlineCode', value: name}]
}
]
}
]
}))
},
end
]
})
zone(tree, name, (start, _, end) => [
start,
{
type: 'list',
spread: false,
ordered: false,
children: list.map((name) => ({
type: 'listItem',
children: [
{
type: 'paragraph',
children: [
{
type: 'link',
url: './packages/' + name,
children: [{type: 'inlineCode', value: name}]
}
]
}
]
}))
},
end
])
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'
import test from 'tape'
import {rehype} from 'rehype'
import {isHidden} from 'is-hidden'
Expand Down
6 changes: 3 additions & 3 deletions test/cli.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs'
import path from 'path'
import {exec} from 'child_process'
import fs from 'node:fs'
import path from 'node:path'
import {exec} from 'node:child_process'
import test from 'tape'
import {trimTrailingLines} from 'trim-trailing-lines'

Expand Down

0 comments on commit 8f5e24a

Please sign in to comment.