Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing error: Expected value to be truthy #420

Closed
4 tasks done
tmpduarte opened this issue Aug 31, 2022 · 11 comments
Closed
4 tasks done

Parsing error: Expected value to be truthy #420

tmpduarte opened this issue Aug 31, 2022 · 11 comments
Labels
🙋 no/question This does not need any changes

Comments

@tmpduarte
Copy link

Initial checklist

Affected packages and versions

2.0.2

Link to runnable example

https://github.com/tmpduarte/eslint-mdx-visit-issue/tree/issue/expected-value-to-be-truthy

Steps to reproduce

Minimal Example

Minimal repository producing this issue with a fresh Vite / TypeScript / React / Storybook / MUI project.

Steps taken
Forked this repository, added the setup needed to use MUI and updated the eslint-mdx to the latest version.

kudos to @sudosilico for the setup 🙏

Expected behavior

.mdx file should should be linted without parsing errors.

Actual behavior

$ yarn lint
yarn run v1.22.15
$ eslint --ext .ts,.tsx,.js,.jsx,.mdx src

/workspaces/eslint-mdx-visit-issue/src/stories/Button.stories.mdx
  0:0  error  Parsing error: Expected value to be truthy

✖ 1 problem (1 error, 0 warnings)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Runtime

Node v16

Package manager

yarn v1

OS

macOS

Build and bundle tools

Vite

@JounQin
Copy link
Member

JounQin commented Aug 31, 2022

Thanks for reproduction, I'll check later.

@JounQin
Copy link
Member

JounQin commented Aug 31, 2022

@JounQin JounQin closed this as completed Aug 31, 2022
@JounQin JounQin added the 🙋 no/question This does not need any changes label Aug 31, 2022
@JounQin
Copy link
Member

JounQin commented Aug 31, 2022

@wooorm Do you have any idea that how can we ensure same acorn and acorn-jsx versions between eslint-mdx vs micromark-extension-mdxjs? Will an optional peer dependency declaration of micromark-extension-mdxjs work?

Because acorn.tokTypes and acornJsx.tokTypes are different between versions.

@JounQin JounQin pinned this issue Aug 31, 2022
@wooorm
Copy link
Member

wooorm commented Sep 1, 2022

micromark-extension-mdxjs takes acorn as an instance: https://github.com/micromark/micromark-extension-mdxjs#optionsacorn. You can pass an instance of the version you use.

@JounQin
Copy link
Member

JounQin commented Sep 1, 2022

@wooorm If I didn't remember wrong, micromark-extension-mdxjs is referenced from remark-mdx, but remark-mdx doesn't provide an acorn/acornJsx options.

@wooorm
Copy link
Member

wooorm commented Sep 1, 2022

@JounQin
Copy link
Member

JounQin commented Sep 1, 2022

OK then, I think I can give it a try tonight. Thanks!

@tmpduarte
Copy link
Author

@JounQin thank you very much for taking a look a this 🙏

There might have been a confusion.
The link I posted on the description is for a specific branch that has the version 2.0.2 as well as the MUI button in the storybook story, and that's where the problem happens.

The main branch, used to replicate the problem actually has not problem at all. Sorry for the confusion 🙏

@TxHawks
Copy link

TxHawks commented Sep 4, 2022

I'm also getting this with version 2.0.3, node v16.13.2 and pnpm v7.9.5

@JounQin
Copy link
Member

JounQin commented Sep 4, 2022

I'm also getting this with version 2.0.3, node v16.13.2 and pnpm v7.9.5

Please provide a minimal but runnable reproduction in a new issue then.

@jvdl
Copy link

jvdl commented Sep 13, 2022

I've opened up #429 as a continuation of this issue with a repro / failing test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes
Development

No branches or pull requests

5 participants