Skip to content

ESLint Config inspector fails to load with eslint-plugin-mdx #598

@Simek

Description

@Simek

Initial checklist

Affected package

eslint-plugin-mdx

Steps to reproduce

  1. Check out https://github.com/facebook/react-native-website.
  2. Run npx eslint --inspect-config at the root to see the failure.
  3. Comment out eslint-plugin-mdx import and its usages in eslint.config.js:
    import * as eslintPluginMdx from 'eslint-plugin-mdx';
    
    [...]
    
    ...eslintPluginMdx.flat,
    processor: eslintPluginMdx.createRemarkProcessor({
      lintCodeBlocks: false,
      remarkConfigPath: 'website/.remarkrc.mjs',
    }),
  4. Re-run npx eslint --inspect-config, it should work now.

Refs:

Actual behavior

ESLint Inspect Config tool fails to load the config which use eslint-plugin-mdx:

Failed to load eslint.config.js
Error: Could not find ESLint Linter in require cache
    at file:///W:/GitHub/react-native-website/node_modules/eslint-plugin-mdx/lib/processors/options.js:5:11
    at ModuleJob.run (node:internal/modules/esm/module_job:377:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:671:26)
    at async extractResult (file:///C:/Users/Simek/AppData/Local/npm-cache/_npx/fadb285f08a830ab/node_modules/bundle-require/dist/index.js:169:15)
    at async run (file:///C:/Users/Simek/AppData/Local/npm-cache/_npx/fadb285f08a830ab/node_modules/bundle-require/dist/index.js:211:17)

I look like the require cache check is a the root of the issue:

Expected behavior

ESLint Inspect Config should be able to load the config, and start correctly.

Runtime

[email protected] and [email protected]

Package manager

[email protected]

Operating system

OS agnostic (tested on macOS and Windows)

Build and bundle tools

Docusaurus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions