Skip to content

Change "readable" to "readonly" and "writeable" to "writable" in new globals configuration #11359

Closed

Description

@nzakas

The version of ESLint you are using.

master

The problem you want to solve.

#11338 merged a change that allowed globals to be specified as "writeable" or "readable". I believe "readable" doesn't accurately convey the setting. All variables present in the environment are readable, including writable variables

Also, "writeable" is misspelled. It should be spelled "writable".

Your take on the correct solution to problem.

  1. Change "readable" to "readonly".
  2. Change "writeable" to "writable".

Are you willing to submit a pull request to implement this change?

Yes, if no one else wants to.

Activity

  1. added
    bugESLint is working incorrectly
    coreRelates to ESLint's core APIs and features
    evaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusion
    on Feb 6, 2019
  2. platinumazure commented on Feb 6, 2019

    @platinumazure
    Member

    I think the intention for "writeable" was to match the scope analysis property name, even though it is misspelled. (See this discussion for more info.)

    I'm okay with switching to "readonly".

  3. not-an-aardvark commented on Feb 6, 2019

    @not-an-aardvark
    Member

    Yes, the spelling of "writeable" is intentional (see #11338 (comment)). "Writeable" is a valid alternate spelling of the word "writable", although it is less common.

    "Readable" was also discussed in #9940 (comment).

  4. platinumazure commented on Feb 6, 2019

    @platinumazure
    Member

    @not-an-aardvark I don't think we really had consensus around "readable"-- it was offered as an option for consistency with writeable, but it wasn't ever really discussed one way or the other. Unfortunately, I didn't think to raise the question when reviewing the PR.

    I do like "readonly" (with no punctuation) better than "readable".

  5. edg2s commented on Feb 6, 2019

    @edg2s
    Contributor

    +1 to "readonly", as "readable" by itself doesn't mean "also, not writeable".

    Strictly speaking "writ(e)able" by itself doesn't mean "also readable", and so you could use "readwrite", but I think in context it is probably clear that writ(e)able variables are always readable.

  6. not-an-aardvark commented on Feb 6, 2019

    @not-an-aardvark
    Member

    At this point it doesn't seem ideal to bikeshed over names, given that the feature has already shipped and our options are limited by compatibility requirements.

    Personally, I think "readable" and "writeable" are sufficiently clear to imply the correct meaning. I have no objection to adding aliases like "readonly", "readwrite", and "writable", although I'm also not convinced that they're really needed, and they might just lead to more confusion if a user sees "readwrite" and "writable" in a config and assumes they mean something different.

    The potential for typos will be smaller if we disallow unexpected strings in this position in the next major release.

  7. added
    enhancementThis change enhances an existing feature of ESLint
    and removed
    bugESLint is working incorrectly
    on Feb 6, 2019
  8. not-an-aardvark commented on Feb 6, 2019

    @not-an-aardvark
    Member

    Relabeling as "enhancement" because the current behavior is working as intended.

  9. nzakas commented on Feb 8, 2019

    @nzakas
    MemberAuthor

    My apologies, I actually didn't realize this feature had shipped when I opened this issue.

    I understand the intention behind "writeable", but I also think that's significant cognitive overhead for end users (especially when I see red squigglies everywhere I type "writeable"), and I did think we had decided on "readonly" previously. I'm sorry I haven't been paying close enough attention to PRs as they come through, otherwise I wouldn't have mentioned all of this earlier. I'll do better in the future.

    What I'd like to suggest is that we:

    1. Add "readonly" as an alias for "readable"
    2. Add "writable" as an alias for "writeable"
    3. Change the docs to use "readonly" and "writable" while mentioning that "readable" and "writeable" are deprecated.
  10. not-an-aardvark commented on Feb 9, 2019

    @not-an-aardvark
    Member

    I'd slightly prefer adding "readonly" and "writable" as aliases rather than officially deprecating the existing versions (since we already have the scope analysis property called "writeable"), but I'm fine with that plan.

  11. self-assigned this
    on Feb 12, 2019
  12. added
    acceptedThere is consensus among the team that this change meets the criteria for inclusion
    and removed
    evaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusion
    on Feb 12, 2019
  13. nzakas commented on Feb 12, 2019

    @nzakas
    MemberAuthor

    Okay, looks like we have a general agreement about moving forward. I'll throw together a PR when I'm able.

  14. added a commit that references this issue on Feb 12, 2019
    3c471be
  15. locked and limited conversation to collaborators on Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussioncoreRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLint

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions