ESLint 解析錯誤:意外的令牌 - ESLint Parsing error: Unexpected token

問題:

With this code:使用此代碼:

import React from 'react';
import { Link } from 'react-router';
import { View, NavBar } from 'amazeui-touch';

import * as Pages from '../components';

const {  Home, ...Components } = Pages;

I get this eslint error:我收到這個 eslint 錯誤:

7:16  error  Parsing error: Unexpected token .. Why?

Here is my eslint config:這是我的 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
    }],
  }
}

.... .... What's the problem? .... .... 有什麼問題?


解決方案:

參考一: https://en.stackoom.com/question/2R3eC
參考二: https://stackoom.com/question/2R3eC
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章