-
-
Notifications
You must be signed in to change notification settings - Fork 239
How can I use Private Instance Methods? #728
Comments
Wondering the same thing here, not using Vue but would love to use #method() in my code as I'm alreayd using # for class properties |
Been trying to do the same with React, no luck. |
I think this is not the reason for the framework, #729 may be solving this issue. |
This should be fixed by #711 |
^ fixed by above so should be fixed in the next release (Major)! |
I still got an error
|
I added babel private method plugin to an ejected create-react-app project and I get a similar Skriptach error but in my case is about private methods: "Support for the experimental syntax 'classPrivateMethods' isn't currently enabled (10:3):" |
@hadnet I was able to fix this. Do not use |
@Skriptach doing what you said I got this error: "Parsing error: params is not iterable". Just to be clear, this error happens only when trying to implement a private method (#myPrivateMethod(){}). |
@hadnet I'm getting that error as well. |
@hadnet and others - is there any around this error? i.e. is there any way currently for babel-eslint to read files using private methods/private variables without flagging it? i don't mind putting my babel options in multiple places if it'll help. |
Hello? @hzoo |
|
@Pixxet Yes, we have that. |
This issue is not resolved for me. With private class methods, I still get the error "This experimental syntax requires enabling the parser plugin: 'classPrivateMethods" |
Same here. Having the same problem as @debajit Plugins defined:
babel-eslint Version: 10.0.3 |
A year has now passed, Babel has finally completed Class private features support but we don't have babel-eslint to support all this. So great.. |
This issue should be reopened. {
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods"
]
}
Setting .babelrc as above does not solve the problem. |
This is actively being worked on for the next major Babel release. Please track progress here. |
Babel 7.2.0 released today has officially supported Private Instance Methods, but when I use it, the project can be successfully built, but there is an error message about ESLint:
The following is my operating environment:
Node.js 10.14.0
npm 6.4.1
Babel 7.2.0
Babel-eslint 10.0.1
Eslint 5.9.0
My project is built on Vue, I just want to try Private Instance Methods. I can provide the project code if needed.
The text was updated successfully, but these errors were encountered: