Skip to content

Commit

Permalink
Upgrade ESLint to latest
Browse files Browse the repository at this point in the history
And fix no-prototype-builtins errors

See: https://eslint.org/docs/rules/no-prototype-builtins
  • Loading branch information
mroderick authored and mantoni committed Nov 9, 2020
1 parent 4eb8c25 commit e026ff3
Show file tree
Hide file tree
Showing 4 changed files with 390 additions and 434 deletions.
10 changes: 5 additions & 5 deletions lib/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ function args(argv) {

['timeout', 'port', 'yields', 'viewport-height', 'viewport-width']
.forEach(function (prop) {
if (opts.hasOwnProperty(prop)) {
if (Object.hasOwnProperty.call(opts, prop)) {
opts[prop] = parseInt(opts[prop], 10);
}
});

if (opts.hasOwnProperty('url')) {
if (Object.hasOwnProperty.call(opts, 'url')) {
opts.url = url.parse(opts.url);
delete opts.url.host;
}

if (opts.hasOwnProperty('https-server')) {
if (Object.hasOwnProperty.call(opts, 'https-server')) {
opts['https-server'] = parseInt(opts['https-server'], 10) || 0;
} else if (opts.hasOwnProperty('url')) {
} else if (Object.hasOwnProperty.call(opts, 'url')) {
opts['https-server'] = parseInt(opts.url.port, 10) || 0;
}

if (opts.hasOwnProperty('web-security')) {
if (Object.hasOwnProperty.call(opts, 'web-security')) {
opts['web-security'] = opts['web-security'] === 'true';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/mochify.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = function (_, opts) {

// Apply defaults when using the API
Object.keys(args.defaults).forEach(function (key) {
if (!opts.hasOwnProperty(key)) {
if (!Object.hasOwnProperty.call(opts, key)) {
opts[key] = args.defaults[key];
}
});
Expand Down

0 comments on commit e026ff3

Please sign in to comment.