eslint “parsing error: Unexpected token {” in JSX

后端 未结 3 1356
[愿得一人]
[愿得一人] 2021-02-13 00:50
const title = \'My Minimal React Webpack Babel Setups\';

const App = () => (
{title}
)
3条回答
  •  没有蜡笔的小新
    2021-02-13 01:35

    Eslint on its own is not good enough. First install babel-eslint:

    npm install --save-dev babel-eslint
    

    Or with yarn:

    yarn add -D babel-eslint
    

    Then add to your .eslintrc file:

    "parser": "babel-eslint"
    

    You might want to install eslint-plugin-babel as well, but I believe this is not needed

提交回复
热议问题