使用此代码:
import React from 'react';
import { Link } from 'react-router';
import { View, NavBar } from 'amazeui-touch';
import * as Pages from '../components';
const { Home, ...Components } = Pages;
我收到此错误提示:
7:16 error Parsing error: Unexpected token .. Why?
这是我的eslint配置:
{
"extends": "airbnb",
"rules": {
/* JSX */
"react/prop-types": [1, {
"ignore": ["className", "children", "location", "params", "location*"]
}],
"no-param-reassign": [0, {
"props": false
}],
"prefer-rest-params": 1,
"arrow-body-style": 0,
"prefer-template": 0,
"react/prefer-stateless-function": 1,
"react/jsx-no-bind": [0, {
"ignoreRefs": false,
"allowArrowFunctions": false,
"allowBind": true
}],
}
}
.... .... 有什么问题?
ESLint 2.x实验性地支持ObjectRestSpread语法,您可以通过将以下内容添加到您的文档中来启用它
.eslintrc
:ESLint 1.x本机不支持散布运算符,一种解决方法是使用babel-eslint解析器。最新的安装和使用说明位于项目自述文件中。