eslint: no-extend-native false positive

Applying standard@10.0.1 to the npm package migrate and it has a constructor called Set. Obviously it might not be the best name since it is a native constructor now, but eslint should probably recognize that it is not actually modifying the native.

Projects/node-migrate/lib/set.js:52:1: Set prototype is read only, properties should not be added.
function Set (path) {}
Set.prototype.addMigration = function (title, up, down) {}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (12 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve only had a chance to skim the rule source, but I think I agree this is a bug. The rule is looking at built-in global names without using scope analysis to determine if a global scope reference is even being modified (which it clearly isn’t in the example case).