Skip to content
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(getStaticValue): Dereference variables that are effectively const #80

Merged
merged 3 commits into from
Mar 24, 2023

Conversation

RunDevelopment
Copy link

getStaticValue dereferences const variables. This restriction is necessary as the static execution model would have to be a lot more complex to account for variable mutation. However, this means that it's also fine to deference var and let variables that are never re-assigned (directly via foo = vaue or indirectly via e.g. foo++).

This PR allows referencing all variables that aren't re-assigned (= effectively const).

@RunDevelopment RunDevelopment changed the title Dereference variables that are effectively const Dereference variables that are effectively const in getStaticValue Mar 19, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 19, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03 🎉

Comparison is base (80b934e) 96.93% compared to head (60b63c2) 96.97%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #80      +/-   ##
==========================================
+ Coverage   96.93%   96.97%   +0.03%     
==========================================
  Files          13       13              
  Lines        2090     2114      +24     
  Branches      388      396       +8     
==========================================
+ Hits         2026     2050      +24     
  Misses         63       63              
  Partials        1        1              
Impacted Files Coverage Δ
src/get-static-value.mjs 97.50% <100.00%> (+0.09%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

src/get-static-value.mjs Outdated Show resolved Hide resolved
@ota-meshi ota-meshi changed the title Dereference variables that are effectively const in getStaticValue feat(getStaticValue): Dereference variables that are effectively const Mar 20, 2023
@ota-meshi ota-meshi merged commit 0540eb3 into eslint-community:main Mar 24, 2023
@github-actions
Copy link

🎉 This PR is included in version 4.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@RunDevelopment RunDevelopment deleted the effectively-const branch March 24, 2023 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants