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'
22import * as eslintMdx from 'eslint-mdx'
33
44import * as mdx from '../index.js'
5+ import { remark } from '../processors/remark.js'
56
67import { codeBlocks } from './code-blocks.js'
78
89// eslint-disable-next-line sonarjs/deprecation
910export const flat : Linter . FlatConfig = {
1011 files : [ '**/*.{md,mdx}' ] ,
1112 languageOptions : {
12- sourceType : 'module' ,
13- ecmaVersion : 'latest' ,
1413 parser : eslintMdx ,
1514 globals : {
1615 React : false ,
@@ -19,6 +18,7 @@ export const flat: Linter.FlatConfig = {
1918 plugins : {
2019 mdx,
2120 } ,
21+ processor : remark ,
2222 rules : {
2323 'mdx/remark' : 'warn' ,
2424 'no-unused-expressions' : 'error' ,
Original file line number Diff line number Diff line change @@ -28,14 +28,17 @@ export const remark: Rule.RuleModule = {
2828 // eslint-disable-next-line sonarjs/deprecation -- FIXME: ESLint 8.40+ required
2929 const sourceCode = context . getSourceCode ( )
3030
31+ /* istanbul ignore next */
3132 const {
3233 extensions,
3334 markdownExtensions,
3435 ignoreRemarkConfig,
3536 remarkConfigPath,
36- } =
37+ } = {
3738 // 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
3942
4043 const isMdx = [ ...DEFAULT_EXTENSIONS , ...( extensions || [ ] ) ] . includes (
4144 extname ,
You can’t perform that action at this time.
0 commit comments