(PS none of these SO questions (with inaccurate titles) solved, or addressed, this issue: React Linting: Unclosed Regular Expression, unclosed regular expression, React JSX error : Unclosed regular expression)
How do I fix linting error on jsx closing tags : "unclosed regular expression" ?
For example, this code snippet runs fine, but causes a SublimeLinter Error:
class Users extends React.Component {
render() {
var friends = this.props.list.filter(function(user){
return user.friend === true;
});
var nonFriends = this.props.list.filter(function(user){
return !user.friend;
});
return (
<div>
<h1>Friends</h1>
<ul>
...
</ul>
</div>
)
}
}
The linter balks at the </h1>
closing JSX tag, thinking it's the start of a regular expression.
1-2 of 2 errors: Unclosed regular expression; Unrecoverable syntax error. (42% scanned), 2 lines, 25 characters selected
Relevant packages I have installed in Sublime Text3:
SublimeLinter, SublimeLinter-contrib-eslint, JSHint, Babel
edit:
I just added the package "JSX", but that didn't help.
I've searched for the "sublimeLinter-jsxhint" package, but cannot find it.