File tree 6 files changed +77
-40
lines changed
6 files changed +77
-40
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ node_modules/
4
4
* .log
5
5
.DS_Store
6
6
yarn.lock
7
+ ! /index.d.ts
Original file line number Diff line number Diff line change
1
+ import type { Options as MdxExpressionOptions } from 'micromark-extension-mdx-expression'
2
+
3
+ export { mdxjs } from './lib/index.js'
4
+
5
+ /**
6
+ * Configuration for `mdxjs` of `micromark-extension-mdxjs`.
7
+ */
8
+ export interface Options extends MdxExpressionOptions { }
Original file line number Diff line number Diff line change 1
- /**
2
- * @typedef {import('micromark-extension-mdx-expression').Options } Options
3
- * @typedef {import('micromark-util-types').Extension } Extension
4
- */
5
-
6
- import { Parser } from 'acorn'
7
- import acornJsx from 'acorn-jsx'
8
- import { mdxExpression } from 'micromark-extension-mdx-expression'
9
- import { mdxJsx } from 'micromark-extension-mdx-jsx'
10
- import { mdxMd } from 'micromark-extension-mdx-md'
11
- import { mdxjsEsm } from 'micromark-extension-mdxjs-esm'
12
- import { combineExtensions } from 'micromark-util-combine-extensions'
13
-
14
- /**
15
- * Create an extension for `micromark` to enable MDX syntax.
16
- *
17
- * @param {Options | null | undefined } [options]
18
- * Configuration (optional).
19
- * @returns {Extension }
20
- * Extension for `micromark` that can be passed in `extensions` to enable MDX
21
- * syntax.
22
- */
23
- export function mdxjs ( options ) {
24
- const settings = Object . assign (
25
- {
26
- acorn : Parser . extend ( acornJsx ( ) ) ,
27
- acornOptions : { ecmaVersion : 2024 , sourceType : 'module' } ,
28
- addResult : true
29
- } ,
30
- options
31
- )
32
-
33
- return combineExtensions ( [
34
- mdxjsEsm ( settings ) ,
35
- mdxExpression ( settings ) ,
36
- mdxJsx ( settings ) ,
37
- mdxMd ( )
38
- ] )
39
- }
1
+ // Note: types exposed from `index.d.ts`.
2
+ export { mdxjs } from './lib/index.js'
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @import {Options} from 'micromark-extension-mdxjs'
3
+ * @import {Extension} from 'micromark-util-types'
4
+ */
5
+
6
+ import { Parser } from 'acorn'
7
+ import acornJsx from 'acorn-jsx'
8
+ import { mdxExpression } from 'micromark-extension-mdx-expression'
9
+ import { mdxJsx } from 'micromark-extension-mdx-jsx'
10
+ import { mdxMd } from 'micromark-extension-mdx-md'
11
+ import { mdxjsEsm } from 'micromark-extension-mdxjs-esm'
12
+ import { combineExtensions } from 'micromark-util-combine-extensions'
13
+
14
+ /**
15
+ * Create an extension for `micromark` to enable MDX syntax.
16
+ *
17
+ * @param {Options | null | undefined } [options]
18
+ * Configuration (optional).
19
+ * @returns {Extension }
20
+ * Extension for `micromark` that can be passed in `extensions` to enable MDX
21
+ * syntax.
22
+ */
23
+ export function mdxjs ( options ) {
24
+ const settings = Object . assign (
25
+ {
26
+ acorn : Parser . extend ( acornJsx ( ) ) ,
27
+ acornOptions : { ecmaVersion : 2024 , sourceType : 'module' } ,
28
+ addResult : true
29
+ } ,
30
+ options
31
+ )
32
+
33
+ return combineExtensions ( [
34
+ mdxjsEsm ( settings ) ,
35
+ mdxExpression ( settings ) ,
36
+ mdxJsx ( settings ) ,
37
+ mdxMd ( )
38
+ ] )
39
+ }
Original file line number Diff line number Diff line change 28
28
"type" : " module" ,
29
29
"exports" : " ./index.js" ,
30
30
"files" : [
31
+ " lib/" ,
31
32
" index.d.ts" ,
32
33
" index.js"
33
34
],
82
83
"strict" : true
83
84
},
84
85
"xo" : {
86
+ "overrides" : [
87
+ {
88
+ "files" : [
89
+ " **/*.d.ts"
90
+ ],
91
+ "rules" : {
92
+ "@typescript-eslint/array-type" : [
93
+ " error" ,
94
+ {
95
+ "default" : " generic"
96
+ }
97
+ ],
98
+ "@typescript-eslint/ban-types" : [
99
+ " error" ,
100
+ {
101
+ "extendDefaults" : true
102
+ }
103
+ ],
104
+ "@typescript-eslint/consistent-type-definitions" : [
105
+ " error" ,
106
+ " interface"
107
+ ]
108
+ }
109
+ }
110
+ ],
85
111
"prettier" : true
86
112
}
87
113
}
Original file line number Diff line number Diff line change 11
11
"target" : " es2022"
12
12
},
13
13
"exclude" : [" coverage/" , " node_modules/" ],
14
- "include" : [" **/*.js" ]
14
+ "include" : [" **/*.js" , " index.d.ts " ]
15
15
}
You can’t perform that action at this time.
0 commit comments