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

Question, perhaps a bug, on inline source implementation: global vs globals #12128

Closed
Martii opened this issue Aug 19, 2019 · 2 comments
Closed
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation question This issue asks a question about ESLint

Comments

@Martii
Copy link

Martii commented Aug 19, 2019

Tell us about your environment

  • ESLint Version: Any
  • Node Version: Any
  • npm Version: Any

What parser (default, Babel-ESLint, etc.) are you using?

Please show your full configuration:

Configuration

n/a and defaults in packages

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

/* global someGlobal */

vs.

/* globals someGlobal */

n/a

What did you expect to happen?

Trying to develop some consistency between all the linters to code against. I have noticed that ESLint doesn't seem to care on pluralization as do other linters (could be wrong but this is what some packages, extensions, and add-ons seem to be doing quietly for compatibility).

What actually happened? Please include the actual, raw output from ESLint.

When using either global or globals inline comments in source the warning triangles go away in those packages, extensions, and/or add-ons.

Appreciate the clarity here on which one to use for ESLint so we can know what to expect (i.e. best practice as the docs have). 😄

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Aug 19, 2019
@platinumazure platinumazure added documentation Relates to ESLint's documentation question This issue asks a question about ESLint and removed triage An ESLint team member will look at this issue soon labels Aug 19, 2019
@platinumazure
Copy link
Member

platinumazure commented Aug 19, 2019

Hi @Martii, thanks for the issue.

Our global configuration documentation recommends the use of /* global */. However, I think we support both /* global */ and /* globals */ for historical/compatibility reasons.

@Martii
Copy link
Author

Martii commented Aug 20, 2019

@platinumazure

Awesome. Thank you for taking a moment to explain it.

Hmmm seems to do this compatibility also at the demo site with de/pluralization with:

switch (someId) {
  case 1:
    // does something
    /* falls through */
  case 2:
    //does something more
    /* falls through */
  default:
    // does something even more
}

vs

switch (someId) {
  case 1:
    // does something
    /* fall through */
  case 2:
    //does something more
    /* fall through */
  default:
    // does something even more

This makes it a bit easier. 👍

Alright we'll look for more compatibility use cases and adjust accordingly when needed. Thank you again. 😄

@Martii Martii closed this as completed Aug 20, 2019
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 17, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation question This issue asks a question about ESLint
Projects
None yet
Development

No branches or pull requests

2 participants