Update MD060/table-column-style to add aligned_delimiter parameter (fixes #1854).

This commit is contained in:
David Anson 2025-11-30 16:39:56 -08:00
parent 8e974f95d5
commit f6c5369ef4
14 changed files with 648 additions and 32 deletions

View file

@ -1101,7 +1101,7 @@ test("readme", async(t) => {
});
test("validateJsonUsingConfigSchemaStrict", async(t) => {
t.plan(221);
t.plan(222);
// @ts-ignore
const ajv = new Ajv(ajvOptions);
const validateSchemaStrict = ajv.compile(configSchemaStrict);

View file

@ -62068,6 +62068,349 @@ Generated by [AVA](https://avajs.dev).
`,
}
## table-column-style-aligned-delimiter.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
5,
1,
],
fixInfo: null,
lineNumber: 28,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
9,
1,
],
fixInfo: null,
lineNumber: 28,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
13,
1,
],
fixInfo: null,
lineNumber: 28,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
22,
1,
],
fixInfo: null,
lineNumber: 36,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
4,
1,
],
fixInfo: null,
lineNumber: 50,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
20,
1,
],
fixInfo: null,
lineNumber: 58,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
3,
1,
],
fixInfo: null,
lineNumber: 72,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
5,
1,
],
fixInfo: null,
lineNumber: 72,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
7,
1,
],
fixInfo: null,
lineNumber: 72,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
18,
1,
],
fixInfo: null,
lineNumber: 80,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
2,
1,
],
fixInfo: null,
lineNumber: 94,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
4,
1,
],
fixInfo: null,
lineNumber: 94,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with heading for option "aligned_delimiter"',
errorRange: [
17,
1,
],
fixInfo: null,
lineNumber: 102,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
],
fixed: `# Table Column Style - Aligned Delimiter␊
## Aligned / Edge Pipes␊
| Heading | Heading | Heading |␊
| ------- | --------- | ------- |␊
| Text | Text text | Text |␊
| Text | Text text | Text |␊
| Text | Text text | Text |␊
## Aligned / No Edge Pipes␊
Heading | Heading | Heading␊
------- | --------- | -------␊
Text | Text text | Text␊
Text | Text text | Text␊
Text | Text text | Text␊
## Compact / Edge Pipes␊
| Heading | Heading | Heading |␊
| ------- | ------- | ------- |␊
| Text | Text text | Text |␊
| Text text | Text text text | Text |␊
| Text | Text | Text |␊
| Heading | Heading | Heading |␊
| - | - | - |␊
| Text | Text text | Text |␊
| Text text | Text text text | Text |␊
| Text | Text | Text |␊
{MD060:-5}␊
| Heading | Heading | Heading |␊
| ------- | -------- | ------ |␊
| Text text | Text text text | Text |␊
{MD060:-3}␊
## Compact / No Edge Pipes␊
Heading | Heading | Heading␊
------- | ------- | -------␊
Text | Text text | Text␊
Text text | Text text text | Text␊
Text | Text | Text␊
Heading | Heading | Heading␊
-- | -- | --␊
Text | Text text | Text␊
Text text | Text text text | Text␊
Text | Text | Text␊
{MD060:-5}␊
Heading | Heading | Heading␊
------- | -------- | ------␊
Text text | Text text text | Text␊
{MD060:-3}␊
## Tight / Edge Pipes␊
|Heading|Heading|Heading|␊
|-------|-------|-------|␊
|Text|Text text|Text|␊
|Text text|Text text text|Text|␊
|Text|Text|Text|␊
|Heading|Heading|Heading|␊
|-|-|-|␊
|Text|Text text|Text|␊
|Text text|Text text text|Text|␊
|Text|Text|Text|␊
{MD060:-5}␊
|Heading|Heading|Heading|␊
|-------|--------|------|␊
|Text text|Text text text|Text|␊
{MD060:-3}␊
## Tight / No Edge Pipes␊
Heading|Heading|Heading␊
-------|-------|-------␊
Text|Text text|Text␊
Text text|Text text text|Text␊
Text|Text|Text␊
Heading|Heading|Heading␊
-|-|-␊
Text|Text text|Text␊
Text text|Text text text|Text␊
Text|Text|Text␊
{MD060:-5}␊
Heading|Heading|Heading␊
-------|--------|------␊
Text text|Text text text|Text␊
{MD060:-3}␊
<!-- markdownlint-configure-file {␊
"table-column-style": {␊
"aligned_delimiter": true␊
},␊
"table-pipe-style": false␊
} -->␊
`,
}
## table-column-style-aligned.md
> Snapshot 1

View file

@ -0,0 +1,112 @@
# Table Column Style - Aligned Delimiter
## Aligned / Edge Pipes
| Heading | Heading | Heading |
| ------- | --------- | ------- |
| Text | Text text | Text |
| Text | Text text | Text |
| Text | Text text | Text |
## Aligned / No Edge Pipes
Heading | Heading | Heading
------- | --------- | -------
Text | Text text | Text
Text | Text text | Text
Text | Text text | Text
## Compact / Edge Pipes
| Heading | Heading | Heading |
| ------- | ------- | ------- |
| Text | Text text | Text |
| Text text | Text text text | Text |
| Text | Text | Text |
| Heading | Heading | Heading |
| - | - | - |
| Text | Text text | Text |
| Text text | Text text text | Text |
| Text | Text | Text |
{MD060:-5}
| Heading | Heading | Heading |
| ------- | -------- | ------ |
| Text text | Text text text | Text |
{MD060:-3}
## Compact / No Edge Pipes
Heading | Heading | Heading
------- | ------- | -------
Text | Text text | Text
Text text | Text text text | Text
Text | Text | Text
Heading | Heading | Heading
-- | -- | --
Text | Text text | Text
Text text | Text text text | Text
Text | Text | Text
{MD060:-5}
Heading | Heading | Heading
------- | -------- | ------
Text text | Text text text | Text
{MD060:-3}
## Tight / Edge Pipes
|Heading|Heading|Heading|
|-------|-------|-------|
|Text|Text text|Text|
|Text text|Text text text|Text|
|Text|Text|Text|
|Heading|Heading|Heading|
|-|-|-|
|Text|Text text|Text|
|Text text|Text text text|Text|
|Text|Text|Text|
{MD060:-5}
|Heading|Heading|Heading|
|-------|--------|------|
|Text text|Text text text|Text|
{MD060:-3}
## Tight / No Edge Pipes
Heading|Heading|Heading
-------|-------|-------
Text|Text text|Text
Text text|Text text text|Text
Text|Text|Text
Heading|Heading|Heading
-|-|-
Text|Text text|Text
Text text|Text text text|Text
Text|Text|Text
{MD060:-5}
Heading|Heading|Heading
-------|--------|------
Text text|Text text text|Text
{MD060:-3}
<!-- markdownlint-configure-file {
"table-column-style": {
"aligned_delimiter": true
},
"table-pipe-style": false
} -->