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

toString #3

Closed
es128 opened this issue Nov 21, 2014 · 7 comments
Closed

toString #3

es128 opened this issue Nov 21, 2014 · 7 comments

Comments

@es128
Copy link
Collaborator

es128 commented Nov 21, 2014

jshint/jshint#1827

Even though it isn't technically a global, would you consider adding toString to this list?

For context, I'm trying to use this module to avoid problems while manipulating identifiers in an AST. toString treated like a global is a case where this is failing.

@sindresorhus
Copy link
Owner

If it's added to the JSHint or ESLint list I'm happy to add it here, but it's better to do the discussion about it on their issue trackers.

Tip: Try the ESLint issue tracker.

Make sure to comment with a link to the issue.

@es128
Copy link
Collaborator Author

es128 commented Nov 22, 2014

Actually I think they have legit reasons to exclude it, as discussed in the thread I linked. But since it is in use in the wild and is generally valid, I was hoping that you'd agree it makes sense to include here even if they don't.

I'm not sure what use cases you had in mind for this repo, but for my use case including toString is necessary.

@sindresorhus
Copy link
Owner

I'm not sure what use cases you had in mind for this repo, but for my use case including toString is necessary.

Why? Some use-cases might convince me otherwise.

@michaelficarra
Copy link
Contributor

eslint already includes the Object.prototype members in the globals list, as it should: https://github.com/eslint/eslint/blob/7504aff1d6795a332054e3ce93f75fdcd9142d19/conf/environments.json#L52-L58

@es128
Copy link
Collaborator Author

es128 commented Nov 22, 2014

I'm making a transpiler tool that manipulates js identifiers. It needs to avoid messing with globals or anything global-like, otherwise the output scripts will throw errors or otherwise not be functionally equivalent to the input.

I'll be open-sourcing it soon, so you'll be able to see exactly what I mean. Want to polish it up a bit more first.

I was starting to create my own list of reserved identifiers, then thought it'd make sense to make that its own repo/module, then found this one.

@es128
Copy link
Collaborator Author

es128 commented Nov 22, 2014

Ah, thanks @michaelficarra! Definitely will need to do the review to find what else is missing here.

But differences like this are the reason I wouldn't hold my breath waiting for jshint and eslint to adopt the same list.

@sindresorhus
Copy link
Owner

I'm fine with going with whatever ESLint has.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants