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

max-len rule crash on empty files #525

Closed
dmp42 opened this Issue Jan 16, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@dmp42
Contributor

dmp42 commented Jan 16, 2014

TypeError: Cannot call method 'split' of null
    at EventEmitter.checkProgramForMaxLength (/Users/dmp/dev/jsboot/gulp-webitup/node_modules/gulp-eslint/node_modules/eslint/lib/rules/max-len.js

The reason apparently is that context.getSource(node) may return null if the file is empty.

@dmp42 dmp42 referenced this issue Jan 16, 2014

Closed

Fixing #525 #526

@michaelficarra

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

michaelficarra Jan 16, 2014

Member

That rule just needs a rewrite. stringRepeat looks completely broken. How did things get in that state?

Member

michaelficarra commented Jan 16, 2014

That rule just needs a rewrite. stringRepeat looks completely broken. How did things get in that state?

@dmp42

This comment has been minimized.

Show comment
Hide comment
@dmp42

dmp42 Jan 16, 2014

Contributor

Couldn't tell - I'm pretty new over here ;)
Would be glad to take a look though

Contributor

dmp42 commented Jan 16, 2014

Couldn't tell - I'm pretty new over here ;)
Would be glad to take a look though

@dmp42

This comment has been minimized.

Show comment
Hide comment
@dmp42

dmp42 Jan 16, 2014

Contributor

K, I rewrote stringRepeat. Do I create a new PR? Or just commit on top of the first one?

Contributor

dmp42 commented Jan 16, 2014

K, I rewrote stringRepeat. Do I create a new PR? Or just commit on top of the first one?

@dmp42

This comment has been minimized.

Show comment
Hide comment
@dmp42

dmp42 Jan 16, 2014

Contributor

Also, just noticing that the rule states that the first line should be called "line 0". Not so sure that's intentional? (though tests are checking for that, right now).

What's your take?

Contributor

dmp42 commented Jan 16, 2014

Also, just noticing that the rule states that the first line should be called "line 0". Not so sure that's intentional? (though tests are checking for that, right now).

What's your take?

@nzakas nzakas closed this in 4e05667 Jan 20, 2014

nzakas added a commit that referenced this issue Jan 20, 2014

@eslint eslint bot locked and limited conversation to collaborators Feb 7, 2018

@eslint eslint bot added the archived due to age label Feb 7, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.