Skip to content

Commit daf03a0

Browse files
committed
Update dev-dependencies
1 parent 4920393 commit daf03a0

14 files changed

+51
-58
lines changed

.github/workflows/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ jobs:
77
name: '${{matrix.node}} on ${{matrix.os}}'
88
runs-on: ${{matrix.os}}
99
steps:
10-
- uses: actions/checkout@v3
11-
- uses: actions/setup-node@v3
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-node@v4
1212
with:
1313
node-version: ${{matrix.node}}
1414
- run: npm install
1515
- run: npm test
16-
- uses: codecov/codecov-action@v3
16+
- uses: codecov/codecov-action@v4
1717
strategy:
1818
matrix:
1919
os:

lib/file-set-pipeline/log.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {reporter} from 'vfile-reporter'
2929
*/
3030
export async function log(context, settings) {
3131
/** @type {VFileReporter} */
32-
let func = reporter
32+
let value = reporter
3333

3434
if (typeof settings.reporter === 'string') {
3535
try {
@@ -41,17 +41,17 @@ export async function log(context, settings) {
4141
})
4242
)
4343

44-
func = result
44+
value = result
4545
} catch (error) {
4646
throw new Error('Cannot find reporter `' + settings.reporter + '`', {
4747
cause: error
4848
})
4949
}
5050
} else if (settings.reporter) {
51-
func = settings.reporter
51+
value = settings.reporter
5252
}
5353

54-
let diagnostics = await func(
54+
let diagnostics = await value(
5555
context.files.filter(function (file) {
5656
return file.data.unifiedEngineGiven && !file.data.unifiedEngineIgnored
5757
}),

lib/file-set.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ export class FileSet extends EventEmitter {
127127
let duplicate = false
128128

129129
if (completer && completer.pluginId) {
130-
duplicate = this.plugins.some(function (fn) {
131-
return fn.pluginId === completer.pluginId
130+
duplicate = this.plugins.some(function (value) {
131+
return value.pluginId === completer.pluginId
132132
})
133133
}
134134

lib/find-up.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -287,20 +287,20 @@ export class FindUp {
287287
}
288288

289289
/**
290-
* @param {Callback<Value>} cb
290+
* @param {Callback<Value>} value
291291
* Callback.
292292
* @param {Array<Callback<Value>> | Error | Value | undefined} result
293293
* Result.
294294
* @returns {undefined}
295295
* Nothing.
296296
*/
297-
function apply(cb, result) {
297+
function apply(value, result) {
298298
if (Array.isArray(result)) {
299-
result.push(cb)
299+
result.push(value)
300300
} else if (result instanceof Error) {
301-
cb(result)
301+
value(result)
302302
} else {
303-
cb(undefined, result)
303+
value(undefined, result)
304304
}
305305
}
306306
}

lib/finder.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ function search(input, options, next) {
258258
* Nothing.
259259
*/
260260
function each(file) {
261-
const ext = typeof file === 'string' ? path.extname(file) : file.extname
261+
const extname = typeof file === 'string' ? path.extname(file) : file.extname
262262

263263
// Normalise globs.
264264
if (typeof file === 'string') {
@@ -282,13 +282,13 @@ function search(input, options, next) {
282282
*/
283283
function (error, result) {
284284
const ignored = result && result.ignored
285-
const dir = result && result.stats && result.stats.isDirectory()
285+
const folder = result && result.stats && result.stats.isDirectory()
286286

287287
if (ignored && (options.nested || options.silentlyIgnore)) {
288288
return one(undefined, [])
289289
}
290290

291-
if (!ignored && dir) {
291+
if (!ignored && folder) {
292292
fs.readdir(
293293
path.resolve(options.cwd, filePath(file)),
294294
function (error, basenames) {
@@ -319,10 +319,10 @@ function search(input, options, next) {
319319
}
320320

321321
if (
322-
!dir &&
322+
!folder &&
323323
options.nested &&
324324
options.extensions.length > 0 &&
325-
(!ext || !options.extensions.includes(ext))
325+
(!extname || !options.extensions.includes(extname))
326326
) {
327327
return one(undefined, [])
328328
}

lib/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ export function engine(options, callback) {
257257
const result = isUrl(d) ? fileURLToPath(d) : d
258258
return result
259259
})
260-
settings.extensions = (options.extensions || []).map(function (ext) {
261-
return ext.charAt(0) === '.' ? ext : '.' + ext
260+
settings.extensions = (options.extensions || []).map(function (value) {
261+
return value.charAt(0) === '.' ? value : '.' + value
262262
})
263263

264264
settings.filePath = options.filePath

package.json

+6-15
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,20 @@
5353
},
5454
"devDependencies": {
5555
"@types/parse-json": "^4.0.0",
56-
"@types/ungap__structured-clone": "^0.3.0",
57-
"c8": "^8.0.0",
56+
"@types/ungap__structured-clone": "^1.0.0",
57+
"c8": "^9.0.0",
5858
"prettier": "^3.0.0",
5959
"remark": "^15.0.0",
6060
"remark-cli": "^12.0.0",
61-
"remark-gfm": "^4.0.0",
62-
"remark-preset-wooorm": "^9.0.0",
61+
"remark-preset-wooorm": "^10.0.0",
6362
"remark-toc": "^9.0.0",
6463
"strip-ansi": "^7.0.0",
6564
"type-coverage": "^2.0.0",
6665
"typescript": "^5.0.0",
6766
"unified": "^11.0.0",
6867
"vfile-reporter-json": "^4.0.0",
6968
"vfile-reporter-pretty": "^7.0.0",
70-
"xo": "^0.56.0"
69+
"xo": "^0.58.0"
7170
},
7271
"scripts": {
7372
"build": "tsc --build --clean && tsc --build && type-coverage",
@@ -87,16 +86,7 @@
8786
},
8887
"remarkConfig": {
8988
"plugins": [
90-
"remark-preset-wooorm",
91-
[
92-
"remark-preset-wooorm/node_modules/remark-gfm/index.js",
93-
false
94-
],
95-
"remark-gfm",
96-
[
97-
"remark-lint-list-item-indent",
98-
"space"
99-
]
89+
"remark-preset-wooorm"
10090
]
10191
},
10292
"xo": {
@@ -112,6 +102,7 @@
112102
"prettier": true,
113103
"rules": {
114104
"complexity": "off",
105+
"logical-assignment-operators": "off",
115106
"no-await-in-loop": "off",
116107
"no-unused-expressions": "off",
117108
"unicorn/no-this-assignment": "off",

test/completers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ test('completers', async function (t) {
123123
})
124124

125125
const url = new URL('nested/foo.txt', cwd)
126-
const doc = String(await fs.readFile(url))
126+
const document = String(await fs.readFile(url))
127127

128128
await fs.unlink(url)
129129

130130
assert.equal(code, 0)
131-
assert.equal(doc, '')
131+
assert.equal(document, '')
132132
assert.equal(stderr(), 'foo.txt > nested' + sep + 'foo.txt: written\n')
133133
})
134134
})

test/inspect.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ test('inspect', async function (t) {
2626
streamError: stderr.stream
2727
})
2828

29-
const doc = String(await fs.readFile(url))
29+
const document = String(await fs.readFile(url))
3030
await fs.unlink(url)
3131

3232
assert.equal(code, 0)
3333
assert.equal(stderr(), 'one.txt > formatted.txt: written\n')
34-
assert.equal(doc, 'text ""\n')
34+
assert.equal(document, 'text ""\n')
3535
})
3636

3737
await t.test('should support `inspect` for stdin', async function () {

test/output.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ test('output', async function (t) {
147147
})
148148

149149
const url = new URL('one.txt', cwd)
150-
const doc = String(await fs.readFile(url))
150+
const document = String(await fs.readFile(url))
151151
await fs.truncate(url)
152152

153153
assert.equal(code, 0)
154154
assert.equal(stderr(), 'one.txt: written\n')
155-
assert.equal(doc, 'two')
155+
assert.equal(document, 'two')
156156
})
157157

158158
await t.test('should write to a path', async function () {
@@ -261,13 +261,13 @@ test('output', async function (t) {
261261
streamError: stderr.stream
262262
})
263263

264-
const doc = String(await fs.readFile(new URL('one.txt', cwd)))
264+
const document = String(await fs.readFile(new URL('one.txt', cwd)))
265265

266266
await fs.truncate(new URL('one.txt', cwd))
267267

268268
assert.equal(code, 0)
269269
assert.equal(stderr(), 'one.txt: written\n')
270-
assert.equal(doc, 'two')
270+
assert.equal(document, 'two')
271271
})
272272

273273
await t.test('should not write without file-path', async function () {
@@ -291,7 +291,7 @@ test('output', async function (t) {
291291
streamError: stderr.stream
292292
})
293293

294-
const doc = String(await fs.readFile(new URL('one.txt', cwd)))
294+
const document = String(await fs.readFile(new URL('one.txt', cwd)))
295295

296296
assert.equal(code, 1)
297297
assert.equal(
@@ -303,7 +303,7 @@ test('output', async function (t) {
303303
' Error: Cannot write file without an output path'
304304
].join('\n')
305305
)
306-
assert.equal(doc, '')
306+
assert.equal(document, '')
307307
})
308308

309309
await t.test('should fail when writing files to one path', async function () {

test/tree.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ test('tree', async function (t) {
5757
tree: true
5858
})
5959

60-
const doc = String(await fs.readFile(new URL('doc.json', cwd)))
60+
const document = String(await fs.readFile(new URL('doc.json', cwd)))
6161

6262
await fs.unlink(new URL('doc.json', cwd))
6363

6464
assert.equal(code, 0)
6565
assert.equal(stderr(), 'doc > doc.json: written\n')
66-
assert.equal(doc, '{\n "type": "text",\n "value": "two"\n}\n')
66+
assert.equal(document, '{\n "type": "text",\n "value": "two"\n}\n')
6767
}
6868
)
6969

@@ -88,13 +88,13 @@ test('tree', async function (t) {
8888
treeIn: true
8989
})
9090

91-
const doc = String(await fs.readFile(new URL('doc.foo', cwd)))
91+
const document = String(await fs.readFile(new URL('doc.foo', cwd)))
9292

9393
await fs.unlink(new URL('doc.foo', cwd))
9494

9595
assert.equal(code, 0)
9696
assert.equal(stderr(), 'doc > doc.foo: written\n')
97-
assert.equal(doc, 'two')
97+
assert.equal(document, 'two')
9898
})
9999

100100
await t.test('should write JSON when `treeOut` is given', async function () {
@@ -118,13 +118,13 @@ test('tree', async function (t) {
118118
treeOut: true
119119
})
120120

121-
const doc = String(await fs.readFile(new URL('one.json', cwd)))
121+
const document = String(await fs.readFile(new URL('one.json', cwd)))
122122

123123
await fs.unlink(new URL('one.json', cwd))
124124

125125
assert.equal(code, 0)
126126
assert.equal(stderr(), 'one.txt > one.json: written\n')
127-
assert.equal(doc, '{\n "type": "text",\n "value": "two"\n}\n')
127+
assert.equal(document, '{\n "type": "text",\n "value": "two"\n}\n')
128128
})
129129

130130
await t.test('should support `treeOut` for stdin', async function () {

test/util/noop-processor.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ function parse() {
1818
self.parser = parser
1919

2020
/**
21-
* @param {string} doc
21+
* @param {string} document
2222
* @returns {Literal}
2323
*/
24-
function parser(doc) {
25-
return {type: 'text', value: doc}
24+
function parser(document) {
25+
return {type: 'text', value: document}
2626
}
2727
}
2828

test/util/spy.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ export function spy() {
1717
*/
1818
// @ts-expect-error: TS can’t apply overloads I think?.
1919
stream.write = function (chunk, encoding, callback) {
20-
const cb = typeof encoding === 'function' ? encoding : callback
20+
const value = typeof encoding === 'function' ? encoding : callback
2121

22-
if (typeof cb === 'function') {
23-
setImmediate(cb, undefined)
22+
if (typeof value === 'function') {
23+
setImmediate(value, undefined)
2424
}
2525

2626
output.push(chunk)

tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"exactOptionalPropertyTypes": true,
99
"lib": ["es2022"],
1010
"module": "node16",
11+
// To do: remove when `type-fest` is fixed (has too deep types currently).
12+
"skipLibCheck": true,
1113
"strict": true,
1214
"target": "es2022"
1315
},

0 commit comments

Comments
 (0)