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
feat: fix no-eval logic for this
in arrow functions
#15755
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mdjermanovic
added
bug
ESLint is working incorrectly
rule
Relates to ESLint's core rules
accepted
There is consensus among the team that this change meets the criteria for inclusion
feature
This change adds a new feature to ESLint
labels
Apr 4, 2022
nzakas
approved these changes
Apr 6, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just leaving open for others to review given this was tagged as a feature and not just a bug fix.
crapStone
pushed a commit
to Calciumdibromid/CaBr2
that referenced
this pull request
Apr 9, 2022
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | minor | [`8.12.0` -> `8.13.0`](https://renovatebot.com/diffs/npm/eslint/8.12.0/8.13.0) | --- ### Release Notes <details> <summary>eslint/eslint</summary> ### [`v8.13.0`](https://github.com/eslint/eslint/releases/v8.13.0) [Compare Source](eslint/eslint@v8.12.0...v8.13.0) #### Features - [`274acbd`](eslint/eslint@274acbd) feat: fix no-eval logic for `this` in arrow functions ([#​15755](eslint/eslint#15755)) (Milos Djermanovic) #### Bug Fixes - [`97b57ae`](eslint/eslint@97b57ae) fix: invalid operator in operator-assignment messages ([#​15759](eslint/eslint#15759)) (Milos Djermanovic) #### Documentation - [`c32482e`](eslint/eslint@c32482e) docs: Typo in space-infix-ops docs ([#​15754](eslint/eslint#15754)) (kmin-jeong) - [`f2c2d35`](eslint/eslint@f2c2d35) docs: disambiguate types `FormatterFunction` and `LoadedFormatter` ([#​15727](eslint/eslint#15727)) (Francesco Trotta) #### Chores - [`bb4c0d5`](eslint/eslint@bb4c0d5) chore: Refactor docs to work with docs.eslint.org ([#​15744](eslint/eslint#15744)) (Nicholas C. Zakas) - [`d36f12f`](eslint/eslint@d36f12f) chore: remove `lib/init` from eslint config ([#​15748](eslint/eslint#15748)) (Milos Djermanovic) - [`a59a4e6`](eslint/eslint@a59a4e6) chore: replace `trimLeft`/`trimRight` with `trimStart`/`trimEnd` ([#​15750](eslint/eslint#15750)) (Milos Djermanovic) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1296 Reviewed-by: crapStone <crapstone@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
srijan-deepsource
pushed a commit
to DeepSourceCorp/eslint
that referenced
this pull request
May 30, 2022
srijan-deepsource
added a commit
to DeepSourceCorp/eslint
that referenced
this pull request
May 30, 2022
eslint-github-bot
bot
added
the
archived due to age
This issue has been archived; please open a new issue for any further discussion
label
Oct 6, 2022
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
feature
This change adds a new feature to ESLint
rule
Relates to ESLint's core rules
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
This bug fix produces more warnings from the
no-eval
rule, and thus this change is marked asfeat
.Tell us about your environment:
What parser (default,
@babel/eslint-parser
,@typescript-eslint/parser
, etc.) are you using?default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue.
Online Demo
What did you expect to happen?
One
no-eval
error.In browsers, the above code alerts
foo
.Environment records for arrow functions do not have
this
binding. Forthis
from the above code, GetThisEnvironment returns the global environment, wherethis
is the global object. Arrow function being "strict" doesn't matter.What actually happened? Please include the actual, raw output from ESLint.
No errors.
What changes did you make? (Give an overview)
Fixed the
no-eval
rule to skip arrow functions when looking forthis
scopes.Is there anything you'd like reviewers to focus on?
This bug is not caused by the recent fix #15712. Previous versions had the same false negative.