Open JustFly1984 opened 5 years ago
Oy, yes. I think that jsx-ast-utils just needs to fail silently here. It's becoming way too disruptive.
@ljharb @evcohen given the profusion of new AST node types (especially with TypsScript in the mix), think the best way forward here is for jsx-ast-util and eslint-plugin-jsx-a11y to just fail silently on unknown AST node types. We can't keep up with the rate of introduction.
Rather than wait for https://github.com/evcohen/jsx-ast-utils/pull/77 to land, I'll just fix the projects with some defensive existence checks so that we don't disrupt the ecosystem with errors like this.
I agree - it could still console.log the node type with a request to report an issue tho :-)
Still working on this. Maintaining support for Node 4 and 5 is making it very difficult and burning my time.
I ran into the same issue when trying to find ways to fix #580:
<a href={"#" as any /* https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/580 */}>link</a>
It would be cool to at least drop the project name in messages like this. I am using this plugin through CRA3 and I had to google the message to find out what project produces it so that I know where to file that issue. For me it was just a result of running npm start
with CRA which makes it look like the issue is coming from CRA. Or the new issue link directly, even better.
I also don't know how to disable this. ESLint has this to say to using eslint-ignore-next-line
in JSX:
{
// eslint-disable-next-line
}
<a href="#">link</a>
Or this:
<a
// eslint-disable-next-line
href="#">link</a>
But neither works and I am not sure if this is due to the TSX AST parsing or not.
https://github.com/eslint/eslint/issues/7030
The issue has since been silenced, please can you let me know if this is an issue with the AST parser here or not? If not, I will open a new issue with ESLint providing the above cases as reproes as they should work but don't.
Since this is a parsing issue, there is no workaround but to completely disable the rule in your config.
The issue likely needs to be fixed in this plugin or in jsx-ast-utils, and it’s awaiting a PR to do so.
@JustFly1984 I'm flat out at work right now. I don't have time to address TSX parsing errors for at least another week. If you put up a PR, I'm glad to review.
Hi!
Any updates on this issue? We are facing this issue now as well.. Is there anything I can help out with to solve this issue?
@TomasHubelbauer try an expression container around the comment
<a
{// eslint-disable-next-line}
href="#">link</a>
Fixed by updating to jsx-ast-utils@v2.2.1
I have my Gatsby.js project refactored to TypeScript, and while fixing my eslint config, and getting next error.
setting
'jsx-a11y/html-has-lang': 'off'
in eslint config solved issue