Skip to content

Commit 8ac873d

Browse files
committed
chore: minor refactoring
1 parent a8e1185 commit 8ac873d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/rules/no-danger.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module.exports = {
6363
items: {
6464
type: 'string',
6565
},
66-
minItems: 1,
66+
minItems: 0,
6767
type: 'array',
6868
uniqueItems: true,
6969
},
@@ -79,8 +79,7 @@ module.exports = {
7979
JSXAttribute(node) {
8080
const functionName = node.parent.name.name;
8181

82-
const enableCheckingCustomComponent = customComponentNames.length > 0
83-
&& customComponentNames.some((name) => minimatch(functionName, name));
82+
const enableCheckingCustomComponent = customComponentNames.some((name) => minimatch(functionName, name));
8483

8584
if ((enableCheckingCustomComponent || jsxUtil.isDOMComponent(node.parent)) && isDangerous(node.name.name)) {
8685
report(context, messages.dangerousProp, 'dangerousProp', {

0 commit comments

Comments
 (0)