File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
packages/eslint-plugin-mdx/src/rules Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -75,12 +75,17 @@ export const getRemarkProcessor = (searchFrom: string, isMdx: boolean) => {
75
75
const { plugins = [ ] , settings } = ( result ?. config ||
76
76
{ } ) as Partial < RemarkConfig >
77
77
78
- try {
79
- // disable this rule automatically since we already have a parser option `extensions`
80
- // eslint-disable-next-line node/no-extraneous-require
81
- plugins . push ( [ require . resolve ( 'remark-lint-file-extension' ) , false ] )
82
- } catch {
83
- // just ignore if the package does not exist
78
+ // disable this rule automatically since we already have a parser option `extensions`
79
+ // only disable this plugin if there are at least one plugin enabled
80
+ // otherwise `result` could be null inside `plugins.reduce`
81
+ /* istanbul ignore else */
82
+ if ( plugins . length > 0 ) {
83
+ try {
84
+ // eslint-disable-next-line node/no-extraneous-require
85
+ plugins . push ( [ require . resolve ( 'remark-lint-file-extension' ) , false ] )
86
+ } catch {
87
+ // just ignore if the package does not exist
88
+ }
84
89
}
85
90
86
91
const initProcessor = remarkProcessor ( ) . use ( { settings } ) . use ( remarkStringify )
You can’t perform that action at this time.
0 commit comments