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

Breaking: Decorator ESTree compliance, always convert (fixes #250) #293

Merged
merged 1 commit into from
May 28, 2017

Conversation

JamesHenry
Copy link
Member

(convertDecorators had to be moved purely to comply with "no use before define" rule)

@JamesHenry JamesHenry requested a review from soda0289 May 25, 2017 10:12
@JamesHenry JamesHenry force-pushed the decorator-fix branch 2 times, most recently from 045afc5 to 2cadbe4 Compare May 25, 2017 10:50
@eslintbot
Copy link

LGTM

@JamesHenry JamesHenry changed the title Fix: Always convert any decorators in deeplyCopy (fixes #250) Breaking: Decorator ESTree compliance, always convert (fixes #250) May 25, 2017
@JamesHenry
Copy link
Member Author

I have updated the PR to both fix our ESTree compliance, and ensure conversion during deeplyCopy().

Importantly, I also took this opportunity to "fix" tools/update-typescript-tests.js so that it is actually useful 😄

https://github.com/eslint/typescript-eslint-parser/pull/293/files#diff-7074ce236b7ec2f768cbd30e59304265

It will now use the same assertion logic as the tests, and only perform a write to an existing result file if the assert fails.

function outputResult(result, testResultFilename) {
shelljs.echo("module.exports = " + JSON.stringify(result, null, " ") + ";").to(testResultFilename);
shelljs.echo(`module.exports = ${JSON.stringify(result, null, " ")};`).to(testResultFilename);
Copy link
Member

Choose a reason for hiding this comment

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

I thought about using this tool but sometimes it will generate JSON objects that are inconsistent or change for no reason. By adding the deep equal assertion it does prevent updating every file but maybe we should make the stringifyed JSON output consistent. We can use a tool like this: https://github.com/substack/json-stable-stringify to sort the output keys. This could be done later just a thought.

@eslintbot
Copy link

LGTM

@JamesHenry
Copy link
Member Author

Rebased this, will merge once it has built

@JamesHenry JamesHenry merged commit 8744577 into master May 28, 2017
@JamesHenry JamesHenry deleted the decorator-fix branch May 28, 2017 22:05
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