unresolved variable in ES6 class
I get the error below even though the code compiles:

I know it's related to https://intellij-support.jetbrains.com/hc/en-us/community/posts/206336769-Inspection-unresolved-variable-on-this-in-javascript-class?input_string=unresolved%20variable%20in%20ES6%20class but the YouTrack issue was resolved. Maybe there has been a regression?
Please sign in to leave a comment.
Doesn't look like a regression, https://youtrack.jetbrains.com/issue/WEB-12808 is not repeatable for me.
Please provide a code snippet (as text) that can be used to recreate the issue
Hmm... this problem only seems to happen on that particular project. Upon creating a new one, it doesn't have that problem. Did the project settings get messed up somehow? If so, how can I fix it?
New project:
Old project:
Code snippet:
class Movie {
constructor(title, rating, hasWatched) {
this.title = title;
this.rating = rating;
this.hasWatched = hasWatched;
}
toString() {
let str = `You have `;
if (this.hasWatched) {
str += `watched `
} else {
str += `not seen `
}
return str + `"${this.title}" - ${this.rating} stars`
}
}
console.log(new Movie(`Frozen`, 4.5, false).toString());
Thanks!
Works fine for me:
Please try invalidating caches (File > Invalidate caches, Invalidate and restart) - does the issue persist?
It's still happening after invalidating caches... :/
Please share a project that shows up the issue