eslint-plugin-markdown-preferences 0.28.0 → 0.29.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 +20 -19
- package/lib/index.d.ts +10 -2
- package/lib/index.js +123 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -164,25 +164,25 @@ The rules with the following 💄 are included in the `standard` config.
|
|
|
164
164
|
|
|
165
165
|
<!-- prettier-ignore-start -->
|
|
166
166
|
|
|
167
|
-
| Rule ID | Description
|
|
168
|
-
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
169
|
-
| [markdown-preferences/bullet-list-marker-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/bullet-list-marker-style.html) | enforce consistent bullet list (unordered list) marker style
|
|
170
|
-
| [markdown-preferences/code-fence-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/code-fence-style.html) | enforce a consistent code fence style (backtick or tilde) in Markdown fenced code blocks.
|
|
171
|
-
| [markdown-preferences/definitions-last](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/definitions-last.html) | require link definitions and footnote definitions to be placed at the end of the document
|
|
172
|
-
| [markdown-preferences/emphasis-delimiters-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/emphasis-delimiters-style.html) | enforce a consistent delimiter style for emphasis and strong emphasis
|
|
173
|
-
| [markdown-preferences/hard-linebreak-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/hard-linebreak-style.html) | enforce consistent hard linebreak style.
|
|
174
|
-
| [markdown-preferences/level1-heading-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/level1-heading-style.html) | enforce consistent style for level 1 headings
|
|
175
|
-
| [markdown-preferences/level2-heading-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/level2-heading-style.html) | enforce consistent style for level 2 headings
|
|
176
|
-
| [markdown-preferences/link-destination-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/link-destination-style.html) | enforce a consistent style for link destinations
|
|
177
|
-
| [markdown-preferences/link-title-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/link-title-style.html) | enforce a consistent style for link titles
|
|
178
|
-
| [markdown-preferences/no-implicit-block-closing](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-implicit-block-closing.html) | disallow implicit block closing for fenced code blocks, math blocks, and custom
|
|
179
|
-
| [markdown-preferences/no-text-backslash-linebreak](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-text-backslash-linebreak.html) | disallow text backslash at the end of a line.
|
|
180
|
-
| [markdown-preferences/ordered-list-marker-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/ordered-list-marker-style.html) | enforce consistent ordered list marker style
|
|
181
|
-
| [markdown-preferences/prefer-autolinks](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-autolinks.html) | enforce the use of autolinks for URLs
|
|
182
|
-
| [markdown-preferences/prefer-fenced-code-blocks](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-fenced-code-blocks.html) | enforce the use of fenced code blocks over indented code blocks
|
|
183
|
-
| [markdown-preferences/prefer-link-reference-definitions](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-link-reference-definitions.html) | enforce using link reference definitions instead of inline links
|
|
184
|
-
| [markdown-preferences/strikethrough-delimiters-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/strikethrough-delimiters-style.html) | enforce a consistent delimiter style for strikethrough
|
|
185
|
-
| [markdown-preferences/thematic-break-character-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/thematic-break-character-style.html) | enforce consistent character style for thematic breaks (horizontal rules) in Markdown.
|
|
167
|
+
| Rule ID | Description | Fixable | Config |
|
|
168
|
+
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------- | :-----: | :----: |
|
|
169
|
+
| [markdown-preferences/bullet-list-marker-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/bullet-list-marker-style.html) | enforce consistent bullet list (unordered list) marker style | 🔧 | 💄 |
|
|
170
|
+
| [markdown-preferences/code-fence-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/code-fence-style.html) | enforce a consistent code fence style (backtick or tilde) in Markdown fenced code blocks. | 🔧 | 💄 |
|
|
171
|
+
| [markdown-preferences/definitions-last](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/definitions-last.html) | require link definitions and footnote definitions to be placed at the end of the document | 🔧 | |
|
|
172
|
+
| [markdown-preferences/emphasis-delimiters-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/emphasis-delimiters-style.html) | enforce a consistent delimiter style for emphasis and strong emphasis | 🔧 | 💄 |
|
|
173
|
+
| [markdown-preferences/hard-linebreak-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/hard-linebreak-style.html) | enforce consistent hard linebreak style. | 🔧 | ⭐💄 |
|
|
174
|
+
| [markdown-preferences/level1-heading-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/level1-heading-style.html) | enforce consistent style for level 1 headings | 🔧 | 💄 |
|
|
175
|
+
| [markdown-preferences/level2-heading-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/level2-heading-style.html) | enforce consistent style for level 2 headings | 🔧 | 💄 |
|
|
176
|
+
| [markdown-preferences/link-destination-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/link-destination-style.html) | enforce a consistent style for link destinations | 🔧 | 💄 |
|
|
177
|
+
| [markdown-preferences/link-title-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/link-title-style.html) | enforce a consistent style for link titles | 🔧 | 💄 |
|
|
178
|
+
| [markdown-preferences/no-implicit-block-closing](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-implicit-block-closing.html) | disallow implicit block closing for fenced code blocks, math blocks, and custom containers | 🔧 | ⭐💄 |
|
|
179
|
+
| [markdown-preferences/no-text-backslash-linebreak](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-text-backslash-linebreak.html) | disallow text backslash at the end of a line. | | ⭐💄 |
|
|
180
|
+
| [markdown-preferences/ordered-list-marker-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/ordered-list-marker-style.html) | enforce consistent ordered list marker style | 🔧 | 💄 |
|
|
181
|
+
| [markdown-preferences/prefer-autolinks](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-autolinks.html) | enforce the use of autolinks for URLs | 🔧 | ⭐💄 |
|
|
182
|
+
| [markdown-preferences/prefer-fenced-code-blocks](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-fenced-code-blocks.html) | enforce the use of fenced code blocks over indented code blocks | 🔧 | ⭐💄 |
|
|
183
|
+
| [markdown-preferences/prefer-link-reference-definitions](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-link-reference-definitions.html) | enforce using link reference definitions instead of inline links | 🔧 | |
|
|
184
|
+
| [markdown-preferences/strikethrough-delimiters-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/strikethrough-delimiters-style.html) | enforce a consistent delimiter style for strikethrough | 🔧 | 💄 |
|
|
185
|
+
| [markdown-preferences/thematic-break-character-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/thematic-break-character-style.html) | enforce consistent character style for thematic breaks (horizontal rules) in Markdown. | 🔧 | 💄 |
|
|
186
186
|
|
|
187
187
|
<!-- prettier-ignore-end -->
|
|
188
188
|
|
|
@@ -204,6 +204,7 @@ The rules with the following 💄 are included in the `standard` config.
|
|
|
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
206
|
| [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
|
+
| [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 | 🔧 | 💄 |
|
|
207
208
|
| [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 | 🔧 | 💄 |
|
|
208
209
|
| [markdown-preferences/table-pipe-spacing](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/table-pipe-spacing.html) | enforce consistent spacing around table pipes | 🔧 | 💄 |
|
|
209
210
|
|
package/lib/index.d.ts
CHANGED
|
@@ -126,7 +126,7 @@ interface RuleOptions {
|
|
|
126
126
|
*/
|
|
127
127
|
'markdown-preferences/list-marker-alignment'?: Linter.RuleEntry<MarkdownPreferencesListMarkerAlignment>;
|
|
128
128
|
/**
|
|
129
|
-
* disallow implicit block closing for fenced code blocks, math blocks, and custom
|
|
129
|
+
* disallow implicit block closing for fenced code blocks, math blocks, and custom containers
|
|
130
130
|
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-implicit-block-closing.html
|
|
131
131
|
*/
|
|
132
132
|
'markdown-preferences/no-implicit-block-closing'?: Linter.RuleEntry<[]>;
|
|
@@ -170,6 +170,11 @@ interface RuleOptions {
|
|
|
170
170
|
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/ordered-list-marker-style.html
|
|
171
171
|
*/
|
|
172
172
|
'markdown-preferences/ordered-list-marker-style'?: Linter.RuleEntry<MarkdownPreferencesOrderedListMarkerStyle>;
|
|
173
|
+
/**
|
|
174
|
+
* disallow or require padding inside custom containers
|
|
175
|
+
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/padded-custom-containers.html
|
|
176
|
+
*/
|
|
177
|
+
'markdown-preferences/padded-custom-containers'?: Linter.RuleEntry<MarkdownPreferencesPaddedCustomContainers>;
|
|
173
178
|
/**
|
|
174
179
|
* require or disallow padding lines between blocks
|
|
175
180
|
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/padding-line-between-blocks.html
|
|
@@ -389,6 +394,9 @@ type MarkdownPreferencesOrderedListMarkerStyle = [] | [{
|
|
|
389
394
|
prefer?: ("n." | "n)");
|
|
390
395
|
}[];
|
|
391
396
|
}];
|
|
397
|
+
type MarkdownPreferencesPaddedCustomContainers = [] | [{
|
|
398
|
+
padding?: ("always" | "never");
|
|
399
|
+
}];
|
|
392
400
|
type MarkdownPreferencesPaddingLineBetweenBlocks = {
|
|
393
401
|
prev: (("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "custom-container" | "math" | "import-code-snippet" | "*") | [("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "custom-container" | "math" | "import-code-snippet" | "*"), ...(("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "custom-container" | "math" | "import-code-snippet" | "*"))[]] | {
|
|
394
402
|
type: (("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "custom-container" | "math" | "import-code-snippet" | "*") | [("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "custom-container" | "math" | "import-code-snippet" | "*"), ...(("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "custom-container" | "math" | "import-code-snippet" | "*"))[]]);
|
|
@@ -508,7 +516,7 @@ declare namespace meta_d_exports {
|
|
|
508
516
|
export { name, version };
|
|
509
517
|
}
|
|
510
518
|
declare const name: "eslint-plugin-markdown-preferences";
|
|
511
|
-
declare const version: "0.
|
|
519
|
+
declare const version: "0.29.0";
|
|
512
520
|
//#endregion
|
|
513
521
|
//#region src/language/ast-types.d.ts
|
|
514
522
|
type Node = mdast.Node;
|
package/lib/index.js
CHANGED
|
@@ -7617,7 +7617,7 @@ var no_implicit_block_closing_default = createRule("no-implicit-block-closing",
|
|
|
7617
7617
|
meta: {
|
|
7618
7618
|
type: "suggestion",
|
|
7619
7619
|
docs: {
|
|
7620
|
-
description: "disallow implicit block closing for fenced code blocks, math blocks, and custom
|
|
7620
|
+
description: "disallow implicit block closing for fenced code blocks, math blocks, and custom containers",
|
|
7621
7621
|
categories: ["recommended", "standard"],
|
|
7622
7622
|
listCategory: "Notation"
|
|
7623
7623
|
},
|
|
@@ -7636,7 +7636,8 @@ var no_implicit_block_closing_default = createRule("no-implicit-block-closing",
|
|
|
7636
7636
|
code(node) {
|
|
7637
7637
|
const parsed = parseFencedCodeBlock(sourceCode, node);
|
|
7638
7638
|
if (!parsed) return;
|
|
7639
|
-
if (
|
|
7639
|
+
if (parsed.closingFence) return;
|
|
7640
|
+
context.report({
|
|
7640
7641
|
node,
|
|
7641
7642
|
loc: parsed.openingFence.loc,
|
|
7642
7643
|
messageId: "missingClosingFence",
|
|
@@ -7651,7 +7652,8 @@ var no_implicit_block_closing_default = createRule("no-implicit-block-closing",
|
|
|
7651
7652
|
math(node) {
|
|
7652
7653
|
const parsed = parseMathBlock(sourceCode, node);
|
|
7653
7654
|
if (!parsed) return;
|
|
7654
|
-
if (
|
|
7655
|
+
if (parsed.closingSequence) return;
|
|
7656
|
+
context.report({
|
|
7655
7657
|
node,
|
|
7656
7658
|
loc: parsed.openingSequence.loc,
|
|
7657
7659
|
messageId: "missingClosingMath",
|
|
@@ -7666,11 +7668,13 @@ var no_implicit_block_closing_default = createRule("no-implicit-block-closing",
|
|
|
7666
7668
|
customContainer(node) {
|
|
7667
7669
|
const parsed = parseCustomContainer(sourceCode, node);
|
|
7668
7670
|
if (!parsed) return;
|
|
7669
|
-
if (
|
|
7671
|
+
if (parsed.closingSequence) return;
|
|
7672
|
+
context.report({
|
|
7670
7673
|
node,
|
|
7671
7674
|
loc: parsed.openingSequence.loc,
|
|
7672
7675
|
messageId: "missingClosingContainer",
|
|
7673
7676
|
fix(fixer) {
|
|
7677
|
+
if (withinSameLengthOpeningCustomContainer(sourceCode, node, parsed.openingSequence.text.length)) return null;
|
|
7674
7678
|
const openingLoc = parsed.openingSequence.loc;
|
|
7675
7679
|
const prefix = sourceCode.lines[openingLoc.start.line - 1].slice(0, openingLoc.start.column - 1).replace(/[^\s>]/gu, " ");
|
|
7676
7680
|
const closingSequence = parsed.openingSequence.text;
|
|
@@ -7681,6 +7685,23 @@ var no_implicit_block_closing_default = createRule("no-implicit-block-closing",
|
|
|
7681
7685
|
};
|
|
7682
7686
|
}
|
|
7683
7687
|
});
|
|
7688
|
+
/**
|
|
7689
|
+
* Check if the given custom container node is within another custom container
|
|
7690
|
+
* that has the same length of opening sequence.
|
|
7691
|
+
*
|
|
7692
|
+
*/
|
|
7693
|
+
function withinSameLengthOpeningCustomContainer(sourceCode, node, openingLength) {
|
|
7694
|
+
let current = getParent(sourceCode, node);
|
|
7695
|
+
while (current) {
|
|
7696
|
+
if (current.type === "customContainer") {
|
|
7697
|
+
const parsed = parseCustomContainer(sourceCode, current);
|
|
7698
|
+
if (!parsed) return true;
|
|
7699
|
+
if (parsed.openingSequence.text.length === openingLength) return true;
|
|
7700
|
+
}
|
|
7701
|
+
current = getParent(sourceCode, current);
|
|
7702
|
+
}
|
|
7703
|
+
return false;
|
|
7704
|
+
}
|
|
7684
7705
|
|
|
7685
7706
|
//#endregion
|
|
7686
7707
|
//#region src/rules/no-laziness-blockquotes.ts
|
|
@@ -8922,6 +8943,101 @@ var ordered_list_marker_style_default = createRule("ordered-list-marker-style",
|
|
|
8922
8943
|
}
|
|
8923
8944
|
});
|
|
8924
8945
|
|
|
8946
|
+
//#endregion
|
|
8947
|
+
//#region src/rules/padded-custom-containers.ts
|
|
8948
|
+
var padded_custom_containers_default = createRule("padded-custom-containers", {
|
|
8949
|
+
meta: {
|
|
8950
|
+
type: "layout",
|
|
8951
|
+
docs: {
|
|
8952
|
+
description: "disallow or require padding inside custom containers",
|
|
8953
|
+
categories: ["standard"],
|
|
8954
|
+
listCategory: "Whitespace"
|
|
8955
|
+
},
|
|
8956
|
+
fixable: "whitespace",
|
|
8957
|
+
hasSuggestions: false,
|
|
8958
|
+
schema: [{
|
|
8959
|
+
type: "object",
|
|
8960
|
+
properties: { padding: {
|
|
8961
|
+
type: "string",
|
|
8962
|
+
enum: ["always", "never"],
|
|
8963
|
+
default: "never"
|
|
8964
|
+
} },
|
|
8965
|
+
additionalProperties: false
|
|
8966
|
+
}],
|
|
8967
|
+
messages: {
|
|
8968
|
+
expectedPaddingAfterOpeningMarker: "Expected padding after opening marker.",
|
|
8969
|
+
expectedPaddingBeforeClosingMarker: "Expected padding before closing marker.",
|
|
8970
|
+
unexpectedPaddingAfterOpeningMarker: "Unexpected padding after opening marker.",
|
|
8971
|
+
unexpectedPaddingBeforeClosingMarker: "Unexpected padding before closing marker."
|
|
8972
|
+
}
|
|
8973
|
+
},
|
|
8974
|
+
create(context) {
|
|
8975
|
+
const sourceCode = context.sourceCode;
|
|
8976
|
+
const padding = (context.options[0] || {}).padding || "never";
|
|
8977
|
+
return { customContainer(node) {
|
|
8978
|
+
if (node.children.length === 0) return;
|
|
8979
|
+
const parsed = parseCustomContainer(sourceCode, node);
|
|
8980
|
+
if (!parsed) return;
|
|
8981
|
+
const { openingSequence, closingSequence } = parsed;
|
|
8982
|
+
const firstChild = node.children[0];
|
|
8983
|
+
const lastChild = node.children[node.children.length - 1];
|
|
8984
|
+
const firstChildLoc = sourceCode.getLoc(firstChild);
|
|
8985
|
+
const lastChildLoc = sourceCode.getLoc(lastChild);
|
|
8986
|
+
const paddingAfterOpeningLines = firstChildLoc.start.line - openingSequence.loc.end.line - 1;
|
|
8987
|
+
const paddingBeforeClosingLines = closingSequence ? closingSequence.loc.start.line - lastChildLoc.end.line - 1 : null;
|
|
8988
|
+
if (padding === "always") {
|
|
8989
|
+
if (paddingAfterOpeningLines <= 0) {
|
|
8990
|
+
const reportEndToken = parsed.info ?? openingSequence;
|
|
8991
|
+
const reportRange = [openingSequence.range[0], reportEndToken.range[1]];
|
|
8992
|
+
context.report({
|
|
8993
|
+
messageId: "expectedPaddingAfterOpeningMarker",
|
|
8994
|
+
loc: getSourceLocationFromRange(sourceCode, node, reportRange),
|
|
8995
|
+
fix(fixer) {
|
|
8996
|
+
return fixer.insertTextAfterRange(reportRange, "\n");
|
|
8997
|
+
}
|
|
8998
|
+
});
|
|
8999
|
+
}
|
|
9000
|
+
if (closingSequence && paddingBeforeClosingLines !== null && paddingBeforeClosingLines <= 0) context.report({
|
|
9001
|
+
messageId: "expectedPaddingBeforeClosingMarker",
|
|
9002
|
+
loc: getSourceLocationFromRange(sourceCode, node, closingSequence.range),
|
|
9003
|
+
fix(fixer) {
|
|
9004
|
+
return fixer.insertTextBeforeRange([closingSequence.range[0] - closingSequence.loc.start.column + 1, closingSequence.range[1]], "\n");
|
|
9005
|
+
}
|
|
9006
|
+
});
|
|
9007
|
+
} else if (padding === "never") {
|
|
9008
|
+
if (paddingAfterOpeningLines > 0) {
|
|
9009
|
+
const firstChildRange = sourceCode.getRange(firstChild);
|
|
9010
|
+
context.report({
|
|
9011
|
+
messageId: "unexpectedPaddingAfterOpeningMarker",
|
|
9012
|
+
loc: getSourceLocationFromRange(sourceCode, node, [openingSequence.range[1], firstChildRange[0]]),
|
|
9013
|
+
*fix(fixer) {
|
|
9014
|
+
const lines = getParsedLines(sourceCode);
|
|
9015
|
+
for (let lineNumber = openingSequence.loc.end.line + 1; lineNumber < firstChildLoc.start.line; lineNumber++) {
|
|
9016
|
+
const line = lines.get(lineNumber);
|
|
9017
|
+
yield fixer.removeRange(line.range);
|
|
9018
|
+
}
|
|
9019
|
+
}
|
|
9020
|
+
});
|
|
9021
|
+
}
|
|
9022
|
+
if (closingSequence && paddingBeforeClosingLines !== null && paddingBeforeClosingLines > 0) {
|
|
9023
|
+
const lastChildRange = sourceCode.getRange(lastChild);
|
|
9024
|
+
context.report({
|
|
9025
|
+
messageId: "unexpectedPaddingBeforeClosingMarker",
|
|
9026
|
+
loc: getSourceLocationFromRange(sourceCode, node, [lastChildRange[1], closingSequence.range[0]]),
|
|
9027
|
+
*fix(fixer) {
|
|
9028
|
+
const lines = getParsedLines(sourceCode);
|
|
9029
|
+
for (let lineNumber = lastChildLoc.end.line + 1; lineNumber < closingSequence.loc.start.line; lineNumber++) {
|
|
9030
|
+
const line = lines.get(lineNumber);
|
|
9031
|
+
yield fixer.removeRange(line.range);
|
|
9032
|
+
}
|
|
9033
|
+
}
|
|
9034
|
+
});
|
|
9035
|
+
}
|
|
9036
|
+
}
|
|
9037
|
+
} };
|
|
9038
|
+
}
|
|
9039
|
+
});
|
|
9040
|
+
|
|
8925
9041
|
//#endregion
|
|
8926
9042
|
//#region src/rules/padding-line-between-blocks.ts
|
|
8927
9043
|
/**
|
|
@@ -11442,6 +11558,7 @@ const rules$1 = [
|
|
|
11442
11558
|
ordered_list_marker_sequence_default,
|
|
11443
11559
|
ordered_list_marker_start_default,
|
|
11444
11560
|
ordered_list_marker_style_default,
|
|
11561
|
+
padded_custom_containers_default,
|
|
11445
11562
|
padding_line_between_blocks_default,
|
|
11446
11563
|
prefer_autolinks_default,
|
|
11447
11564
|
prefer_fenced_code_blocks_default,
|
|
@@ -11539,6 +11656,7 @@ const rules$2 = {
|
|
|
11539
11656
|
"markdown-preferences/ordered-list-marker-sequence": "error",
|
|
11540
11657
|
"markdown-preferences/ordered-list-marker-start": "error",
|
|
11541
11658
|
"markdown-preferences/ordered-list-marker-style": "error",
|
|
11659
|
+
"markdown-preferences/padded-custom-containers": "error",
|
|
11542
11660
|
"markdown-preferences/padding-line-between-blocks": "error",
|
|
11543
11661
|
"markdown-preferences/prefer-autolinks": "error",
|
|
11544
11662
|
"markdown-preferences/prefer-fenced-code-blocks": "error",
|
|
@@ -11560,7 +11678,7 @@ var meta_exports = /* @__PURE__ */ __export({
|
|
|
11560
11678
|
version: () => version
|
|
11561
11679
|
});
|
|
11562
11680
|
const name = "eslint-plugin-markdown-preferences";
|
|
11563
|
-
const version = "0.
|
|
11681
|
+
const version = "0.29.0";
|
|
11564
11682
|
|
|
11565
11683
|
//#endregion
|
|
11566
11684
|
//#region src/language/extensions/micromark-custom-container.ts
|