Skip to content

Commit

Permalink
Fix no-prototype-builtins issue in Ruleset variables()
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Jul 15, 2024
1 parent 53f84f0 commit f9d0f54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/less/src/less/tree/ruleset.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ Ruleset.prototype = Object.assign(new Node(), {
if (r.type === 'Import' && r.root && r.root.variables) {
const vars = r.root.variables();
for (const name in vars) {
// eslint-disable-next-line no-prototype-builtins
if (vars.hasOwnProperty(name)) {
if (Object.prototype.hasOwnProperty.call(vars, name)) {
hash[name] = r.root.variable(name);
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/test-data/less/_main/rulesets.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
}
}
font-size: 2em;
hasOwnProperty: blue;
}

0 comments on commit f9d0f54

Please sign in to comment.