File tree Expand file tree Collapse file tree 4 files changed +17
-4
lines changed
packages/eslint-plugin-mdx/src Expand file tree Collapse file tree 4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " eslint-plugin-mdx " : patch
3
+ ---
4
+
5
+ fix: set ` processor ` for flat config
Original file line number Diff line number Diff line change
1
+ ---
2
+ " eslint-plugin-mdx " : patch
3
+ ---
4
+
5
+ fix: prefer ` context.languageOptions.parserOptions ` over ` context.parserOptions `
Original file line number Diff line number Diff line change @@ -2,15 +2,14 @@ import type { Linter } from 'eslint'
2
2
import * as eslintMdx from 'eslint-mdx'
3
3
4
4
import * as mdx from '../index.js'
5
+ import { remark } from '../processors/remark.js'
5
6
6
7
import { codeBlocks } from './code-blocks.js'
7
8
8
9
// eslint-disable-next-line sonarjs/deprecation
9
10
export const flat : Linter . FlatConfig = {
10
11
files : [ '**/*.{md,mdx}' ] ,
11
12
languageOptions : {
12
- sourceType : 'module' ,
13
- ecmaVersion : 'latest' ,
14
13
parser : eslintMdx ,
15
14
globals : {
16
15
React : false ,
@@ -19,6 +18,7 @@ export const flat: Linter.FlatConfig = {
19
18
plugins : {
20
19
mdx,
21
20
} ,
21
+ processor : remark ,
22
22
rules : {
23
23
'mdx/remark' : 'warn' ,
24
24
'no-unused-expressions' : 'error' ,
Original file line number Diff line number Diff line change @@ -28,14 +28,17 @@ export const remark: Rule.RuleModule = {
28
28
// eslint-disable-next-line sonarjs/deprecation -- FIXME: ESLint 8.40+ required
29
29
const sourceCode = context . getSourceCode ( )
30
30
31
+ /* istanbul ignore next */
31
32
const {
32
33
extensions,
33
34
markdownExtensions,
34
35
ignoreRemarkConfig,
35
36
remarkConfigPath,
36
- } =
37
+ } = {
37
38
// eslint-disable-next-line sonarjs/deprecation -- FIXME: ESLint 8.40+ required
38
- context . parserOptions as ParserOptions
39
+ ...context . parserOptions ,
40
+ ...context . languageOptions ?. parserOptions ,
41
+ } as ParserOptions
39
42
40
43
const isMdx = [ ...DEFAULT_EXTENSIONS , ...( extensions || [ ] ) ] . includes (
41
44
extname ,
You can’t perform that action at this time.
0 commit comments