Umi: Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.

Created on 10 Sep 2018  ·  5Comments  ·  Source: umijs/umi

Parsing error: Using the export keyword between a decorator and a class is not allowed. Please use export @dec class instead.

使用修饰器无法在 class 中间使用 export 关键字?我看了 ES6 的文档,是可以这么写的呀。

image

Most helpful comment

你应该是跟新了vscode的eslint插件了,
eslint的相关依赖是需要特定的版本的,
依赖版本不对应也会出现问题,
你可以尝试添加配置
.eslintrc:

      "parserOptions": {
        "ecmaFeatures": {
          "legacyDecorators": true
        }
      }

All 5 comments

请给重现步骤。

image
正常编写代码就会出现,不确定是否跟 .eslintrc 有关。

你应该是跟新了vscode的eslint插件了,
eslint的相关依赖是需要特定的版本的,
依赖版本不对应也会出现问题,
你可以尝试添加配置
.eslintrc:

      "parserOptions": {
        "ecmaFeatures": {
          "legacyDecorators": true
        }
      }

这是 eslint 抛的错,和 umi 没啥关系。

添加了eslint配置在vscode里不会报错,但是编译不过。

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zemzheng picture zemzheng  ·  3Comments

stoneWeb picture stoneWeb  ·  3Comments

tauruswang picture tauruswang  ·  3Comments

zhanchengkun picture zhanchengkun  ·  3Comments

kitebear picture kitebear  ·  3Comments