eslint-plugin-markdown-preferences 0.36.2 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/lib/chunk-BAz01cYq.js +18 -0
- package/lib/index.d.ts +16 -2
- package/lib/index.js +209 -44
- package/package.json +6 -6
- package/lib/chunk-CTAAG5j7.js +0 -13
package/README.md
CHANGED
|
@@ -203,6 +203,7 @@ The rules with the following 💄 are included in the `standard` config.
|
|
|
203
203
|
| [markdown-preferences/list-marker-alignment](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/list-marker-alignment.html) | enforce consistent alignment of list markers | 🔧 | ⭐💄 |
|
|
204
204
|
| [markdown-preferences/no-multi-spaces](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-multi-spaces.html) | disallow multiple spaces | 🔧 | 💄 |
|
|
205
205
|
| [markdown-preferences/no-multiple-empty-lines](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-multiple-empty-lines.html) | disallow multiple empty lines in Markdown files. | 🔧 | 💄 |
|
|
206
|
+
| [markdown-preferences/no-tabs](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-tabs.html) | Disallow tab characters in Markdown files. | 🔧 | 💄 |
|
|
206
207
|
| [markdown-preferences/no-trailing-spaces](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-trailing-spaces.html) | disallow trailing whitespace at the end of lines in Markdown files. | 🔧 | 💄 |
|
|
207
208
|
| [markdown-preferences/padded-custom-containers](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/padded-custom-containers.html) | disallow or require padding inside custom containers | 🔧 | 💄 |
|
|
208
209
|
| [markdown-preferences/padding-line-between-blocks](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/padding-line-between-blocks.html) | require or disallow padding lines between blocks | 🔧 | 💄 |
|
|
@@ -259,4 +260,4 @@ See the [LICENSE](./LICENSE) file for license rights and limitations (MIT).
|
|
|
259
260
|
|
|
260
261
|
[documentation site]: https://ota-meshi.github.io/eslint-plugin-markdown-preferences/
|
|
261
262
|
[npm-package]: https://www.npmjs.com/package/eslint-plugin-markdown-preferences
|
|
262
|
-
[npmtrends]:
|
|
263
|
+
[npmtrends]: https://www.npmtrends.com/eslint-plugin-markdown-preferences
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (all, symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) {
|
|
6
|
+
__defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (symbols) {
|
|
12
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { __export as t };
|
package/lib/index.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ declare module 'eslint' {
|
|
|
14
14
|
interface RulesRecord extends RuleOptions {}
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
declare module '@eslint/core' {
|
|
18
|
+
interface RulesConfig extends RuleOptions {
|
|
19
|
+
[key: string]: RuleConfig;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
17
22
|
interface RuleOptions {
|
|
18
23
|
/**
|
|
19
24
|
* enforce consistent use of closing sequence in ATX headings.
|
|
@@ -155,6 +160,11 @@ interface RuleOptions {
|
|
|
155
160
|
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-multiple-empty-lines.html
|
|
156
161
|
*/
|
|
157
162
|
'markdown-preferences/no-multiple-empty-lines'?: Linter.RuleEntry<MarkdownPreferencesNoMultipleEmptyLines>;
|
|
163
|
+
/**
|
|
164
|
+
* Disallow tab characters in Markdown files.
|
|
165
|
+
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-tabs.html
|
|
166
|
+
*/
|
|
167
|
+
'markdown-preferences/no-tabs'?: Linter.RuleEntry<MarkdownPreferencesNoTabs>;
|
|
158
168
|
/**
|
|
159
169
|
* disallow text backslash at the end of a line.
|
|
160
170
|
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-text-backslash-linebreak.html
|
|
@@ -393,6 +403,11 @@ type MarkdownPreferencesNoMultipleEmptyLines = [] | [{
|
|
|
393
403
|
maxEOF?: number;
|
|
394
404
|
maxBOF?: number;
|
|
395
405
|
}];
|
|
406
|
+
type MarkdownPreferencesNoTabs = [] | [{
|
|
407
|
+
checkTarget?: ("all" | "indentation" | "non-indentation");
|
|
408
|
+
ignoreCodeBlocks?: string[];
|
|
409
|
+
codeBlockTabWidth?: number;
|
|
410
|
+
}];
|
|
396
411
|
type MarkdownPreferencesNoTrailingSpaces = [] | [{
|
|
397
412
|
skipBlankLines?: boolean;
|
|
398
413
|
ignoreComments?: boolean;
|
|
@@ -462,7 +477,6 @@ type MarkdownPreferencesSortDefinitions = [] | [{
|
|
|
462
477
|
match: (string | [string, ...(string)[]]);
|
|
463
478
|
sort: ("alphabetical" | "ignore");
|
|
464
479
|
})[];
|
|
465
|
-
alphabetical?: boolean;
|
|
466
480
|
}];
|
|
467
481
|
type MarkdownPreferencesStrikethroughDelimitersStyle = [] | [{
|
|
468
482
|
delimiter?: ("~" | "~~");
|
|
@@ -539,7 +553,7 @@ declare namespace meta_d_exports {
|
|
|
539
553
|
export { name, version };
|
|
540
554
|
}
|
|
541
555
|
declare const name: "eslint-plugin-markdown-preferences";
|
|
542
|
-
declare const version: "0.
|
|
556
|
+
declare const version: "0.37.0";
|
|
543
557
|
//#endregion
|
|
544
558
|
//#region src/language/ast-types.d.ts
|
|
545
559
|
type Node = mdast.Node;
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __export } from "./chunk-
|
|
1
|
+
import { t as __export } from "./chunk-BAz01cYq.js";
|
|
2
2
|
import stringWidth from "string-width";
|
|
3
3
|
import emojiRegex from "emoji-regex-xs";
|
|
4
4
|
import path from "node:path";
|
|
@@ -732,7 +732,7 @@ function getOtherMarker(unavailableMarker) {
|
|
|
732
732
|
/**
|
|
733
733
|
* Parse rule options.
|
|
734
734
|
*/
|
|
735
|
-
function parseOptions$
|
|
735
|
+
function parseOptions$8(options) {
|
|
736
736
|
const primary = options.primary || "-";
|
|
737
737
|
const secondary = options.secondary || getOtherMarker(primary);
|
|
738
738
|
if (primary === secondary) throw new Error(`\`primary\` and \`secondary\` cannot be the same (primary: "${primary}", secondary: "${secondary}").`);
|
|
@@ -800,7 +800,7 @@ var bullet_list_marker_style_default = createRule("bullet-list-marker-style", {
|
|
|
800
800
|
},
|
|
801
801
|
create(context) {
|
|
802
802
|
const sourceCode = context.sourceCode;
|
|
803
|
-
const options = parseOptions$
|
|
803
|
+
const options = parseOptions$8(context.options[0] || {});
|
|
804
804
|
let containerStack = {
|
|
805
805
|
node: sourceCode.ast,
|
|
806
806
|
level: 1,
|
|
@@ -1418,7 +1418,7 @@ var custom_container_marker_spacing_default = createRule("custom-container-marke
|
|
|
1418
1418
|
/**
|
|
1419
1419
|
* Parse options with defaults.
|
|
1420
1420
|
*/
|
|
1421
|
-
function parseOptions$
|
|
1421
|
+
function parseOptions$7(options) {
|
|
1422
1422
|
return {
|
|
1423
1423
|
linkDefinitionPlacement: {
|
|
1424
1424
|
referencedFromSingleSection: options?.linkDefinitionPlacement?.referencedFromSingleSection || "document-last",
|
|
@@ -1490,7 +1490,7 @@ var definitions_last_default = createRule("definitions-last", {
|
|
|
1490
1490
|
},
|
|
1491
1491
|
create(context) {
|
|
1492
1492
|
const sourceCode = context.sourceCode;
|
|
1493
|
-
const options = parseOptions$
|
|
1493
|
+
const options = parseOptions$7(context.options[0]);
|
|
1494
1494
|
/**
|
|
1495
1495
|
* Determine whether a node can be placed as the last node of the document or a section.
|
|
1496
1496
|
*/
|
|
@@ -5464,7 +5464,7 @@ function parseMathClosingSequenceFromText(text) {
|
|
|
5464
5464
|
/**
|
|
5465
5465
|
* Parse options.
|
|
5466
5466
|
*/
|
|
5467
|
-
function parseOptions$
|
|
5467
|
+
function parseOptions$6(options) {
|
|
5468
5468
|
const listItems = options?.listItems;
|
|
5469
5469
|
return { listItems: {
|
|
5470
5470
|
first: listItems?.first ?? 1,
|
|
@@ -5517,7 +5517,7 @@ var indent_default = createRule("indent", {
|
|
|
5517
5517
|
},
|
|
5518
5518
|
create(context) {
|
|
5519
5519
|
const sourceCode = context.sourceCode;
|
|
5520
|
-
const options = parseOptions$
|
|
5520
|
+
const options = parseOptions$6(context.options[0]);
|
|
5521
5521
|
class AbsBlockStack {
|
|
5522
5522
|
violations = [];
|
|
5523
5523
|
getCurrentBlockquote() {
|
|
@@ -6723,11 +6723,11 @@ var link_bracket_newline_default = createRule("link-bracket-newline", {
|
|
|
6723
6723
|
},
|
|
6724
6724
|
create(context) {
|
|
6725
6725
|
const sourceCode = context.sourceCode;
|
|
6726
|
-
const optionProvider = parseOptions$
|
|
6726
|
+
const optionProvider = parseOptions$9(context.options[0]);
|
|
6727
6727
|
/**
|
|
6728
6728
|
* Parse the options.
|
|
6729
6729
|
*/
|
|
6730
|
-
function parseOptions$
|
|
6730
|
+
function parseOptions$9(option) {
|
|
6731
6731
|
const newline = option?.newline ?? "never";
|
|
6732
6732
|
const multiline = option?.multiline ?? false;
|
|
6733
6733
|
return (bracketsRange) => {
|
|
@@ -6869,7 +6869,7 @@ var link_bracket_newline_default = createRule("link-bracket-newline", {
|
|
|
6869
6869
|
/**
|
|
6870
6870
|
* The basic option for links and images.
|
|
6871
6871
|
*/
|
|
6872
|
-
function parseOptions$
|
|
6872
|
+
function parseOptions$5(option) {
|
|
6873
6873
|
const space = option?.space ?? "never";
|
|
6874
6874
|
const imagesInLinks = option?.imagesInLinks;
|
|
6875
6875
|
return {
|
|
@@ -6919,7 +6919,7 @@ var link_bracket_spacing_default = createRule("link-bracket-spacing", {
|
|
|
6919
6919
|
},
|
|
6920
6920
|
create(context) {
|
|
6921
6921
|
const sourceCode = context.sourceCode;
|
|
6922
|
-
const options = parseOptions$
|
|
6922
|
+
const options = parseOptions$5(context.options[0]);
|
|
6923
6923
|
/**
|
|
6924
6924
|
* Verify the space after the opening bracket and before the closing bracket.
|
|
6925
6925
|
*/
|
|
@@ -7228,11 +7228,11 @@ var link_paren_newline_default = createRule("link-paren-newline", {
|
|
|
7228
7228
|
},
|
|
7229
7229
|
create(context) {
|
|
7230
7230
|
const sourceCode = context.sourceCode;
|
|
7231
|
-
const optionProvider = parseOptions$
|
|
7231
|
+
const optionProvider = parseOptions$9(context.options[0]);
|
|
7232
7232
|
/**
|
|
7233
7233
|
* Parse the options.
|
|
7234
7234
|
*/
|
|
7235
|
-
function parseOptions$
|
|
7235
|
+
function parseOptions$9(option) {
|
|
7236
7236
|
const newline = option?.newline ?? "never";
|
|
7237
7237
|
const multiline = option?.multiline ?? false;
|
|
7238
7238
|
return (openingParenIndex, closingParenIndex) => {
|
|
@@ -8486,6 +8486,161 @@ var no_multiple_empty_lines_default = createRule("no-multiple-empty-lines", {
|
|
|
8486
8486
|
}
|
|
8487
8487
|
});
|
|
8488
8488
|
|
|
8489
|
+
//#endregion
|
|
8490
|
+
//#region src/rules/no-tabs.ts
|
|
8491
|
+
/**
|
|
8492
|
+
* Parse options
|
|
8493
|
+
*/
|
|
8494
|
+
function parseOptions$4(options) {
|
|
8495
|
+
const checkTarget = options?.checkTarget || "all";
|
|
8496
|
+
const checkTargets = checkTarget === "all" ? ["indentation", "non-indentation"] : [checkTarget];
|
|
8497
|
+
return {
|
|
8498
|
+
ignoreCodeBlocks: options?.ignoreCodeBlocks || [],
|
|
8499
|
+
checkTargets,
|
|
8500
|
+
codeBlockTabWidth: options?.codeBlockTabWidth ?? 4
|
|
8501
|
+
};
|
|
8502
|
+
}
|
|
8503
|
+
var no_tabs_default = createRule("no-tabs", {
|
|
8504
|
+
meta: {
|
|
8505
|
+
type: "layout",
|
|
8506
|
+
docs: {
|
|
8507
|
+
description: "Disallow tab characters in Markdown files.",
|
|
8508
|
+
categories: ["standard"],
|
|
8509
|
+
listCategory: "Whitespace"
|
|
8510
|
+
},
|
|
8511
|
+
fixable: "whitespace",
|
|
8512
|
+
hasSuggestions: false,
|
|
8513
|
+
schema: [{
|
|
8514
|
+
type: "object",
|
|
8515
|
+
properties: {
|
|
8516
|
+
checkTarget: {
|
|
8517
|
+
type: "string",
|
|
8518
|
+
enum: [
|
|
8519
|
+
"all",
|
|
8520
|
+
"indentation",
|
|
8521
|
+
"non-indentation"
|
|
8522
|
+
],
|
|
8523
|
+
default: "all"
|
|
8524
|
+
},
|
|
8525
|
+
ignoreCodeBlocks: {
|
|
8526
|
+
type: "array",
|
|
8527
|
+
items: { type: "string" },
|
|
8528
|
+
default: []
|
|
8529
|
+
},
|
|
8530
|
+
codeBlockTabWidth: {
|
|
8531
|
+
type: "integer",
|
|
8532
|
+
minimum: 1,
|
|
8533
|
+
default: 4
|
|
8534
|
+
}
|
|
8535
|
+
},
|
|
8536
|
+
additionalProperties: false
|
|
8537
|
+
}],
|
|
8538
|
+
messages: { unexpectedTab: "Unexpected tab character." }
|
|
8539
|
+
},
|
|
8540
|
+
create(context) {
|
|
8541
|
+
const sourceCode = context.sourceCode;
|
|
8542
|
+
const { ignoreCodeBlocks, checkTargets, codeBlockTabWidth } = parseOptions$4(context.options[0]);
|
|
8543
|
+
const codeBlocks = [];
|
|
8544
|
+
/** Check if a language should be ignored based on ignoreCodeBlocks option */
|
|
8545
|
+
function shouldIgnoreLanguage(language$2) {
|
|
8546
|
+
if (ignoreCodeBlocks.length === 0) return false;
|
|
8547
|
+
if (ignoreCodeBlocks.includes("*")) return true;
|
|
8548
|
+
return language$2 !== null && ignoreCodeBlocks.includes(language$2);
|
|
8549
|
+
}
|
|
8550
|
+
/**
|
|
8551
|
+
* Check if the given index is at indentation (beginning of line)
|
|
8552
|
+
*/
|
|
8553
|
+
function isAtIndentation(index) {
|
|
8554
|
+
const loc = sourceCode.getLocFromIndex(index);
|
|
8555
|
+
const text = sourceCode.lines[loc.line - 1].slice(0, loc.column - 1);
|
|
8556
|
+
return !text || isWhitespace(text);
|
|
8557
|
+
}
|
|
8558
|
+
/**
|
|
8559
|
+
* Find the code block containing the given index
|
|
8560
|
+
*/
|
|
8561
|
+
function findCodeBlock(index) {
|
|
8562
|
+
const codeBlock = codeBlocks.find((block) => index >= block.contentRange[0] && index < block.contentRange[1]);
|
|
8563
|
+
if (!codeBlock) return null;
|
|
8564
|
+
const loc = sourceCode.getLocFromIndex(index);
|
|
8565
|
+
if (getWidth(sourceCode.lines[loc.line - 1].slice(0, loc.column - 1)) < codeBlock.indentWidth) return null;
|
|
8566
|
+
return codeBlock;
|
|
8567
|
+
}
|
|
8568
|
+
/**
|
|
8569
|
+
* Calculate the number of spaces to replace a tab.
|
|
8570
|
+
* Handles both regular tabs and tabs within code block content.
|
|
8571
|
+
*/
|
|
8572
|
+
function calculateReplacementSpaces(tabIndex, codeBlock) {
|
|
8573
|
+
const loc = sourceCode.getLocFromIndex(tabIndex);
|
|
8574
|
+
const beforeText = sourceCode.lines[loc.line - 1].slice(0, loc.column - 1);
|
|
8575
|
+
if (!codeBlock || codeBlockTabWidth === 4) return 4 - getWidth(beforeText) % 4;
|
|
8576
|
+
let tabStop = codeBlock.indentWidth <= 0 ? codeBlockTabWidth : 4;
|
|
8577
|
+
let beforeWidth = 0;
|
|
8578
|
+
for (const c of beforeText) {
|
|
8579
|
+
if (c === " ") beforeWidth += tabStop - beforeWidth % tabStop;
|
|
8580
|
+
else beforeWidth++;
|
|
8581
|
+
if (tabStop === 4 && codeBlock.indentWidth <= beforeWidth) tabStop = codeBlockTabWidth;
|
|
8582
|
+
}
|
|
8583
|
+
return tabStop - beforeWidth % tabStop;
|
|
8584
|
+
}
|
|
8585
|
+
return {
|
|
8586
|
+
code(node) {
|
|
8587
|
+
const range = sourceCode.getRange(node);
|
|
8588
|
+
const loc = sourceCode.getLoc(node);
|
|
8589
|
+
const codeBlockStartLineText = sourceCode.lines[loc.start.line - 1];
|
|
8590
|
+
const codeBlockIndentText = codeBlockStartLineText.slice(0, loc.start.column - 1);
|
|
8591
|
+
if (getCodeBlockKind(sourceCode, node) === "indented") {
|
|
8592
|
+
const baseWidth = getWidth(codeBlockIndentText);
|
|
8593
|
+
let indentText;
|
|
8594
|
+
let indentColumnIndex = loc.start.column;
|
|
8595
|
+
while (getWidth(indentText = codeBlockStartLineText.slice(0, indentColumnIndex)) < baseWidth + 4) indentColumnIndex++;
|
|
8596
|
+
codeBlocks.push({
|
|
8597
|
+
contentRange: [range[0] + 1, range[1]],
|
|
8598
|
+
indentWidth: getWidth(indentText),
|
|
8599
|
+
ignore: shouldIgnoreLanguage(null) ? "check" : indentText.includes(" ") ? "fix" : false
|
|
8600
|
+
});
|
|
8601
|
+
return;
|
|
8602
|
+
}
|
|
8603
|
+
const parsed = parseFencedCodeBlock(sourceCode, node);
|
|
8604
|
+
if (!parsed) {
|
|
8605
|
+
codeBlocks.push({
|
|
8606
|
+
contentRange: range,
|
|
8607
|
+
indentWidth: getWidth(codeBlockIndentText),
|
|
8608
|
+
ignore: "check"
|
|
8609
|
+
});
|
|
8610
|
+
return;
|
|
8611
|
+
}
|
|
8612
|
+
codeBlocks.push({
|
|
8613
|
+
contentRange: [(parsed.meta ?? parsed.language ?? parsed.openingFence).range[1], parsed.closingFence?.range[0] ?? range[1]],
|
|
8614
|
+
indentWidth: getWidth(codeBlockIndentText),
|
|
8615
|
+
ignore: shouldIgnoreLanguage(node.lang?.toLowerCase() ?? null) ? "check" : false
|
|
8616
|
+
});
|
|
8617
|
+
},
|
|
8618
|
+
"root:exit"() {
|
|
8619
|
+
for (let i = 0; i < sourceCode.text.length; i++) {
|
|
8620
|
+
if (sourceCode.text[i] !== " ") continue;
|
|
8621
|
+
if (isAtIndentation(i)) {
|
|
8622
|
+
if (!checkTargets.includes("indentation")) continue;
|
|
8623
|
+
} else if (!checkTargets.includes("non-indentation")) continue;
|
|
8624
|
+
const codeBlock = findCodeBlock(i);
|
|
8625
|
+
if (codeBlock?.ignore === "check") continue;
|
|
8626
|
+
context.report({
|
|
8627
|
+
loc: {
|
|
8628
|
+
start: sourceCode.getLocFromIndex(i),
|
|
8629
|
+
end: sourceCode.getLocFromIndex(i + 1)
|
|
8630
|
+
},
|
|
8631
|
+
messageId: "unexpectedTab",
|
|
8632
|
+
fix: (fixer) => {
|
|
8633
|
+
if (codeBlock?.ignore === "fix") return null;
|
|
8634
|
+
const spaces = calculateReplacementSpaces(i, codeBlock);
|
|
8635
|
+
return fixer.replaceTextRange([i, i + 1], " ".repeat(spaces));
|
|
8636
|
+
}
|
|
8637
|
+
});
|
|
8638
|
+
}
|
|
8639
|
+
}
|
|
8640
|
+
};
|
|
8641
|
+
}
|
|
8642
|
+
});
|
|
8643
|
+
|
|
8489
8644
|
//#endregion
|
|
8490
8645
|
//#region src/rules/no-text-backslash-linebreak.ts
|
|
8491
8646
|
var no_text_backslash_linebreak_default = createRule("no-text-backslash-linebreak", {
|
|
@@ -9848,6 +10003,9 @@ var prefer_link_reference_definitions_default = createRule("prefer-link-referenc
|
|
|
9848
10003
|
for (const definition of definitions) getResourceNodes(definition).definitions.push(definition);
|
|
9849
10004
|
for (const map of resourceToNodes.values()) for (const nodes of map.values()) {
|
|
9850
10005
|
if (nodes.links.length === 0 || nodes.links.length + nodes.references.length < minLinks) continue;
|
|
10006
|
+
nodes.links.sort((a, b) => sourceCode.getRange(a)[0] - sourceCode.getRange(b)[0]);
|
|
10007
|
+
const firstLink = nodes.links[0];
|
|
10008
|
+
const lastLink = nodes.links[nodes.links.length - 1];
|
|
9851
10009
|
for (const link of nodes.links) {
|
|
9852
10010
|
const linkInfo = getLinkInfo(link);
|
|
9853
10011
|
if (linkInfo.label === "") continue;
|
|
@@ -9867,6 +10025,10 @@ var prefer_link_reference_definitions_default = createRule("prefer-link-referenc
|
|
|
9867
10025
|
while (definitions.some((def) => def.identifier === identifier)) identifier = `${original}-${++seq}`;
|
|
9868
10026
|
}
|
|
9869
10027
|
}
|
|
10028
|
+
if (firstLink !== link) {
|
|
10029
|
+
const firstLinkRange = sourceCode.getRange(firstLink);
|
|
10030
|
+
yield fixer.insertTextBeforeRange([firstLinkRange[0], firstLinkRange[0]], "");
|
|
10031
|
+
}
|
|
9870
10032
|
yield fixer.replaceTextRange([linkInfo.bracketsRange[0], sourceCode.getRange(link)[1]], `${sourceCode.text.slice(...linkInfo.bracketsRange)}${identifier === linkInfo.label ? "" : `[${identifier}]`}`);
|
|
9871
10033
|
if (!definition) {
|
|
9872
10034
|
const linkRange = sourceCode.getRange(link);
|
|
@@ -9879,6 +10041,10 @@ var prefer_link_reference_definitions_default = createRule("prefer-link-referenc
|
|
|
9879
10041
|
} else insertIndex = sourceCode.text.trimEnd().length;
|
|
9880
10042
|
yield fixer.insertTextAfterRange([insertIndex, insertIndex], `${sourceCode.text[insertIndex - 1] === "\n" ? "" : "\n"}\n[${identifier}]: ${sourceCode.text.slice(linkInfo.urlAndTitleRange[0] + 1, linkInfo.urlAndTitleRange[1] - 1).trim()}${nextSectionHeading ? "\n" : ""}`);
|
|
9881
10043
|
}
|
|
10044
|
+
if (lastLink !== link) {
|
|
10045
|
+
const lastLinkRange = sourceCode.getRange(lastLink);
|
|
10046
|
+
yield fixer.insertTextAfterRange([lastLinkRange[1], lastLinkRange[1]], "");
|
|
10047
|
+
}
|
|
9882
10048
|
}
|
|
9883
10049
|
});
|
|
9884
10050
|
}
|
|
@@ -10387,37 +10553,34 @@ var sort_definitions_default = createRule("sort-definitions", {
|
|
|
10387
10553
|
hasSuggestions: false,
|
|
10388
10554
|
schema: [{
|
|
10389
10555
|
type: "object",
|
|
10390
|
-
properties: {
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10556
|
+
properties: { order: {
|
|
10557
|
+
type: "array",
|
|
10558
|
+
items: { anyOf: [
|
|
10559
|
+
{ type: "string" },
|
|
10560
|
+
{
|
|
10561
|
+
type: "array",
|
|
10562
|
+
items: { type: "string" },
|
|
10563
|
+
uniqueItems: true,
|
|
10564
|
+
minItems: 1
|
|
10565
|
+
},
|
|
10566
|
+
{
|
|
10567
|
+
type: "object",
|
|
10568
|
+
properties: {
|
|
10569
|
+
match: { anyOf: [{ type: "string" }, {
|
|
10570
|
+
type: "array",
|
|
10571
|
+
items: { type: "string" },
|
|
10572
|
+
uniqueItems: true,
|
|
10573
|
+
minItems: 1
|
|
10574
|
+
}] },
|
|
10575
|
+
sort: { enum: ["alphabetical", "ignore"] }
|
|
10400
10576
|
},
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
minItems: 1
|
|
10409
|
-
}] },
|
|
10410
|
-
sort: { enum: ["alphabetical", "ignore"] }
|
|
10411
|
-
},
|
|
10412
|
-
required: ["match", "sort"],
|
|
10413
|
-
additionalProperties: false
|
|
10414
|
-
}
|
|
10415
|
-
] },
|
|
10416
|
-
uniqueItems: true,
|
|
10417
|
-
additionalItems: false
|
|
10418
|
-
},
|
|
10419
|
-
alphabetical: { type: "boolean" }
|
|
10420
|
-
},
|
|
10577
|
+
required: ["match", "sort"],
|
|
10578
|
+
additionalProperties: false
|
|
10579
|
+
}
|
|
10580
|
+
] },
|
|
10581
|
+
uniqueItems: true,
|
|
10582
|
+
additionalItems: false
|
|
10583
|
+
} },
|
|
10421
10584
|
additionalProperties: false
|
|
10422
10585
|
}],
|
|
10423
10586
|
messages: {
|
|
@@ -12101,6 +12264,7 @@ const rules$1 = [
|
|
|
12101
12264
|
no_laziness_blockquotes_default,
|
|
12102
12265
|
no_multi_spaces_default,
|
|
12103
12266
|
no_multiple_empty_lines_default,
|
|
12267
|
+
no_tabs_default,
|
|
12104
12268
|
no_text_backslash_linebreak_default,
|
|
12105
12269
|
no_trailing_spaces_default,
|
|
12106
12270
|
ordered_list_marker_sequence_default,
|
|
@@ -12201,6 +12365,7 @@ const rules$2 = {
|
|
|
12201
12365
|
"markdown-preferences/no-laziness-blockquotes": "error",
|
|
12202
12366
|
"markdown-preferences/no-multi-spaces": "error",
|
|
12203
12367
|
"markdown-preferences/no-multiple-empty-lines": "error",
|
|
12368
|
+
"markdown-preferences/no-tabs": "error",
|
|
12204
12369
|
"markdown-preferences/no-text-backslash-linebreak": "error",
|
|
12205
12370
|
"markdown-preferences/no-trailing-spaces": "error",
|
|
12206
12371
|
"markdown-preferences/ordered-list-marker-sequence": "error",
|
|
@@ -12228,7 +12393,7 @@ var meta_exports = /* @__PURE__ */ __export({
|
|
|
12228
12393
|
version: () => version
|
|
12229
12394
|
});
|
|
12230
12395
|
const name = "eslint-plugin-markdown-preferences";
|
|
12231
|
-
const version = "0.
|
|
12396
|
+
const version = "0.37.0";
|
|
12232
12397
|
|
|
12233
12398
|
//#endregion
|
|
12234
12399
|
//#region src/language/extensions/micromark-custom-container.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-markdown-preferences",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "ESLint plugin that enforces our markdown preferences",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@changesets/changelog-github": "^0.5.1",
|
|
81
81
|
"@changesets/cli": "^2.28.1",
|
|
82
82
|
"@changesets/get-release-plan": "^4.0.8",
|
|
83
|
-
"@eslint/core": "^0.
|
|
83
|
+
"@eslint/core": "^1.0.0",
|
|
84
84
|
"@eslint/markdown": "^7.4.0",
|
|
85
85
|
"@ota-meshi/eslint-plugin": "^0.18.0",
|
|
86
86
|
"@shikijs/vitepress-twoslash": "^3.0.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@types/json-schema": "^7.0.15",
|
|
92
92
|
"@types/mdast": "^4.0.4",
|
|
93
93
|
"@types/mocha": "^10.0.10",
|
|
94
|
-
"@types/node": "^
|
|
94
|
+
"@types/node": "^24.0.0",
|
|
95
95
|
"@types/semver": "^7.5.8",
|
|
96
96
|
"assert": "^2.1.0",
|
|
97
97
|
"c8": "^10.1.3",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
103
103
|
"eslint-plugin-eslint-plugin": "^7.0.0",
|
|
104
104
|
"eslint-plugin-jsdoc": "^55.0.0",
|
|
105
|
-
"eslint-plugin-json-schema-validator": "^5.
|
|
105
|
+
"eslint-plugin-json-schema-validator": "^5.5.0",
|
|
106
106
|
"eslint-plugin-jsonc": "^2.19.1",
|
|
107
107
|
"eslint-plugin-markdown": "^5.1.0",
|
|
108
108
|
"eslint-plugin-markdown-links": "^0.6.0",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"eslint-plugin-yml": "^1.17.0",
|
|
115
115
|
"eslint-snapshot-rule-tester": "^0.1.0",
|
|
116
116
|
"eslint-typegen": "^2.0.0",
|
|
117
|
-
"espree": "^
|
|
117
|
+
"espree": "^11.0.0",
|
|
118
118
|
"events": "^3.3.0",
|
|
119
119
|
"globals": "^16.0.0",
|
|
120
120
|
"mocha": "^11.1.0",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"stylelint-config-recommended-vue": "^1.6.0",
|
|
127
127
|
"stylelint-config-standard": "^39.0.0",
|
|
128
128
|
"stylelint-config-standard-vue": "^1.0.0",
|
|
129
|
-
"tsdown": "^0.
|
|
129
|
+
"tsdown": "^0.16.0",
|
|
130
130
|
"tsx": "^4.19.3",
|
|
131
131
|
"twoslash-eslint": "^0.3.1",
|
|
132
132
|
"type-fest": "^5.0.0",
|
package/lib/chunk-CTAAG5j7.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __export = (all) => {
|
|
4
|
-
let target = {};
|
|
5
|
-
for (var name in all) __defProp(target, name, {
|
|
6
|
-
get: all[name],
|
|
7
|
-
enumerable: true
|
|
8
|
-
});
|
|
9
|
-
return target;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
export { __export };
|