-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustdoc: replace var
with const
and let
in JS
#93058
Comments
I'll do it once I'm done with #90630. |
Shouldn't the JS also be changed to strict mode to ensure that all variables actually are declared via keywords? |
Switch JS code to ES6 Considering it's already quite big, I'll do the remaining files in another PR. Part of rust-lang#93058. r? `@notriddle`
Switch JS code to ES6 Considering it's already quite big, I'll do the remaining files in another PR. Part of rust-lang#93058. r? ``@notriddle``
Switch JS code to ES6 Considering it's already quite big, I'll do the remaining files in another PR. Part of rust-lang#93058. r? ```@notriddle```
Switch JS code to ES6 Considering it's already quite big, I'll do the remaining files in another PR. Part of rust-lang#93058. r? ````@notriddle````
Switch JS code to ES6 Considering it's already quite big, I'll do the remaining files in another PR. Part of rust-lang#93058. r? `@notriddle`
Switch JS code to ES6 Considering it's already quite big, I'll do the remaining files in another PR. Part of rust-lang#93058. r? ``@notriddle``
Switch JS code to ES6 - part 2 Part of rust-lang#93058. It's based on rust-lang#96361 so it needs to wait for it to be merged first. r? `@notriddle`
Then pick one thing and go ahead. :) |
Ok, I pick this one.
|
Then I'll do "use strict" next. |
Move callback to the () => {} syntax. Part of rust-lang#93058. r? `@GuillaumeGomez`
…triddle Use "strict" mode in JS scripts Part of rust-lang#93058. r? `@notriddle`
@Folyd Now remains adding more eslint lints. Let's go one at a time. What do you think? If you're interested, just write down which one you're adding here so that we don't conflict. ;) |
I just file a new PR to change the way we declare the lint rules. #96805 |
…iddle Add more eslint rules Slowly continuing to enforce more rules with eslint. Part of rust-lang#93058. r? `@notriddle`
This issue is done so closing it. |
Now that rustdoc is using ES6 idioms, we should replace all
var
declarations withconst
andlet
. This style guideline explains why: https://github.com/airbnb/javascript#references. Once that's done, we should turn on the lint checks that enforce it.I think there are a few places (at least in search.js) where we rely on the surprising property of var declarations called "var hoisting". In those cases we may to move some declarations to the top of their function at the same time we change them to
let
.The text was updated successfully, but these errors were encountered: