mdx-js / eslint-mdx

ESLint Parser/Plugin for MDX
https://npmjs.org/eslint-plugin-mdx
MIT License
259 stars 29 forks source link

preset-prettier integration broken after update of remark-preset-prettier to 2.0.0 #427

Closed enqueue closed 1 year ago

enqueue commented 1 year ago

Initial checklist

Affected packages and versions

eslint-plugin-mdx 2.0.4

Link to runnable example

Not runnable, but easily made runnable: https://github.com/enqueue/eslint-mdx-reproducer

Steps to reproduce

  1. Set up a project with eslint-plugin-mdx and remark-preset-prettier version 2.0.0
  2. Add "preset-prettier" plugin to projects remarkrc
  3. Run eslint .

(Hopefully) minimal reproducible example over here: https://github.com/enqueue/eslint-mdx-reproducer

Node version is 18.9

Expected behavior

MDX and MD files are linted according to rules.

Actual behavior

Error message 0:0 error Parsing error: Cannot find module 'preset-prettier'.

Runtime

Other (please specify in steps to reproduce)

Package manager

npm v8

OS

Linux

Build and bundle tools

No response

Workaround

My current workaround is to pin the dependency of remark-preset-prettier to 1.0.2

JounQin commented 1 year ago

Thanks for reproduction, I'll check soon.

JounQin commented 1 year ago

@enqueue Please use remark-preset-prettier@2.0.1 before next version of eslint-mdx. They fix this issue with different ways.

enqueue commented 1 year ago

@JounQin thanks for the super-fast fix. I wasn't sure in which project this bug report belonged.

JounQin commented 1 year ago

I maintain both eslint-mdx and remark-preset-prettier at the same time.

I wasn't sure in which project this bug report belonged.

It is indeed an issue at eslint-mdx's side, but there could be a workaround from remark-preset-prettier, and that makes itself more compatible.