Skip to content

Does not check nested code blocks (only lints top-level code blocks) #470

Open
@calebeby

Description

@calebeby

Initial checklist

Affected packages and versions

I am using eslint-plugin-mdx 2.2.0, eslint-mdx 2.2.0

Link to runnable example

https://stackblitz.com/edit/github-nxeabp?file=testcase.mdx

Steps to reproduce

Here is my mdx file that I am linting:

<main>
  ```js
  im_not_camel_case_oops
  ```
</main>

```js
im_not_camel_case_oops
```

ESLint only runs on the top-level code block. The code block inside the <main> element is ignored.

Screenshot 2023-08-15 at 7 38 56 PM

Expected behavior

It should lint both code blocks. I have mdx/code-blocks set to true.

Actual behavior

It only lints the top-level code block

Runtime

Node v18

Package manager

npm v9

OS

macOS

Build and bundle tools

Other (please specify in steps to reproduce)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions