googlearchive / polylint

Lint polymer!
BSD 3-Clause "New" or "Revised" License
116 stars 19 forks source link

Unresolved import paths should be caught by linter #147

Open bendavis78 opened 7 years ago

bendavis78 commented 7 years ago

If an import path does not resolve to an existing file, the linter throws an exception, rather than logging a proper error message:

ERROR finding /home/ben/Projects/foo/foo-element.html
Error: ENOENT: no such file or directory, open '/home/Projects/foo/foo-element.html'
    at Error (native)

This makes it difficult to integrate the linter with IDEs that parse linter output (eg, vim+syntastic), since a missing file crashes the linter and all other errors and warnings are swallowed (also, the line/col is not reported).

The error should instead read:

my-app.html:4:0
    could not find file referenced in import 'foo-element.html'
justinfagnani commented 7 years ago

This will be fixed by the move to Polymer Analyzer