Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Fix: Add start and end propert to tokens (fixes #172) #176

Merged
merged 1 commit into from
Feb 26, 2017

Conversation

soda0289
Copy link
Member

Some eslint plugins except tokens to have start and end properties
instead of range. This commit adds those properties and modifies
the tests to ignore start and end property.

Some eslint plugins except tokens to have start and end properties
instead of range. This commit adds those properties and modifies
the tests to ignore start and end property.
@eslintbot
Copy link

LGTM

@JamesHenry
Copy link
Member

JamesHenry commented Feb 26, 2017

What is the motivation behind hiding them from the tests?

PS The commit has a typo in it

@soda0289
Copy link
Member Author

Well it would be a lot of work to rewrite every test. I have seen the tool we have that might help but there are still JSON tests that would need to have start and end inserted in every token node.

I looked at how espree handles this and copied the code from them.

Another way to not include them would be to add the property as non-enumerable and that way when we run JSON.stringify start and end property would not show up.

I could write a tool that could update the JSON tests and upadte the tool we have to update all the tests, not just the typescript ones.

Let me know if you think its worth it or if you think making the property non-enumerable is cleaner

@JamesHenry
Copy link
Member

Ah yes, I had forgotten about that! I think using espree's example is more than ok 😄

Thanks so much for providing PRs for the issues you find, it's so helpful!

Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I'll fix the typo in the commit when I merge

@JamesHenry JamesHenry merged commit c2a0b71 into eslint:master Feb 26, 2017
@soda0289 soda0289 deleted the fix-tokens-start-end branch May 23, 2017 13:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants