Can not enable `syntax-class-properties` with other fields related plugins
See original GitHub issueBug Report
- I would like to work on a fix!
Current behavior
Input Code
export class Foo {
#bar = 'bar'
}
Expected behavior
I’d like to keep class properties as-is.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
- Filename:
babel.config.js
module.exports = {
plugins: [
'@babel/syntax-class-properties',
'@babel/proposal-private-methods',
],
}
Environment
- Babel version(s): v7.12.10
- Node/npm version: Node v12.20.0/npm 6.14.9
- OS: macOS 11.2 Beta
- Monorepo: no
- How you are using Babel: API directly
Possible Solution
Check syntax-class-properties
instead of proposal-class-properties
for class fields
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Support for the experimental syntax 'classProperties' isn't ...
I just solve this problem by adding @babel/plugin-proposal-class-properties into webpack config plugin. The module section of my ...
Read more >babel/plugin-transform-typescript
This plugin adds support for the types syntax used by the TypeScript programming language. However, this plugin does not add the ability to...
Read more >@babel/plugin-proposal-class-properties - Package Manager
This plugin transforms static class properties as well as properties declared with the property initializer syntax. babel-plugin ...
Read more >support for the experimental syntax 'decorators' isn't currently ...
I'm using mobx in a react app and I keep getting this error: Support for the experimental syntax 'decorators-legacy' isn't currently enabled in...
Read more >Support for the experimental syntax 'classProperties' isn't ...
In the general case, all the babel configuration can be passed down from babel.config.js or any other supported formate files. But in my...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is probably fixed by part of https://github.com/babel/babel/pull/12250, I can split that PR in two separate PRs.
I’m preparing https://github.com/babel/babel/pull/13260 as an alternative for #12250, which gives better and easier control on how the different class features transforms interact.