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

System not detected as an undefined variable #9614

Closed
adamreisnz opened this issue Nov 11, 2017 · 2 comments · Fixed by #9632
Closed

System not detected as an undefined variable #9614

adamreisnz opened this issue Nov 11, 2017 · 2 comments · Fixed by #9632
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly

Comments

@adamreisnz
Copy link

Tell us about your environment

  • ESLint Version: 4.11.0
  • Node Version: 8.6.0

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

Please show your full configuration:

Configuration
root: true
extends: eslint:recommended
parserOptions:
  ecmaVersion: 2017
  ecmaFeatures:
    impliedStrict: true
  sourceType: module
env:
  es6: true
  node: true
  mocha: true
  jasmine: true
rules:
  linebreak-style:
    - error
    - unix
  max-len:
    - warn
    - code: 80
      tabWidth: 2
      ignoreComments: true
      ignoreUrls: true
      ignoreTemplateLiterals: true
      ignoreRegExpLiterals: true
      ignorePattern: require\('
  indent:
    - error
    - 2
    - SwitchCase: 1
      VariableDeclarator:
        let: 2
        const: 3
      MemberExpression: off
  semi:
    - error
    - always
  consistent-this:
    - error
    - self
    - $ctrl
  quotes:
    - error
    - single
    - allowTemplateLiterals: true
  quote-props:
    - error
    - as-needed
  curly:
    - error
    - all
  comma-dangle:
    - error
    - always-multiline
  new-cap:
    - error
    - newIsCap: true
      capIsNew: true
      properties: false
  camelcase:
    - error
    - properties: never
  array-bracket-spacing:
    - error
    - never
  arrow-spacing:
    - error
    - before: true
      after: true
  block-spacing:
    - error
    - always
  comma-spacing:
    - error
    - before: false
      after: true
  computed-property-spacing:
    - error
    - never
  generator-star-spacing:
    - error
    - before: true
      after: false
  key-spacing:
    - error
    - beforeColon: false
      afterColon: true
      mode: minimum
  keyword-spacing:
    - error
    - before: true
  semi-spacing:
    - error
    - before: false
      after: true
  space-in-parens:
    - error
    - never
  space-unary-ops:
    - error
    - words: true
      nonwords: false
  space-before-function-paren:
    - error
    - anonymous: never
      named: never
      asyncArrow: always
  space-before-blocks:
    - error
    - always
  yoda:
    - error
    - never
  wrap-iife:
    - error
    - outside
  eqeqeq:
    - error
    - always
  newline-per-chained-call:
    - error
    - ignoreChainWithDepth: 3
  one-var-declaration-per-line:
    - error
    - initializations
  brace-style:
    - error
    - stroustrup
  no-implicit-coercion:
    - error
    - boolean: false
  no-global-assign:
    - error
    - exceptions:
        - Promise
  eol-last: error
  dot-notation: error
  space-infix-ops: error
  no-with: error
  no-unreachable: error
  no-redeclare: error
  no-unexpected-multiline: error
  no-multi-spaces: error
  no-multi-str: error
  no-trailing-spaces: error
  no-mixed-spaces-and-tabs: error
  no-spaced-func: error
  no-whitespace-before-property: error
  no-unsafe-negation: error
  no-lonely-if: error
  no-var: error
  no-console: off

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

console.log(System);
console.log(Blah);

(in test.js)

eslint test.js

What did you expect to happen?
I expect to see two errors;

  1. 'System' is not defined
  2. 'Blah' is not defined

What actually happened? Please include the actual, raw output from ESLint.
Only one error is shown:

  3:13  error  'Blah' is not defined  no-undef

✖ 1 problem (1 error, 0 warnings)

I've tried this across many files -- for some reason it doesn't flag System as an undefined variable, ever. I looked to see if I had it defined as a global, or if it was defined as a global in the recommended preset, but it wasn't. It's also not a global in Node, and the output of the console log is undefined.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Nov 11, 2017
@mysticatea mysticatea added accepted There is consensus among the team that this change meets the criteria for inclusion blocked This change can't be completed until another issue is resolved bug ESLint is working incorrectly and removed triage An ESLint team member will look at this issue soon labels Nov 11, 2017
@mysticatea
Copy link
Member

Thank you for the report.

It seems a problem of an upstream package, globals seems to have System in builtin group:

https://github.com/sindresorhus/globals/blob/1de990c1a2473cb58040704c24e1f6a58655b6b8/globals.json#L49

@mysticatea mysticatea removed the blocked This change can't be completed until another issue is resolved label Nov 17, 2017
not-an-aardvark pushed a commit that referenced this issue Nov 26, 2017
* Upgrade: `globals` to 11.0.1 (fixes #9614)

* revive deleted globals
@adamreisnz
Copy link
Author

🎉

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators May 26, 2018
@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 May 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants