Eslint: no-undef mistakenly (?) claims 'Int32Array' is not defined

Created on 24 Oct 2016  路  3Comments  路  Source: eslint/eslint

Tell us about your environment

  • ESLint Version: v3.8.1
  • Node Version: v4.6.0
  • npm Version: 3.10.9

Selection or rules from .eslintrc.json:

    "extends": "eslint:recommended",
    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module",
        "ecmaFeatures": {
            "impliedStrict": true,
            "jsx": true,
            "experimentalObjectRestSpread": true
        }
    },
    "env": {
        "browser": true
    },

What did you do? What did you expect to happen? What actually happened?

See screenshot:

image

Spotted in VSCode 1.6.1, using ESlint plug-in.

Typed arrays are part of the ES6 standard, and I've set my environment to browser too, so I think this should not be triggering no-undef, right?

I did a quick search, it seems this issue has been raised and fixed in the past so somewhere a regression must have slipped in (or I'm screwing up my ESLint configuration somehow, that's of course also an option).

archived due to age question

Most helpful comment

Ah, right, adding this to env fixed it:

    "env": {
        "es6": true
    },

Apologies for the noise, thank you!

All 3 comments

Hey there, thanks for the issue. Unless part of the config above is missing, you'll also need to enable the es6 env for ES6 globals. Can you try that out and let us know if that fixes your issue?

Ah, right, adding this to env fixed it:

    "env": {
        "es6": true
    },

Apologies for the noise, thank you!

Happy to help :)

Was this page helpful?
0 / 5 - 0 ratings