Cannot use class members visibility modifiers

IDE keeps showing me these errors in one project:

Though my javascript language version is the React JSX

And in the second project with the same settings I can use private or protected modifiers without any problems.

Could you help with this? What is the source of the problem? Is this a bug?

3 comments
Comment actions Permalink

Is your project attached to other projects/have nested '.idea' folders in its structure? Must be https://youtrack.jetbrains.com/issue/WEB-36242

Please select your .js file in Project tool window, hit Ctrl+Q (or whatever shortcut is assigned to View | Quick Documentation main menu action) and attach a screenshot of the popup that opens

0
Comment actions Permalink

This is a configuration of project where use of modifiers is seen as error:

 

This is configuration in the project where I can use private modifiers without any problems:

0
Comment actions Permalink

Hmm... There are no visibility modifiers in Javascript (except for basic support for private fields denoted with # in ESNext proposals, see https://github.com/tc39/proposal-class-fields#private-fields). See https://stackoverflow.com/questions/34517581/access-modifiers-private-protected-in-es6

In your other project, you are using TypeScript, not JavaScript, that's why it works for you there

0

Please sign in to leave a comment.