Parsing Error The Keyword import is Reserved (SublimeLinter-contrib-eslint)

后端 未结 10 1953
南笙
南笙 2021-01-31 01:14

I have a problem with eslint, it gives me [Parsing Error The keyword import is reserve] this is only occur in sublime, in atom editor work well. I have eslint

.eslintr

10条回答
  •  失恋的感觉
    2021-01-31 01:48

    This config worked for me. (I am using create-react-app but applicable to any eslint project)


    .eslintrc (create file in root if it doesnt exist)

    {
        "rules": {
          "jsx-a11y/anchor-is-valid": [ "error", {
            "components": [ "Link" ],
            "specialLink": [ "to" ]
          }]
        },
        "parserOptions": {
            "sourceType": "module",
            "ecmaVersion": 2015
        }
      }
    

提交回复
热议问题