Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Webpack Autofix Babel 6.4:类属性后需要分号_Webpack_Babeljs_Jslint - Fatal编程技术网

Webpack Autofix Babel 6.4:类属性后需要分号

Webpack Autofix Babel 6.4:类属性后需要分号,webpack,babeljs,jslint,Webpack,Babeljs,Jslint,我正在尝试升级到巴别塔到6.4。在解决了require的一系列问题后,现在我遇到了大量关于缺少分号的错误: ERROR in ./src/components/views/HomePage/main.js Module build failed: SyntaxError: /Users/chris/ss/components/views/HomePage/main.js: A semicolon is required after a class property (16:23) 14 |

我正在尝试升级到巴别塔到6.4。在解决了
require
的一系列问题后,现在我遇到了大量关于缺少分号的错误:

ERROR in ./src/components/views/HomePage/main.js
Module build failed: SyntaxError: /Users/chris/ss/components/views/HomePage/main.js: A semicolon is required after a class property (16:23)
  14 | @connectToStores
  15 | class HomePage extends Component{
> 16 |   static propTypes = {}
     |                        ^
  17 |
  18 |   static contextTypes = {
  19 |     onSetBodyClass: PropTypes.func.isRequired,
    at Parser.pp.raise (/Users/chris/ss/node_modules/babel-core/node_modules/babylon/index.js:1425:13)
    at Parser.pp.parseClassProperty (/Users/chris/ss/node_modules/babel-core/node_modules/babylon/index.js:2577:10)
    at Parser.parseClassProperty (/Users/chris/ss/node_modules/babel-core/node_modules/babylon/index.js:3785:20)
    at Parser.pp.parseClassBody (/Users/chris/ss/node_modules/babel-core/node_modules/babylon/index.js:2482:34)
    at Parser.pp.parseClass (/Users/chris/ss/node_modules/babel-core/node_modules/babylon/index.js:2425:8)
    at Parser.pp.parseStatement (/Users/chris/ss/node_modules/babel-core/node_modules/babylon/index.js:1889:19)
    at Parser.parseStatement (/Users/chris/ss/node_modules/babel-core/node_modules/babylon/index.js:3574:22)
    at Parser.pp.parseBlockBody (/Users/chris/ss/node_modules/babel-core/node_modules/babylon/index.js:2294:21)
    at Parser.pp.parseTopLevel (/Users/chris/ss/node_modules/babel-core/node_modules/babylon/index.js:1823:8)

是否有一个过梁或一些实用程序可以自动修复所有这些问题?

哇,人们真的为此感到非常激动

读了这篇文章之后,巴贝尔似乎要改变这一点

此外,建议恢复Babel版本,直到问题得到解决,如下所示:

package.json

"babel": "<6.3.0",
"babel-cli": "<6.3.0",
"babel-core": "<6.3.0",
"babylon": "<6.3.0",

“babel”:“您可以使用JSCS的requireSemicolons规则来自动修复此问题

-在版本2.9.0中添加了此功能