Getting odd ESLint warnings when creating custom components for mdx template...
See original GitHub issueI am a bit perplexed…I’m making some custom components for an mdx template following the examples in the tutorial, like so:
const P = props =>
<p
{...props}
style={{
gridColumn: '2/3',
fontFamily: 'Avenir Next',
color: 'white',
fontSize: 'calc(18px + (24 - 18) * ((100vw - 300px) / (1600 - 300)))',
lineHeight: 2,
fontWeight: '300'
}}
/>
…but I’m getting this odd lint warning for each component I create in this fashion:
warn ESLintError:
/Users/rchrdnsh/Documents/Code/Gatsby/RYKR/src/templates/article.js
185:3 warning Headings must have content and the content must be accessible by a screen reader
jsx-a11y/heading-has-content
196:3 warning Headings must have content and the content must be accessible by a screen reader
jsx-a11y/heading-has-content
207:3 warning Headings must have content and the content must be accessible by a screen reader
jsx-a11y/heading-has-content
218:3 warning Headings must have content and the content must be accessible by a screen reader
jsx-a11y/heading-has-content
229:3 warning Headings must have content and the content must be accessible by a screen reader
…so i don’t know what’s going on here, and would love to get rid of these warnings, but is there an issue with mdx or what i’m doing that I am unaware of?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
How to create a custom lint rule for Markdown and MDX using ...
How to create a custom lint rule for Markdown and MDX using remark and ESLint · Contents · Set up the project ·...
Read more >Common React TypeScript ESLint / Lint Errors & Warning ...
Not specifying attributes in certain components can produce lint error messages. For example, a button needs the button type and lists in React...
Read more >Troubleshooting MDX
This article goes through several common problems and errors that might occur when using MDX.
Read more >Gatsby i18n: A Hands-on Guide | Phrase
Hit the ground running quickly with this Gatsby i18n tutorial and learn how to add internationalization support to your Gatsby project.
Read more >@storybook/addon-actions | Yarn - Package Manager
@storybook/addon-actions. owner storybookjs16.7mMIT6.5.15TS vulns 0 vulnerabilities. Get UI feedback when an action is performed on an interactive element.
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
OK, that would be it. If you change your code to e.g.
then it should fix it.
If you want to define the components in another file it’s quite simple: you just need to export them from that file:
…and then import them into your component:
We could probably do with updating the documentation to show the use of
{ children }
.hmmmmm…i think this got solved, so i’ll close for now…i think.