Skip to content

Commit 6c4d2be

Browse files
committed
fix: update import statements to use createQueries for consistency
1 parent adddbc1 commit 6c4d2be

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/remark-lint/src/rules/duplicate-stability-nodes.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { QUERIES } from '@node-core/doc-kit/src/utils/queries/index.mjs';
1+
import createQueries from '@node-core/doc-kit/src/utils/queries/index.mjs';
22
import { lintRule } from 'unified-lint-rule';
33
import { visit } from 'unist-util-visit';
44

@@ -29,7 +29,7 @@ const duplicateStabilityNodes = (tree, vfile) => {
2929
return;
3030
}
3131

32-
const match = QUERIES.stabilityIndexPrefix.exec(text); // Match "Stability: X"
32+
const match = createQueries.QUERIES.stabilityIndexPrefix.exec(text);
3333
if (!match) {
3434
return;
3535
}

packages/remark-lint/src/rules/invalid-type-reference.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { transformTypeToReferenceLink } from '@node-core/doc-kit/src/generators/metadata/utils/transformers.mjs';
2-
import { QUERIES } from '@node-core/doc-kit/src/utils/queries/index.mjs';
1+
import { transformTypeToReferenceLink } from '@node-core/doc-kit/src/utils/parser/index.mjs';
2+
import createQueries from '@node-core/doc-kit/src/utils/queries/index.mjs';
33
import { lintRule } from 'unified-lint-rule';
44
import { visit } from 'unist-util-visit';
55

@@ -13,9 +13,10 @@ const REPLACE_RE = /\s*\| */g;
1313
const invalidTypeReference = (tree, vfile, { typeMap = {} }) => {
1414
visit(
1515
tree,
16-
({ value }) => QUERIES.normalizeTypes.test(value),
16+
({ value }) => createQueries.QUERIES.normalizeTypes.test(value),
1717
node => {
18-
const types = node.value.match(QUERIES.normalizeTypes);
18+
const types =
19+
node.value.match(createQueries.QUERIES.normalizeTypes) ?? [];
1920

2021
types.forEach(type => {
2122
// Ensure wrapped in {}
@@ -39,6 +40,7 @@ const invalidTypeReference = (tree, vfile, { typeMap = {} }) => {
3940

4041
const normalized = type.replace(REPLACE_RE, '|');
4142
node.value = node.value.replace(type, normalized);
43+
type = normalized;
4244
}
4345

4446
if (transformTypeToReferenceLink(type, typeMap) === type) {

0 commit comments

Comments
 (0)