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.

React components in MDX files are not ignored

See original GitHub issue

Info

Kind of Issue

  • runtime - command-line tools

Which Tool or library

  • cspell – the command-line spelling tool

Which Version

Version: the one bundled in the latest scode-spell-checker extension.

Issue with supporting library?

  • No

OS:

  • Macos

version:

Latest Monterey

Bug Description

Describe the bug

The documentation seems to imply the MDX format is supported, but cspell seems to spell-check React components, even though it ignores HTML elements. Both are programmatic structures, not natural language.

My rationale here is that React components and HTML elements can and do co-exist inside the same MDX or JSX file, yet HTML elements are never spell-checked. I understand you mileage may vary here. An option to ignore React components would be great too. Thank you.

To Reproduce

Steps to reproduce the behavior:

I created a .MDX file with the contents shown in the screenshot below. Pretty much one line of text and a random React component.

Expected behavior

React components should/could be ignored.

Screenshots

image

Thank you for your time

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Jason3Scommented, Mar 6, 2022

@sebastienbarre,

Work is currently underway to support parsers as well as an ESLint plugin. The first step will most likely be done as an ESLint plugin, since ESLint will be doing the parsing and then sending the elements of the AST to the spell checker. At a later stage, a more generic solution will be supported.

For your immediate need, you can use directives in the file to ignore things like plaiceholder.

Just include it as a comment :

// cspell:ignore plaiceholder
0reactions
github-actions[bot]commented, May 7, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The components prop on MDX components seems to be ...
bug report MDX elements accept a components prop, which is a mapping of HTML tag names to React components. ... Here's the mdx...
Read more >
React components and math expressions in .mdx file are not ...
My custom React components when imported in a .mdx file, are not being rendered at all. The math expressions in the .mdx file...
Read more >
Troubleshooting Common Errors - Gatsby
You may see this error because you're attempting to use fs inside a React component. Additionally, it often shows up when working with...
Read more >
Getting started - MDX
This article explains how to integrate MDX into your project. It shows how to use MDX with your bundler and JSX runtime of...
Read more >
Project Configuration - Docz
Option used to ignore files to be parsed by docz. ... This option is used if you need to import Typescript components inside...
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