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

Errors without a line/col throw exception #89

Closed
postcasio opened this issue Jun 10, 2014 · 0 comments
Closed

Errors without a line/col throw exception #89

postcasio opened this issue Jun 10, 2014 · 0 comments

Comments

@postcasio
Copy link

Uncaught TypeError: Cannot call method 'tokenAtBufferColumn' of undefined

Similar to the issue with some linters returning line 0, some linters do not return any position information at all for some errors. e.g. csslint has a few rules:

https://github.com/CSSLint/csslint/blob/master/src/rules/important.js
https://github.com/CSSLint/csslint/blob/master/src/rules/font-sizes.js

The error occurs here: https://github.com/AtomLinter/Linter/blob/master/lib/linter.coffee#L190

The calculated rowStart ends up being NaN due to the undefined lineStart and line properties. Changing to:

rowStart = parseInt(match.lineStart ? match.line ? 0) - 1

Seems to fix it but I'm not sure if this breaks anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants