Skip to content

Commit 149800a

Browse files
committed
fix(eslint-config-ts-lib): 禁用 react/no-unused-prop-types 规则
1 parent 9516b41 commit 149800a

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 变更说明
22

3+
## v0.13.10 - 2020.10.16
4+
5+
- fix(eslint-config-ts-lib): 禁用 react/no-unused-prop-types 规则
6+
37
## v0.13.9 - 2020.10.15
48

59
- fix(eslint-config-ts-lib): 修复 eslint 不检测 react hooks 的依赖的缺陷
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react';
2+
3+
interface Props {
4+
y: string;
5+
x: string;
6+
}
7+
8+
export default function Demo(props: Props) {
9+
return React.createElement('div', props);
10+
}

packages/eslint-config-ts-lib/rules/react-rules.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const reactRules = {
99
'react/jsx-props-no-spreading': 'off',
1010
// 此规则不符合 ts 模式下编写 React 组件,不需要通过 .defaultProps 属性指定默认属性,通过 es6 的函数默认参数指定默认属性值
1111
'react/require-default-props': 'off',
12+
// 此规则不满足 React.createElement('div', props) 场景,故禁用此规则
13+
'react/no-unused-prop-types': 0,
1214
};
1315

1416
module.exports = reactRules;

0 commit comments

Comments
 (0)