Skip to content

rustdoc: replace var with const and let in JS #93058

Closed
@jsha

Description

@jsha

Now that rustdoc is using ES6 idioms, we should replace all var declarations with const and let. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-jsArea: Rustdoc's JS front-endT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions