You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[`require-alt-text`](./docs/rules/require-alt-text.md)| Require alternative text for images | yes |
108
-
|[`table-column-count`](./docs/rules/table-column-count.md)| Disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row | yes |
|[`require-alt-text`](./docs/rules/require-alt-text.md)| Require alternative text for images | yes |
109
+
|[`table-column-count`](./docs/rules/table-column-count.md)| Disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row | yes |
110
+
109
111
<!-- Rule Table End -->
110
112
111
113
**Note:** This plugin does not provide formatting rules. We recommend using a source code formatter such as [Prettier](https://prettier.io) for that purpose.
@@ -118,21 +120,22 @@ import { defineConfig } from "eslint/config";
118
120
importmarkdownfrom"@eslint/markdown";
119
121
120
122
exportdefaultdefineConfig([
121
-
{
122
-
files: ["**/*.md"],
123
-
plugins: {
124
-
markdown
125
-
},
126
-
language:"markdown/commonmark",
127
-
rules: {
128
-
"markdown/no-html":"error"
129
-
}
130
-
}
123
+
{
124
+
files: ["**/*.md"],
125
+
plugins: {
126
+
markdown,
127
+
},
128
+
language:"markdown/commonmark",
129
+
rules: {
130
+
"markdown/no-html":"error",
131
+
},
132
+
},
131
133
]);
132
134
```
133
135
134
136
You can individually disable rules in Markdown using HTML comments, such as:
135
137
138
+
<!-- prettier-ignore-start -->
136
139
```markdown
137
140
<!-- eslint-disable-next-line markdown/no-html -- I want to allow HTML here -->
138
141
<custom-element>Hello world!</custom-element>
@@ -143,13 +146,14 @@ You can individually disable rules in Markdown using HTML comments, such as:
143
146
144
147
[Object] <!-- eslint-disable-line markdown/no-missing-label-refs -- not meant to be a link ref -->
145
148
```
149
+
<!-- prettier-ignore-end -->
146
150
147
151
### Languages
148
152
149
-
|**Language Name**|**Description**|
150
-
|---------------|-----------------|
151
-
|`commonmark`| Parse using [CommonMark](https://commonmark.org) Markdown format |
152
-
|`gfm`| Parse using [GitHub-Flavored Markdown](https://github.github.com/gfm/) format |
|`commonmark`| Parse using [CommonMark](https://commonmark.org) Markdown format |
156
+
|`gfm`| Parse using [GitHub-Flavored Markdown](https://github.github.com/gfm/) format |
153
157
154
158
In order to individually configure a language in your `eslint.config.js` file, import `@eslint/markdown` and configure a `language`:
155
159
@@ -159,29 +163,29 @@ import { defineConfig } from "eslint/config";
159
163
importmarkdownfrom"@eslint/markdown";
160
164
161
165
exportdefaultdefineConfig([
162
-
{
163
-
files: ["**/*.md"],
164
-
plugins: {
165
-
markdown
166
-
},
167
-
language:"markdown/gfm",
168
-
rules: {
169
-
"markdown/no-html":"error"
170
-
}
171
-
}
166
+
{
167
+
files: ["**/*.md"],
168
+
plugins: {
169
+
markdown,
170
+
},
171
+
language:"markdown/gfm",
172
+
rules: {
173
+
"markdown/no-html":"error",
174
+
},
175
+
},
172
176
]);
173
177
```
174
178
175
179
### Language Options
176
180
177
181
#### Enabling Front Matter in both `commonmark` and `gfm`
178
182
179
-
By default, Markdown parsers do not support [front matter](https://jekyllrb.com/docs/front-matter/). To enable front matter in both `commonmark` and `gfm`, you can use the `frontmatter` option in `languageOptions`.
183
+
By default, Markdown parsers do not support [front matter](https://jekyllrb.com/docs/front-matter/). To enable front matter in both `commonmark` and `gfm`, you can use the `frontmatter` option in `languageOptions`.
180
184
181
185
> `@eslint/markdown` internally uses [`micromark-extension-frontmatter`](https://github.com/micromark/micromark-extension-frontmatter) and [`mdast-util-frontmatter`](https://github.com/syntax-tree/mdast-util-frontmatter) to parse front matter.
0 commit comments