Skip to content

Commit fa66dfc

Browse files
fix(attributes-to-props): fix lint error no-prototype-builtins
After updating `eslint` from ^5.10.0 to ^6.0.0, the following error appeared: ``` Disallow use of Object.prototypes builtins directly (no-prototype-builtins) ``` https://eslint.org/docs/rules/no-prototype-builtins
1 parent 8765ea9 commit fa66dfc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/attributes-to-props.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ function attributesToProps(attributes) {
3535
reactProperty = config.html[propertyName.toLowerCase()];
3636
if (reactProperty) {
3737
if (
38-
DOMProperty.properties.hasOwnProperty(reactProperty) &&
38+
Object.prototype.hasOwnProperty.call(
39+
DOMProperty.properties,
40+
reactProperty
41+
) &&
3942
DOMProperty.properties[reactProperty].hasBooleanValue
4043
) {
4144
props[reactProperty] = true;

0 commit comments

Comments
 (0)