Parsing error: Expected value to be truthy
See original GitHub issueInitial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
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
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:11 (8 by maintainers)
Top Results From Across the Web
typescript-eslint strict-boolean-expressions check for falsy value
The strict-boolean-types rule "Forbids usage of non-boolean types in expressions where a boolean is expected", so it should complain about the ...
Read more >Troubleshooting MDX
The reason for this error is that the parser is expecting a single JavaScript expression yielding one value. If you just want braces...
Read more >toBeTruthy() - Grafana k6
toBeTruthy () is a comparison function that evaluates to true or false. It must be called in the chain after the t.expect(value) or...
Read more >Truthy - MDN Web Docs Glossary: Definitions of Web-related ...
In JavaScript, a truthy value is a value that is considered true when encountered in a Boolean context. All values are truthy unless...
Read more >Express body-parser middleware
If a function, the type option is called as fn(req) and the request is parsed if it returns a truthy value. Defaults to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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 🙏
I’m also getting this with version 2.0.3, node v16.13.2 and pnpm v7.9.5