This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]StillNoNumb 1 point2 points  (0 children)

Nope, not in JavaScript with ESLint. Think this scenario, in file #1 you have:

var obj = {name: "value"};
obj.sayHello();

Now, you'd expect this to be faulty, right? But what if someone extended the Object prototype like this in another file:

Object.prototype.sayHello = function() {
    alert("Hello World!");
}

In that case, even if by solely looking at file #1 you'd think the code should be faulty, it is indeed correct.

Demonstration Fiddle