False positive for: use $document instead of document
I'm using eslint-plugin-angular version 1.3.0. In one of my Angular services I have a function that accepts a JS object parameter which name is document, e.g.:
function sampleFunc(document) {
if (document.enabled) {
// ...
}
// ...
}
The plugin treats the document parameters as the global reference to the document object and raises the error.
How do you think we can detect the use of global variable versus your document function parameter ?
@Gillespie59 Actually I think that could be possible. I remember that I had to distinguish between parameters and global variables for another rule.
BUT I don't think that it is a good thing to shadow global variables with. This can be very confusing for others to read your code. There is even a ESLint role to prevent this for own variables (http://eslint.org/docs/rules/no-shadow).