Update dev-dependencies

This commit is contained in:
Titus Wormer 2023-05-16 10:17:11 +02:00
parent 9417b4f329
commit 4a45edff6e
No known key found for this signature in database
GPG Key ID: E6E581152ED04E2E
12 changed files with 27 additions and 13 deletions

View File

@ -116,6 +116,7 @@
"@types/tape": "^4.0.0",
"c8": "^7.0.0",
"comment-parser": "^1.0.0",
"github-slugger": "^2.0.0",
"mdast-zone": "^5.0.0",
"parse-author": "^2.0.0",
"prettier": "^2.0.0",
@ -135,7 +136,7 @@
"typescript": "^4.0.0",
"unist-builder": "^3.0.0",
"unist-util-remove-position": "^4.0.0",
"xo": "^0.52.0"
"xo": "^0.54.0"
},
"scripts": {
"build-packages": "node script/build-presets && node script/build-rules",

View File

@ -110,6 +110,7 @@ const remarkLintCheckboxContentIndent = lintRule(
while (/[\t ]/.test(value.charAt(final))) final++
if (final - initial > 0) {
// @ts-expect-error: assume we have a correct point.
file.message('Checkboxes should be followed by a single character', {
start: loc.toPoint(initial),
end: loc.toPoint(final)

View File

@ -103,6 +103,7 @@ const remarkLintLinebreakStyle = lintRule(
' (`' +
escaped[type] +
'`)',
// @ts-expect-error: assume we have a correct point.
toPoint(index)
)
}

View File

@ -211,6 +211,7 @@ const remarkLintLinkTitleStyle = lintRule(
'Titles should use `' +
(look === ')' ? '()' : look) +
'` as a quote',
// @ts-expect-error: assume we have a correct point.
{
start: loc.toPoint(first),
end: loc.toPoint(last + 1)

View File

@ -150,6 +150,7 @@ const remarkLintNoParagraphContentIndent = lintRule(
if (lineColumn !== offset) {
file.message(
'Expected no indentation in paragraph content',
// @ts-expect-error: assume we have a correct point.
loc.toPoint(offset)
)
}

View File

@ -135,6 +135,7 @@ const remarkLintNoTableIndentation = lintRule(
}
if (lineColumn !== offset) {
// @ts-expect-error: assume we have a correct point.
file.message('Do not indent table rows', loc.toPoint(offset))
}
}

View File

@ -110,6 +110,7 @@ const remarkLintNoTabs = lintRule(
let index = value.indexOf('\t')
while (index !== -1) {
// @ts-expect-error: assume we have a correct point.
file.message('Use spaces instead of tabs', toPoint(index))
index = value.indexOf('\t', index + 1)
}

View File

@ -348,6 +348,7 @@ const remarkLintNoUndefinedReferences = lintRule(
!(normalizeIdentifier(id) in map) &&
!isAllowed(id)
) {
// @ts-expect-error: assume we have a correct point.
file.message('Found reference to undefined definition', pos)
}
}

View File

@ -84,17 +84,23 @@ function coerce(name, config) {
switch (severity) {
case false:
case 'off':
case 0:
case 0: {
return [0, ...options]
}
case true:
case 'on':
case 'warn':
case 1:
case 1: {
return [1, ...options]
}
case 'error':
case 2:
case 2: {
return [2, ...options]
default:
}
default: {
if (typeof severity !== 'number') return [1, config]
throw new Error(
'Incorrect severity `' +
@ -104,5 +110,6 @@ function coerce(name, config) {
'`, ' +
'expected 0, 1, or 2'
)
}
}
}

View File

@ -25,6 +25,7 @@ const own = {}.hasOwnProperty
const root = path.join(process.cwd(), 'packages')
// eslint-disable-next-line unicorn/prefer-top-level-await
presets(root).then((presetObjects) => {
let index = -1

View File

@ -14,7 +14,7 @@ import remarkParse from 'remark-parse'
import remarkGfm from 'remark-gfm'
import {findAndReplace} from 'mdast-util-find-and-replace'
import {toString} from 'mdast-util-to-string'
import GitHubSlugger from 'github-slugger'
import {slug as githubSlug} from 'github-slugger'
import parseAuthor from 'parse-author'
import {rules} from './util/rules.js'
import {rule} from './util/rule.js'
@ -28,7 +28,7 @@ const remote = repoUrl('package.json')
const root = path.join(process.cwd(), 'packages')
// eslint-disable-next-line complexity
// eslint-disable-next-line complexity, unicorn/prefer-top-level-await
presets(root).then((presetObjects) => {
const allRules = rules(root)
let index = -1
@ -103,7 +103,7 @@ presets(root).then((presetObjects) => {
while (++contentIndex < descriptionContent.length) {
const node = descriptionContent[contentIndex]
if (node.type === 'heading' && node.depth === 2) {
category = GitHubSlugger.slug(toString(node))
category = githubSlug(toString(node))
}
if (!(category in categories)) {

View File

@ -129,11 +129,9 @@ export function rule(filePath) {
}
}
if (info.label === 'output') {
context[name][info.label] = exampleValue.split('\n')
} else {
context[name][info.label] = exampleValue
}
// @ts-expect-error: fine: array for output, string for rest.
context[name][info.label] =
info.label === 'output' ? exampleValue.split('\n') : exampleValue
}
return result