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

No more vars in Web/API #16662

Closed
wbamberg opened this issue May 25, 2022 · 4 comments · Fixed by #19344
Closed

No more vars in Web/API #16662

wbamberg opened this issue May 25, 2022 · 4 comments · Fixed by #19344
Assignees
Labels
Content:WebAPI Web API docs

Comments

@wbamberg
Copy link
Collaborator

wbamberg commented May 25, 2022

This is the companion to #16614, but for Web/API.

Here's a spreadsheet: https://docs.google.com/spreadsheets/d/1sl6gT8o-7yRPymZprwn6PNBRLQ6KNsKPFILLntsL7gk/edit#gid=0 listing all the pages under Web/API that use var .

We should replace usages of var with const or let as appropriate.

If you want to help, please add a comment here and request access to the spreadsheet. Once you have access:

  • claim some pages by adding your name in the "Fixer" column
  • file a PR to fix them. Please add a reference to this issue, but don't use "Fixes (this issue)" because that will auto-close this issue when he PR is merged.
  • once you have filed a PR, add a link to the PR in the "PR" column
  • once the PR is merged, add "Done" in the "Status" column

Note that:

  • some of these examples are copied from examples in separate GitHub repositories. In these cases it would be great to update those repos as well, so the examples are the same in both places.
  • our policy is to "use const when we can, let when we have to".
  • I'm happy to review other "modern JS" updates, like using for...of rather than for, and template literals, and arrow functions. But it's not needed at this point.
@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 25, 2022
@sideshowbarker sideshowbarker removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 25, 2022
@teoli2003 teoli2003 added good first issue A good issue for newcomers to get started with. help wanted If you know something about this topic, we would love your help! Content:WebAPI Web API docs labels May 26, 2022
@suryanva
Copy link
Contributor

suryanva commented May 26, 2022

Would love to help with few links as provided in the google sheet files, would add appropriate variable declaration using ES6.

@wbamberg
Copy link
Collaborator Author

Thank you @suryanva ! I added you to the sheet.

@PrajwalBorkar PrajwalBorkar mentioned this issue May 26, 2022
3 tasks
@wbamberg wbamberg reopened this May 26, 2022
@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 26, 2022
@sideshowbarker sideshowbarker removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 27, 2022
@sideshowbarker sideshowbarker removed good first issue A good issue for newcomers to get started with. help wanted If you know something about this topic, we would love your help! labels May 27, 2022
This was referenced May 27, 2022
@Abhiram-Gullapalli
Copy link
Contributor

I would like to work on this.

@Abhiram-Gullapalli
Copy link
Contributor

Since I've been working on this, I would like to ask for access to the google sheet.

lionralfs added a commit to lionralfs/content that referenced this issue Jul 27, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
lionralfs added a commit to lionralfs/content that referenced this issue Jul 27, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
teoli2003 added a commit that referenced this issue Jul 28, 2022
* no more vars in Web/API

* See #16662
* See https://github.com/mdn/content/discussions/10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'

* Apply suggestions from code review

Co-authored-by: Jean-Yves Perrier <[email protected]>

* use AudioContext directly

* Update files/en-us/web/api/audiocontext/index.md

Co-authored-by: Jean-Yves Perrier <[email protected]>

Co-authored-by: Jean-Yves Perrier <[email protected]>
teoli2003 added a commit that referenced this issue Jul 28, 2022
* no more vars in Web/API

* See #16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'

* split var declarations into 2 lines, rename them

* Apply suggestions from code review

Co-authored-by: rubiesonthesky <[email protected]>

* keep var in polyfills

* Apply suggestions from code review

Co-authored-by: Jean-Yves Perrier <[email protected]>

Co-authored-by: rubiesonthesky <[email protected]>
Co-authored-by: Jean-Yves Perrier <[email protected]>
teoli2003 added a commit that referenced this issue Jul 28, 2022
* no more vars in Web/API

* See #16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'

* Apply suggestions from code review

Co-authored-by: Jean-Yves Perrier <[email protected]>

* Update files/en-us/web/api/element/outerhtml/index.md

Co-authored-by: Joshua Chen <[email protected]>

Co-authored-by: Jean-Yves Perrier <[email protected]>
Co-authored-by: Joshua Chen <[email protected]>
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
teoli2003 added a commit that referenced this issue Jul 28, 2022
* no more vars in Web/API

* See #16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'

* revert unrelated changes

* space before loop opening parenthesis

* two more

* Use switch

* Apply suggestions from code review

Co-authored-by: Jean-Yves Perrier <[email protected]>

Co-authored-by: Jean-Yves Perrier <[email protected]>
teoli2003 added a commit that referenced this issue Jul 28, 2022
* no more vars in Web/API

* See #16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'

* Apply suggestions from code review

Co-authored-by: Jean-Yves Perrier <[email protected]>

Co-authored-by: Jean-Yves Perrier <[email protected]>
teoli2003 added a commit that referenced this issue Jul 28, 2022
* no more vars in Web/API

* See #16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'

* Apply suggestions from code review

Co-authored-by: Jean-Yves Perrier <[email protected]>

* Update files/en-us/web/api/webgl2renderingcontext/getactiveuniformblockparameter/index.md

Co-authored-by: Jean-Yves Perrier <[email protected]>

Co-authored-by: Jean-Yves Perrier <[email protected]>
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
lionralfs added a commit to lionralfs/content that referenced this issue Jul 28, 2022
* See mdn#16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
teoli2003 added a commit that referenced this issue Jul 28, 2022
* no more vars in Web/API

* See #16662
* See #10389
* See https://github.com/orgs/mdn/discussions/143
* Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'

* Remove workaround for pre IE11

* Remove pre-IE9 workaround

* Apply suggestions from code review

Co-authored-by: Jean-Yves Perrier <[email protected]>

* Update files/en-us/web/api/wheelevent/deltamode/index.md

Co-authored-by: Jean-Yves Perrier <[email protected]>

Co-authored-by: Jean-Yves Perrier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants