Open vsccarl opened 8 years ago
Code Version 1.9.0 MacOS 10.12.3
Having the same error with my jsx files.
Same here.
Also I reported it on the JSHint repo as well if anyone has anything to add or wants to track it:
https://github.com/jshint/jshint/issues/3097
Windows 7 64b Code 1.9.0 Plugin version 0.10.15
Hi, another thing that I forgot to add is that when I wrap the tag with the issue, the error is thrown on a different place in the code.
Here the error is happens on the closing h3 tag:
Here the same code is wrapped around a div tag and the error goes to the first level div tag
The extension is running jshint on the entire jsx file, but jshint doesn't support jsx syntax. I think the correct fix would be for the extension to parse and identify the jsx portions of the file and not lint those, but this is a difficult fix that will take a while. Would it be useful to have an option to not run jshint on jsx files?
One workaround for now would be to manually turn off jshint around the functions returning HTML using /* jshint ignore:start */
and /* jshint ignore:end */
Any elegant solution? I met this problem on my vscode as well.
I adopted the RMacfarlane way; rather than do a vscode global disabling of jshint
(Code->Preferences->Settings->User extensions->JSHint configuration->JSHint:Enable tick box off)
i surround a return statement that use JSX syntax with the /* jshint ignore:start */
and /* jshint ignore:end */
statements. Cleanest might be a jsxhint evolution; some kind of jshint superset that understands JSX as well.
you can disable(workspace). I can do this It's work.
Still not configurable? 4 years!?
Hundreds of "Unclosed regular expression. (E015)" ... I have literally no regexps in the whole project! "Unrecoverable syntax error. (88% scanned). (E041)"
I'd like to just ignore/disable these/some errors.
Why only Warnings can be optionally ('.jshintrc') ignored? By design? Just enable configurable ignoring for Errors?
There is 'Report Warnings As Errors', maybe Report All Errors as Warnings?
(with renaming/renumbering if required, f.e. E015>W1015) ... and making possible to ignore with '.jshintrc' ?
在vscode里直接禁用jshint就可以了。如果我们是在编写react的代码,就会经常出现/这种关闭标签的语法,就会提出这个错误。所以既然不想看到这个错误就直接禁用了jshint吧。
bump, I hear react is popular.
bump, I didn't know about programming when this issue was opened
2021, the problem's still not resolved
It's 2022! Happy birthday little bug :D
c'est terrible! Just add a suppress array to config plz!!!
It's a summer 2022! When are you going to solve this problem?
This problem will most likely never be solved. Best thing you can do is just uninstall jshint and use eslint instead, it's the better linter as long as you're working in react.
Code Version: 1.1.0-alpha Windows 10
When returning HTML code inside a class (using React Native) shows a jshint error that should be valid.