sproutsocial/grunt-es6-import-validate — pull request #4 by abarax (2014-03-31 05:02:50+00:00)
Title: Better display javascript parse errors

This pull request just makes it clearer to the end user that something went wrong with the parsing of the import and export statements and not an actual import validation error.

It also doesn't make it look like the grunt plugin itself is broken which is what I (naively) initially thought :-)

If there is a javascript parse error the exception displayed in the grunt plugin is this:

Possibly unhandled TypeError: Object Error: Line 1: Unexpected identifier has no method 'forEach'
at .../..../node_modules/grunt-es6-import-validate/tasks/validate.js:60:12

Signifying that it was not actually an array or errors that was returned but a single error that looks like this being seen in the underlying 'es6-import-validate' module:

{ [Error: Line 3: Missing from after import]
index: 42,
lineNumber: 3,
column: 16,
description: 'Missing from after import' }

I think this is from the parsing framework 'esprima'.

The real error might caused by something like this:

immport Foo from 'bar'