ESLint Parsing error: Unexpected token

后端 未结 8 2022
野趣味
野趣味 2020-11-28 02:12

With this code:

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

import * as Pages from \         


        
8条回答
  •  执笔经年
    2020-11-28 02:53

    If you have got a pre-commit task with husky running eslint, please continue reading. I tried most of the answers about parserOptions and parser values where my actual issue was about the node version I was using.

    My current node version was 12.0.0, but husky was using my nvm default version somehow (even though I didn't have nvm in my system). This seems to be an issue with husky itself. So:

    1. I deleted $HOME/.nvm folder which was not deleted when I removed nvm earlier.
    2. Verified node is the latest and did proper parser options.
    3. It started working!

提交回复
热议问题