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

Redefinition of 'Map' #171

Closed
LinusU opened this issue Jun 24, 2015 · 3 comments

Comments

@LinusU
Copy link
Member

commented Jun 24, 2015

Node.js dosen't ship with Map from ES6 so I'm using a standalone library to provide it. It seems like standard thinks that Map already exists in the global scope since it gives me back the following error.

/path/to/filename.js:1:4: Redefinition of 'Map'.

This is my code:

let Map = require('es6-map')
@feross

This comment has been minimized.

Copy link
Member

commented Jun 24, 2015

In general, this rule is a good thing. It prevents you from redefining Array and other built-ins. You can selectively disable this rule for your situation. Run standard --verbose to find out the rule name (no-native-reassign).

You can disable the specific rule like this:

let Map = require('es6-map') // eslint-disable-line no-native-reassign

Or more succinctly disable all checking on this line, like this:

let Map = require('es6-map') // eslint-disable-line

@feross feross closed this Jun 24, 2015

@dcousens

This comment has been minimized.

Copy link
Member

commented Jun 25, 2015

@LinusU this is because, conceptually, you are overriding the Map built in, its just that you don't have that built in... yet.

@LinusU

This comment has been minimized.

Copy link
Member Author

commented Jun 25, 2015

Sounds fair enough

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.