question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing error: Expected value to be truthy

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
tmpduartecommented, Sep 1, 2022

@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 🙏

1reaction
TxHawkscommented, Sep 4, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found