Feature: no-inline-comments: Allow exception inside JSX
See original GitHub issueWhat rule do you want to change?
no-inline-comments
Does this change cause the rule to produce more or fewer warnings?
Fewer
How will the change be implemented? (New option, new default behavior, etc.)?
Rule options, or change in rule behavior
Please provide some example code that this change will affect:
function App() {
return (
<div>
{/* Some comment */}
<h1>Some heading</div>
</div>
)
}
What does the rule currently do for this code?
Right now no-inline-comments
will warn on any comments inside JSX.
What will the rule do after it’s changed?
It makes sense to allow comments inside JSX while still disallowing inline comments in regular JS blocks.
Are you willing to submit a pull request to implement this change?
Unfortunately not.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:13 (10 by maintainers)
Top Results From Across the Web
Feature: no-inline-comments: Allow exception inside JSX #2132
I haven't found any way to make it work, since the rule has no options: https://eslint.org/docs/rules/no-inline-comments.
Read more >no-inline-comments - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >How to catch exception in JSX - reactjs - Stack Overflow
I have object that returns the icon object based on the icon name. For proper MaterialUI icon name, the function returns the proper...
Read more >JSX In Depth - React
JSX In Depth. Fundamentally, JSX just provides syntactic sugar for the React.createElement(component, props, ...children) function. The JSX code:.
Read more >ValidateJavaScript - Online Tool to Find & Fix JavaScript Errors
... validating (or linting) tool that will automatically find basic errors and help prevent potentially destructive bugs in JavaScript & JSX (React.js) code....
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
The current behavior in JSX does feel like a bug to me, and I would be okay with changing the behavior by default for JSX as long as other cases aren’t affected. If we make this change, I do think we should note the reasoning for this exception in the docs. It would be even better if we could get this into v6!
I’m working on this.