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

Linter fails because some rules only expect specific format as input #196

Closed
devconcept opened this issue Apr 13, 2017 · 1 comment
Closed

Comments

@devconcept
Copy link

devconcept commented Apr 13, 2017

The Issue constructor expect some arguments in order like code, position and additional data. Some rules expect some specific format for the input and this causes sometimes the Linter to fail with the error

Cannot read property 0 of undefined

Here is an example:

For the input "foobar" which is obviously wrong html input, the Linter parse it as one text node.

If you apply the doctype-first rule, it will detect the error and create a new E007 issue but the text node does not have an openLineCol property because is not an element. This causes undefined to be passed as the pos argument causing the failure later at the issue constructor.

function Issue(code, pos, data) {
    // Here pos is undefined
    this.line = pos[0];
    this.column = pos[1];
    this.code = code;
    this.data = data || {};
}
@mlochbaum
Copy link
Member

Similar problem to #205. I'm starting to think that using openLineCol for tags and lineCol for other elements is a bad idea...

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

2 participants