【问题标题】:ESLint Parsing error: Unexpected token in module.exportsESLint 解析错误:module.exports 中有意外的标记
【发布时间】:2016-07-10 17:56:36
【问题描述】:

我正在使用带有 vim syntastic 的 eslint v3.0.1。由于某种原因,我无法对配置进行任何更改以消除此错误

config/routes.js|16 col 16 error| Parsing error: Unexpected token routes [javascript/eslint]

var routes = (
  <Router>
    <Route path='/' component={Main}>
    </Route>
  </Router>
);

module.exports routes;

我现在正在使用一个非常通用的 .eslintrc

{
  "plugins": [
    "react"
  ],
  "extends": ["eslint:recommended", "plugin:react/recommended"]
}

【问题讨论】:

    标签: ecmascript-6 eslint


    【解决方案1】:

    最后一行不正确,需要写module.exports = routes

    【讨论】:

      猜你喜欢
      • 2020-01-02
      • 2019-12-25
      • 2022-01-02
      • 2016-06-27
      • 2017-11-21
      • 2017-07-16
      • 1970-01-01
      • 1970-01-01
      • 2023-04-04
      相关资源
      最近更新 更多