Skip to content

Commit

Permalink
chore: minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
akulsr0 committed May 7, 2024
1 parent a8e1185 commit 8ac873d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/rules/no-danger.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = {
items: {
type: 'string',
},
minItems: 1,
minItems: 0,
type: 'array',
uniqueItems: true,
},
Expand All @@ -79,8 +79,7 @@ module.exports = {
JSXAttribute(node) {
const functionName = node.parent.name.name;

const enableCheckingCustomComponent = customComponentNames.length > 0
&& customComponentNames.some((name) => minimatch(functionName, name));
const enableCheckingCustomComponent = customComponentNames.some((name) => minimatch(functionName, name));

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

0 comments on commit 8ac873d

Please sign in to comment.