jshint / fixmyjs

Automatically fix silly lint errors.
http://fixmyjs.com
Other
971 stars 78 forks source link

How to call for a diff instead of a fix #136

Closed brunoais closed 9 years ago

brunoais commented 9 years ago

This tool seems to be very useful but I don't want it to change my code, instead, I want to get what it suggested to change based on the jshint/jslint complaints and then I perform the changes myself. Which method should I call? I can only see the .fix() method.

goatslacker commented 9 years ago

if you use the included "binary" on a cli you can pass in --diff but I don't think there's a programatic way of doing that. I welcome PRs

brunoais commented 9 years ago

Where's the diff? I can see a require function for it but I don't see the file.

goatslacker commented 9 years ago

https://github.com/jshint/fixmyjs/blob/master/lib/cli.js#L64

brunoais commented 9 years ago

That's not what I'm looking for. I'm looking for the diff itself.

goatslacker commented 9 years ago

what do you mean?

brunoais commented 9 years ago

You require diff here: https://github.com/jshint/fixmyjs/blob/master/lib/cli.js#L2 Right? Where is it?

brunoais commented 9 years ago

Is it this one? https://www.npmjs.com/package/node-diff Maybe this one? https://www.npmjs.com/package/diff

goatslacker commented 9 years ago

It's where I linked to. In that function itself.

goatslacker commented 9 years ago

The package name is in the package json https://github.com/jshint/fixmyjs/blob/master/package.json

brunoais commented 9 years ago

Oh right... I forgot package.json. Thank you.

brunoais commented 9 years ago

I thought this had been closed because someone was doing it. Did I understand it wrong?

goatslacker commented 9 years ago

Sorry I thought you just had a question about which package was being used.

brunoais commented 9 years ago

That was just part of a stream of questions :D. I'll look into the code and find what I want, then.

brunoais commented 9 years ago

I've been unable to find time for this. I'll try finding some asap.

brunoais commented 9 years ago

I'm having rl issues and there has been many change of plans that I don't control. I'll reopen if I can find back the time I need to work with this.