Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

use let/const es6 syntax for, forin, forof #691

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrbbp
Copy link

@mrbbp mrbbp commented Feb 10, 2021

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

sorry first time,

i use the for, forin and for...of snippets but my linter configured to works with es6 is unhappy.
so i propose the change var to more contemporary variable declaration let and const

Alternate Designs

Benefits

more contemporary variable declaration

Possible Drawbacks

possibly confused for beginners

Applicable Issues

perhaps a prob with old navigator

@apicgg
Copy link

apicgg commented Dec 14, 2021

This makes sense. Thanks. @sadick254 Could you please merge this to master? It will be really helpful to have 'let' instead of 'var'.

icecream17 added a commit to icecream17/pulsar that referenced this pull request Oct 2, 2022
The non-tree sitter version is almost completely copied so nothing to say there.

There are some inconsistencies/missing operators in the tree-sitter version, for example:
- `this`
- `new.target`
- `import.meta`
- The keyword.operator order looks more wrong the more I look at it but that's for another day because of the possible scope regularity change in the future: atom/language-javascript#690
- btw atom/language-javascript#691 looks good to me I should probably do that

Even though tree-sitter will have some above changes I added the new operators (`** **= ?? &&= ||= ??= void`) anyway.
Well `void` is not new it's just missing.
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators for a list of operators. Of course while the comma is technically an operator, hopefully it's used more to separate elements in arrays or properties in objects.

Also `delete` is an operator not control.
@icecream17 icecream17 mentioned this pull request Oct 2, 2022
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants