我在设置 JSCS 以使用 JSX/React 和 ES6(stage-0)时遇到了困难。它抛出这样的错误:
Expected end of node list but "Punctuator" found at ./src/base/react/architecture/components/Dummy.component.jsx :
1 |import React, { PropTypes, Component } from 'react';
--------^
和
Expected end of node list but "Punctuator" found at ./src/base/react/architecture/utils/redux-ext.js :
1 |import React from 'react';
--------^
2 |import Immutable from 'immutable';
3 |import * as reactRedux from 'react-redux';
我无法修复它或找到此问题的原因。
我的配置是:
{
"preset": "airbnb",
"validateIndentation": 4,
"fileExtensions": [
".js",
".jsx"
],
"maxErrors": -1,
"excludeFiles": [
"**/ammap.js",
"**/worldHigh.js",
"**/worldLow.js",
"node_modules/*",
"**/assets/*"
]
}