eslint “parsing error: Unexpected token {” in JSX

后端 未结 3 543
滥情空心
滥情空心 2021-02-13 00:54
const title = \'My Minimal React Webpack Babel Setups\';

const App = () => (
{title}
)
3条回答
  •  抹茶落季
    2021-02-13 01:13

    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

提交回复
热议问题