目前,我得到了这些衬里错误:
ESLint: UNSAFE_componentWillUpdate should be placed after someFunction (react/sort-comp)
和
ESLint: Identifier 'UNSAFE_componentWillUpdate' is not in camel case. (camelcase)
目前,我无法找到将正确的规则添加到.eslintrc以应用于预先添加的UNSAFE_组件生命周期。我试图使它同时适用于react/sort-comp和camelcase规则,任何线索/帮助都将不胜感激
发布于 2019-12-17 08:43:27
你可以把这个加到你的棉布上
"camelcase": [
"error", {
"ignoreDestructuring": true,
"allow": [ "^UNSAFE_" ]
}
],这基本上只允许所有重命名的UNSAFE_生命周期方法。
https://stackoverflow.com/questions/53844282
复制相似问题