sproutsocial / es6-import-validate

A simple ES6 Harmony Module import statement validator
MIT License
6 stars 1 forks source link

Throw an Error which contains the filePath when parsing fails #10

Closed simonexmachina closed 10 years ago

simonexmachina commented 10 years ago

...so that developer has some idea where it came from.

jgable commented 10 years ago

Thanks for the PR. I think it's a little aggressive to wrap that much code in a try/catch. Why not try to figure out the most likely place an error will be thrown and just limit it to that. Like, in the getContentsSyntaxTree function where the esprima.parse() call is.

jgable commented 10 years ago

Covered this in 215f32c and added a unit test. Published as 0.0.10. Thanks for the suggestion to add this and for the original PR.

simonexmachina commented 10 years ago

Thanks.

simonexmachina commented 10 years ago

@jgable would you please update this in broccoli-es6-import-validate so I can send a PR to update in ember-cli. Thanks.

jgable commented 10 years ago

All you have to do is run npm update and it will update the version you have installed. If you're installing from new, it should install the latest.

The magic of correctly used semantic versioning.

simonexmachina commented 10 years ago

Ah yes! Good point :)​