eslint-config-preact
eslint-config-preact copied to clipboard
Cannot find module '@babel/plugin-syntax-class-properties'
Hi Preact team! I'm testing out WMR, which is amazing BTW! Here is my package.json
:
"dependencies": {
"preact": "^10.6.4"
},
"devDependencies": {
"eslint": "^8.5.0",
"eslint-config-preact": "^1.3.0",
"wmr": "^3.7.2"
},
"eslintConfig": {
"extends": "preact"
}
After I installed eslint-config-preact
, I got the following error:
Parsing error: Cannot find module '@babel/plugin-syntax-class-properties'
I double checked my package-lock.json
and made sure @babel/plugin-syntax-class-properties
is installed:
"node_modules/@babel/plugin-syntax-class-properties": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz",
"integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==",
"dev": true,
"dependencies": {
"@babel/helper-plugin-utils": "^7.12.13"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
}
},
I also made sure the node_modules/@babel/plugin-syntax-class-properties
directory exists in my computer.
This should mean the package is there right? Or am i just dumb haha.
@wesdse001 Add following in .babelrc
{ "presets": ["@babel/env"], "plugins": ["@babel/plugin-proposal-class-properties"] }
And add the following in eslintConfig
"plugins": ["@babel"]
@wesdse001 Add following in .babelrc
{ "presets": ["@babel/env"], "plugins": ["@babel/plugin-proposal-class-properties"] }
And add the following in eslintConfig"plugins": ["@babel"]
It seems to me that .babelrc
and .eslintrc
is not generated with npm init preact
. Is there anyway we can do better by adding the configuration files with these content by default?