Skip to content

Commit

Permalink
test: add test case for .md files
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Dec 21, 2023
1 parent ed4ff97 commit 78057a2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions test/fixtures/md.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Heading

```ts
export declare const x = 1
```
22 changes: 21 additions & 1 deletion test/prettier.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const eslint = new ESLint({
extends: 'plugin:prettier/recommended',
overrides: [
{
files: '*.mdx',
files: ['*.{md,mdx}'],
extends: 'plugin:mdx/recommended',
settings: {
'mdx/code-block': true,
Expand Down Expand Up @@ -228,6 +228,26 @@ mdxRuleTester.run('eslint-plugin-mdx', rule, {
],
});

runFixture('*.md', [
[
{
column: 27,
endColumn: 27,
endLine: 4,
fix: {
range: [43, 43],
text: ';',
},
line: 4,
message: 'Insert `;`',
messageId: 'insert',
nodeType: null,
ruleId: 'prettier/prettier',
severity: 2,
},
],
]);

runFixture('*.mdx', [
[
{
Expand Down

0 comments on commit 78057a2

Please sign in to comment.