Open Jarrydcrawford opened 8 years ago
I'm wondering if this has to do with the way eslint 3.x handles line numbers. Can you try this on eslint 2.x, and see if the error persists? If so, I'll cut an updated version that targets 3.x.
Tried creating a very isolated test case and it worked fine on both v3.x and v2.x so must be a combination of eslint plugins. I'll make a more specific test case and then let you know the results!
I just encountered this error. Using ESLint 3.19.0. It happened when we had an eol-last error that was in our code (Newline required at end of file but not found
). I figured that out by using @Jarrydcrawford's code sample that changes markers[line]
to markers[line - 1]
.
When I fixed the lint error in my code and reverted the change to eslint-plugin-ejs, ESLint ran properly.
Would an appropriate fix be to use markers[line - 1]
if markers[line]
is undefined
?
@jtmthf would you be open to a PR with my suggested fix?
I know this is old but we're encountering this as well.
happening to me as well
I was having some errors blow up in my Atom text editor specifically whenever I had syntax error on one of my JS files. Tried running eslint from the command line and the same issue surfaced:
node_modules/.bin/eslint path/to/file.js
Had a look at the offending portion of code in
node_modules/eslint-plugin-ejs/lib/processors/ejs.js
and reduced the index being applied tomarkers
by one:Fixed my issue but untested against other scenarios. Ran the tests from within the package but failed against my amend.
Mac OSX 10.11.6 running node v6.4.0 with the following packages involved:
.eslintrc
is as follows: