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.

Feature: no-inline-comments: Allow exception inside JSX

See original GitHub issue

What 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:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
kaicataldocommented, May 27, 2019

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!

1reaction
mdjermanoviccommented, Oct 7, 2019

I’m working on this.

Read more comments on GitHub >

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

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