\src\routes\List\TableList.js
error Parsing error: Using the export keyword between a decorator and a class is not allowed. Please use export @dec class instead.
64 | }))
65 | @Form.create()
> 66 | export default class TableList extends PureComponent {
| ^
67 | state = {
68 | modalVisible: false,
69 | expandForm: false,
The same error occurs in other files that use decorators, and methods that ignore such errors cannot be found in the ESLint documentation.
看起来像是 tslint 的报错。。。
问题是,这是官方的代码,我并没有改。。。
编辑器干的吗?
应该不是,是在提交的时候,Git 的 precommit 钩子触发了 lint-stage 代码检查
babel-eslint v9 使用了新的装饰者提案
https://github.com/babel/babel-eslint/releases/tag/v9.0.0, @chenshuai2144 是不是得umi 搞一下,否则降级v8.2.6
应该来个紧急修复兼容下老的提案写法,而且vscode编辑器目前格式化也是按老的方式;不过umi和pro官方的小伙伴没有出现这个问题吗?
原来是都改过去了,那我也这么干。
😂那我也改了吧,谢谢
刚出现,我刚安装了8.2.6还是不行


我这个怎么搞
凉了,官方最新的版本把这种都改过来了,以前的写法是不符合规范的,要是自己的代码的话你就手动改过来吧,要是 antd pro 的话就从 github 拉最新的代码下来
@hazeFlame See #2122
没用过pro,只能一个一个改了。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
我改的时候也感到很蛋疼。。
我clone了最新的代码,提交时依然在precommit会报错。最终发现,是因为lint-staged中会执行prettier --write命令,这个命令把decorator的用法又改回了旧的格式,导致随后的lint不通过,从而无法commit
I have the same issue as @ekuwang
我clone了最新的代码,提交时依然在precommit会报错。最终发现,是因为lint-staged中会执行prettier --write命令,这个命令把decorator的用法又改回了旧的格式,导致随后的lint不通过,从而无法commit
是我 我也是的
顺应时代潮流吧
mark
,
// "husky": {
// "hooks": {
// "pre-commit": "npm run lint-staged"
// }
// }
去掉就行
Most helpful comment
我clone了最新的代码,提交时依然在precommit会报错。最终发现,是因为lint-staged中会执行prettier --write命令,这个命令把decorator的用法又改回了旧的格式,导致随后的lint不通过,从而无法commit