Commit b6114b4 1 parent 921883a commit b6114b4 Copy full SHA for b6114b4
File tree 15 files changed +270
-2
lines changed
15 files changed +270
-2
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ export const foo = {
9
9
]
10
10
}
11
11
12
+ export const hello = ' hello'
13
+
12
14
# Hello, world!
13
15
14
16
15
17
I'm an awesome paragraph.
16
18
17
- < !-- I'm a comment -->
19
+ { /* I'm a comment */ }
18
20
19
21
<Foo bg = ' red' >
20
22
<Bar >hi </Bar >
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Jane Roe|JFK|314
27
27
+ with a [ link] (/to/somewhere)
28
28
+ and [ another one]
29
29
30
+
30
31
[ another one ] : http://example.com ' Example title '
31
32
32
33
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Original file line number Diff line number Diff line change
1
+ import { Baz } from ' ./Fixture'
2
+
3
+ export const foo = {
4
+ hi: ` Fudge ${Baz .displayName || ' Baz' } ` ,
5
+ authors: [
6
+ ' fred' ,
7
+ ' sally'
8
+ ]
9
+ }
10
+
11
+ export const hello = ' hello'
12
+
13
+ # Hello, world!
14
+
15
+
16
+ I'm an awesome paragraph.
17
+
18
+ { /* I'm a comment */ }
19
+
20
+ <Foo bg = ' red' >
21
+ <Bar >hi </Bar >
22
+ { hello }
23
+ { /* another comment */ }
24
+ </Foo >
25
+
26
+ ```
27
+ test codeblock
28
+ ```
29
+
30
+ ``` js
31
+ module .exports = ' test'
32
+ ```
33
+
34
+ ``` sh
35
+ npm i -g foo
36
+ ```
37
+
38
+ | Test | Table |
39
+ | :--- | :---- |
40
+ | Col1 | Col2 |
41
+
42
+ export default ({children }) => < div >{ children } </div >
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Jane Roe|JFK|314
27
27
+ with a [ link] (/to/somewhere)
28
28
+ and [ another one]
29
29
30
+
30
31
[ another one ] : http://example.com ' Example title '
31
32
32
33
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Original file line number Diff line number Diff line change
1
+ import { Baz } from ' ./Fixture'
2
+
3
+ export const foo = {
4
+ hi: ` Fudge ${Baz .displayName || ' Baz' } ` ,
5
+ authors: [
6
+ ' fred' ,
7
+ ' sally'
8
+ ]
9
+ }
10
+
11
+ export const hello = ' hello'
12
+
13
+ # Hello, world!
14
+
15
+
16
+ I'm an awesome paragraph.
17
+
18
+ { /* I'm a comment */ }
19
+
20
+ <Foo bg = ' red' >
21
+ <Bar >hi </Bar >
22
+ { hello }
23
+ { /* another comment */ }
24
+ </Foo >
25
+
26
+ ```
27
+ test codeblock
28
+ ```
29
+
30
+ ``` js
31
+ module .exports = ' test'
32
+ ```
33
+
34
+ ``` sh
35
+ npm i -g foo
36
+ ```
37
+
38
+ | Test | Table |
39
+ | :--- | :---- |
40
+ | Col1 | Col2 |
41
+
42
+ export default ({children }) => < div >{ children } </div >
Original file line number Diff line number Diff line change
1
+ import { Baz } from ' ./Fixture'
2
+
3
+ export const foo = {
4
+ hi: ` Fudge ${Baz .displayName || ' Baz' } ` ,
5
+ authors: [
6
+ ' fred' ,
7
+ ' sally'
8
+ ]
9
+ }
10
+
11
+ export const hello = ' hello'
12
+
13
+ # Hello, world!
14
+
15
+
16
+ I'm an awesome paragraph.
17
+
18
+ { /* I'm a comment */ }
19
+
20
+ <Foo bg = ' red' >
21
+ <Bar >hi </Bar >
22
+ { hello }
23
+ { /* another comment */ }
24
+ </Foo >
25
+
26
+ ```
27
+ test codeblock
28
+ ```
29
+
30
+ ``` js
31
+ module .exports = ' test'
32
+ ```
33
+
34
+ ``` sh
35
+ npm i -g foo
36
+ ```
37
+
38
+ | Test | Table |
39
+ | :--- | :---- |
40
+ | Col1 | Col2 |
41
+
42
+ export default ({children }) => < div >{ children } </div >
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Jane Roe|JFK|314
27
27
+ with a [ link] (/to/somewhere)
28
28
+ and [ another one]
29
29
30
+
30
31
[ another one ] : http://example.com ' Example title '
31
32
32
33
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Original file line number Diff line number Diff line change
1
+ import { Baz } from ' ./Fixture'
2
+
3
+ export const foo = {
4
+ hi: ` Fudge ${Baz .displayName || ' Baz' } ` ,
5
+ authors: [
6
+ ' fred' ,
7
+ ' sally'
8
+ ]
9
+ }
10
+
11
+ export const hello = ' hello'
12
+
13
+ # Hello, world!
14
+
15
+
16
+ I'm an awesome paragraph.
17
+
18
+ { /* I'm a comment */ }
19
+
20
+ <Foo bg = ' red' >
21
+ <Bar >hi </Bar >
22
+ { hello }
23
+ { /* another comment */ }
24
+ </Foo >
25
+
26
+ ```
27
+ test codeblock
28
+ ```
29
+
30
+ ``` js
31
+ module .exports = " test"
32
+ ```
33
+
34
+ ``` sh
35
+ npm i -g foo
36
+ ```
37
+
38
+ | Test | Table |
39
+ | :--- | :---- |
40
+ | Col1 | Col2 |
41
+
42
+ export default ({children }) => < div >{ children } </div >
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Jane Roe|JFK|314
27
27
+ with a [ link] (/to/somewhere)
28
28
+ and [ another one]
29
29
30
+
30
31
[ another one ] : http://example.com ' Example title '
31
32
32
33
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Original file line number Diff line number Diff line change
1
+ import { Baz } from ' ./Fixture'
2
+
3
+ export const foo = {
4
+ hi: ` Fudge ${Baz .displayName || ' Baz' } ` ,
5
+ authors: [
6
+ ' fred' ,
7
+ ' sally'
8
+ ]
9
+ }
10
+
11
+ export const hello = ' hello'
12
+
13
+ # Hello, world!
14
+
15
+
16
+ I'm an awesome paragraph.
17
+
18
+ { /* I'm a comment */ }
19
+
20
+ <Foo bg = ' red' >
21
+ <Bar >hi </Bar >
22
+ { hello }
23
+ { /* another comment */ }
24
+ </Foo >
25
+
26
+ ```
27
+ test codeblock
28
+ ```
29
+
30
+ ``` js
31
+ module .exports = ' test'
32
+ ```
33
+
34
+ ``` sh
35
+ npm i -g foo
36
+ ```
37
+
38
+ | Test | Table |
39
+ | :--- | :---- |
40
+ | Col1 | Col2 |
41
+
42
+ export default ({children }) => < div >{ children } </div >
Original file line number Diff line number Diff line change
1
+ import { Baz } from ' ./Fixture'
2
+
3
+ export const foo = {
4
+ hi: ` Fudge ${Baz .displayName || ' Baz' } ` ,
5
+ authors: [
6
+ ' fred' ,
7
+ ' sally'
8
+ ]
9
+ }
10
+
11
+ export const hello = ' hello'
12
+
13
+ # Hello, world!
14
+
15
+ I'm an awesome paragraph.
16
+
17
+ { /* I'm a comment */ }
18
+
19
+ <Foo bg = ' red' >
20
+ <Bar >hi </Bar >
21
+ { hello }
22
+ { /* another comment */ }
23
+ </Foo >
24
+
25
+ ```
26
+ test codeblock
27
+ ```
28
+
29
+ ``` js
30
+ module .exports = ' test'
31
+ ```
32
+
33
+ ``` sh
34
+ npm i -g foo
35
+ ```
36
+
37
+ | Test | Table |
38
+ | :--- | :---- |
39
+ | Col1 | Col2 |
40
+
41
+ export default ({children }) => < div >{ children } </div >
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { StylisticConfigDefaults } from './stylistic'
8
8
export async function formatters (
9
9
options : OptionsFormatters | true = { } ,
10
10
stylistic : StylisticConfig = { } ,
11
+ markdownParserEnabled = true ,
11
12
) : Promise < FlatConfigItem [ ] > {
12
13
await ensurePackages ( [
13
14
'eslint-plugin-format' ,
@@ -143,6 +144,9 @@ export async function formatters(
143
144
144
145
configs . push ( {
145
146
files : [ GLOB_MARKDOWN ] ,
147
+ languageOptions : markdownParserEnabled
148
+ ? { }
149
+ : { parser : parserPlain } ,
146
150
name : 'antfu:formatter:markdown' ,
147
151
rules : {
148
152
[ `format/${ formatter } ` ] : [
@@ -165,6 +169,9 @@ export async function formatters(
165
169
if ( options . mdx ) {
166
170
configs . push ( {
167
171
files : [ GLOB_MDX ] ,
172
+ languageOptions : markdownParserEnabled
173
+ ? { }
174
+ : { parser : parserPlain } ,
168
175
name : 'antfu:formatter:mdx' ,
169
176
rules : {
170
177
'format/prettier' : [
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ export async function markdown(
33
33
rules : {
34
34
'mdx/remark' : 'warn' ,
35
35
'no-unused-expressions' : 'error' ,
36
- 'style/indent' : 'off' ,
37
36
} ,
38
37
} ,
39
38
{
Original file line number Diff line number Diff line change
1
+ import { GLOB_MARKDOWN_OR_MDX } from '../globs'
1
2
import { interopDefault } from '../utils'
2
3
import type { FlatConfigItem , StylisticConfig } from '../types'
3
4
import { pluginAntfu } from '../plugins'
@@ -33,6 +34,9 @@ export async function stylistic(options: StylisticConfig = {}): Promise<FlatConf
33
34
34
35
return [
35
36
{
37
+ ignores : [
38
+ GLOB_MARKDOWN_OR_MDX ,
39
+ ] ,
36
40
name : 'antfu:stylistic' ,
37
41
plugins : {
38
42
antfu : pluginAntfu ,
Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ export async function antfu(
191
191
configs . push ( formatters (
192
192
options . formatters ,
193
193
typeof stylisticOptions === 'boolean' ? { } : stylisticOptions ,
194
+ options . markdown !== false ,
194
195
) )
195
196
}
196
197
You can’t perform that action at this time.
0 commit comments