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

后端 未结 10 1955
南笙
南笙 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

    The eslint option that solves the "The keyword import is reserved" error is parserOptions.sourceType. Setting it to "module" allows the import keyword to be used.

    .eslintrc

    {
        "parserOptions": {
            "sourceType": "module"
        }
    }
    

    Docs: https://eslint.org/docs/user-guide/configuring#specifying-parser-options

提交回复
热议问题