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

runner promise to be fullfilled with file counters #69

Closed
wants to merge 2 commits into from

Conversation

caridy
Copy link
Contributor

@caridy caridy commented Nov 7, 2015

Runner.run(
          transformer,
          files,
          opts
).then(function (result) {
          // this promise was always throwing, and result was not reacheable
})

@@ -154,7 +154,7 @@ function run(transformFile, paths, options) {
endTime[0],
(endTime[1]/1000000).toFixed(0)
);
resolve();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolve is not callable, it is just the array with the results of pendingWorkers promises.

resolving to fileCounters seems more useful when runner is called programmatically instead of via CLI.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for that! Could you please also remove resolve from the function signature, to avoid confusion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@fkling
Copy link
Contributor

fkling commented Nov 18, 2015

Added with 3527f7c (I squashed the commits) and published with v0.3.9 .

@fkling fkling closed this Nov 18, 2015
@caridy caridy deleted the runner-promise-resolution branch November 18, 2015 01:03
@caridy
Copy link
Contributor Author

caridy commented Nov 18, 2015

awesome, thanks!

euphocat pushed a commit to euphocat/jscodeshift that referenced this pull request Oct 22, 2017
* sort-comp instantiates regex from eslintrc properly

This fixes the issue where react/sort-comp eslint rules such as `"/^render+.$/"` are incorrectly converted to `/\/^render.+$\//` rather than `/^render.+$/`

* convert actual regex to strings (like how it is in .eslintrc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants