mdx-js / eslint-mdx

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

Parsing error: Expected value to be truthy #462

Closed vb closed 1 year ago

vb commented 1 year ago

Initial checklist

Affected packages and versions

eslint-plugin-mdx 2.1.0

Link to runnable example

https://github.com/vb/eslint-plugin-mdx-tabs-spaces

Steps to reproduce

Expected behavior

Both mdx files should lint without errors

Actual behavior

eslint throws error on file spaces.mdx

spaces.mdx
  0:0  error  Parsing error: Expected value to be truthy

✖ 1 problem (1 error, 0 warnings)

Runtime

Node v18

Package manager

npm v9

OS

macOS

Build and bundle tools

No response

vb commented 1 year ago

Some additional info: The new version 2.1.0 (and older versions afaik) throws the error Parsing error: Expected value to be truthy when using spaces instead of tabs when passing an object as prop in JSX.

<button 
  style={{
    background: 'red',
    border: '1px solid red',
  }}
>
  Hello
</button>

Minimal reproducible example is available here https://github.com/vb/eslint-plugin-mdx-tabs-spaces

JounQin commented 1 year ago

duplicate of #435

JounQin commented 1 year ago

And I believe you mixed up the two styles 😂

https://github.com/vb/eslint-plugin-mdx-tabs-spaces/blob/main/spaces.mdx?plain=1

This file is using tabs and resulting the error.

vb commented 1 year ago

You're right and sorry for the duplicate! I did not see the other ticket