-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no-invalid-this error is suppressed in node environment #3961
Closed
mhipszki opened this issue
Sep 28, 2015
· 3 comments
· Fixed by netiam/oauth#3, ampproject/amphtml#523, HBM/node-jet#93, netiam/errors#3 or netiam/acl#3
Closed
no-invalid-this error is suppressed in node environment #3961
mhipszki opened this issue
Sep 28, 2015
· 3 comments
· Fixed by netiam/oauth#3, ampproject/amphtml#523, HBM/node-jet#93, netiam/errors#3 or netiam/acl#3
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
rule
Relates to ESLint's core rules
Comments
Thanks for the issue! If you're reporting a bug, please be sure to include:
Requesting a new rule? Please see Proposing a New Rule for instructions. |
This is simply a bug in |
ilyavolodin
added
bug
ESLint is working incorrectly
rule
Relates to ESLint's core rules
evaluating
The team will evaluate this issue to decide whether it meets the criteria for inclusion
and removed
triage
An ESLint team member will look at this issue soon
labels
Sep 28, 2015
Thanks for the report. |
ilyavolodin
added
accepted
There is consensus among the team that this change meets the criteria for inclusion
and removed
evaluating
The team will evaluate this issue to decide whether it meets the criteria for inclusion
labels
Sep 29, 2015
mysticatea
added a commit
to mysticatea/eslint
that referenced
this issue
Oct 2, 2015
This was referenced Oct 8, 2015
eslint-deprecated
bot
added
the
archived due to age
This issue has been archived; please open a new issue for any further discussion
label
Feb 7, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
rule
Relates to ESLint's core rules
The version of ESLint you are using (run eslint -v)
1.5.1
What you did (the source code and ESLint configuration)
source code
eslint config
The actual ESLint output complete with numbers
nothing
What you expected to happen instead
Expected ESLint to report
no-invalid-this
error, but instead got nothing.this
refers to the module object itself in a context of a Node module, so it won't be undefined in any case.However I would not encourage developers to use
this.a = 3;
in Node modules instead ofexports.a = 3;
as the latter one is more explicit, however it might be just my personal preference?Node modules are cached after loading, which actually advocating the "singleton pattern" in a way, and again it might be my own preference, but I would not encourage developers to do that as a habit.
See https://nodejs.org/api/modules.html#modules_caching
Proposal: an option to warn developers not to use
this
in Node modules' root scope.The text was updated successfully, but these errors were encountered: