Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Apr 7, 2024
1 parent 802f78f commit 7e676ed
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@
"to-vfile": "^8.0.0",
"type-coverage": "^2.0.0",
"type-fest": "^4.0.0",
"typescript": "^5.4.0-beta",
"typescript": "^5.4.0",
"unified": "^11.0.0",
"unist-builder": "^4.0.0",
"unist-util-remove-position": "^5.0.0",
"vfile": "^6.0.0",
"vfile-find-down": "^7.0.0",
"vfile-reporter": "^8.0.0",
"vfile-sort": "^4.0.0",
"xo": "^0.56.0"
"xo": "^0.58.0"
},
"scripts": {
"generate": "node --conditions development script/build-packages.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"mdast-util-phrasing": "^4.0.0",
"unified-lint-rule": "^2.0.0",
"unist-util-visit-parents": "^6.0.0",
"vfile-message": "4.0.0"
"vfile-message": "^4.0.0"
},
"scripts": {},
"typeCoverage": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"xo": {
"prettier": true,
"rules": {
"capitalized-comments": "off"
"capitalized-comments": "off",
"logical-assignment-operators": "off"
}
}
}
21 changes: 12 additions & 9 deletions script/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ async function addPlugin(name) {
*/
async function addPreset(name) {
/** @type {{default: Preset}} */
const mod = await import(new URL(name + '/index.js', packagesUrl).href)
const plugins = mod.default.plugins
const presetModule = await import(
new URL(name + '/index.js', packagesUrl).href
)
const plugins = presetModule.default.plugins
assert(plugins, 'expected plugins in preset')
/** @type {PresetInfo} */
const presetInfo = {name, plugins: []}
Expand All @@ -277,21 +279,22 @@ async function addPreset(name) {
while (++index < plugins.length) {
const plugin = plugins[index]
/** @type {import('unified').Plugin<[unknown]>} */
let fn
let pluginFunction
/** @type {unknown} */
let option

if (Array.isArray(plugin)) {
;[fn, option] = /** @type {import('unified').PluginTuple<[unknown]>} */ (
plugin
)
;[pluginFunction, option] =
/** @type {import('unified').PluginTuple<[unknown]>} */ (plugin)
} else {
assert(typeof plugin === 'function')
fn = plugin
pluginFunction = plugin
}

// @ts-expect-error: `displayName`s are fine.
const name = /** @type {string} */ (fn.displayName || fn.name)
const name = /** @type {string} */ (
// @ts-expect-error: `displayName`s are fine.
pluginFunction.displayName || pluginFunction.name
)

const pluginName = name
.replace(
Expand Down
6 changes: 3 additions & 3 deletions script/pipeline-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ async function generateReadme(state) {

const description = stripIndent(fileInfo.description || '').trim()

const explicitDocs = fromMarkdown(description, {
const explicitDescription = fromMarkdown(description, {
extensions: [gfm()],
mdastExtensions: [gfmFromMarkdown()]
})
Expand All @@ -341,9 +341,9 @@ async function generateReadme(state) {
let category = 'intro'
let contentIndex = -1

while (++contentIndex < explicitDocs.children.length) {
while (++contentIndex < explicitDescription.children.length) {
const node = /** @type {TopLevelContent} */ (
explicitDocs.children[contentIndex]
explicitDescription.children[contentIndex]
)

if (node.type === 'heading' && node.depth === 2) {
Expand Down
10 changes: 5 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test('remark-lint', async function (t) {
])
})

const doc = [
const value = [
'# A heading',
'',
'# Another main heading.',
Expand All @@ -47,7 +47,7 @@ test('remark-lint', async function (t) {
.use(remarkLintNoHeadingPunctuation)
.use(remarkLintNoMultipleToplevelHeadings)
.use(remarkLint)
.process({path: 'virtual.md', value: doc})
.process({path: 'virtual.md', value})

assert.deepEqual(file.messages.map(String), [
'virtual.md:3:1-3:24: Unexpected character `.` at end of heading, remove it',
Expand All @@ -60,7 +60,7 @@ test('remark-lint', async function (t) {
.use(remarkLint)
.use(remarkLintNoHeadingPunctuation)
.use(remarkLintNoMultipleToplevelHeadings)
.process({path: 'virtual.md', value: doc})
.process({path: 'virtual.md', value})

assert.deepEqual(file.messages.map(String), [
'virtual.md:3:1-3:24: Unexpected character `.` at end of heading, remove it',
Expand Down Expand Up @@ -307,8 +307,8 @@ test('plugins', async function (t) {
// type-coverage:ignore-next-line -- `TestContext` not exposed from `node:test`.
async function assertPlugin(info, t) {
/** @type {{default: Plugin}} */
const pluginMod = await import(info.name)
const plugin = pluginMod.default
const pluginModule = await import(info.name)
const plugin = pluginModule.default

for (const check of info.checks) {
const name = check.name + ':' + check.configuration
Expand Down

0 comments on commit 7e676ed

Please sign in to comment.