jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.97k stars 515 forks source link

TypeError: Cannot read property 'replace' of undefined #2243

Closed miguelmota closed 8 years ago

miguelmota commented 8 years ago

jscs doesn't work with es function bind syntax.

index.js

foo::bar()
$ jscs index.js

TypeError: Cannot read property 'replace' of undefined
    at renderLine (/Users/mota/.nvm/versions/node/v6.0.0/lib/node_modules/jscs/lib/errors.js:266:16)
    at Object.Errors.explainError (/Users/mota/.nvm/versions/node/v6.0.0/lib/node_modules/jscs/lib/errors.js:197:13)
    at /Users/mota/.nvm/versions/node/v6.0.0/lib/node_modules/jscs/lib/reporters/console.js:16:36
    at Array.forEach (native)
    at /Users/mota/.nvm/versions/node/v6.0.0/lib/node_modules/jscs/lib/reporters/console.js:14:35
    at Array.forEach (native)
    at Object.module.exports [as writer] (/Users/mota/.nvm/versions/node/v6.0.0/lib/node_modules/jscs/lib/reporters/cons
ole.js:9:22)
    at /Users/mota/.nvm/versions/node/v6.0.0/lib/node_modules/jscs/lib/cli.js:149:18
    at Array.<anonymous> (/Users/mota/.nvm/versions/node/v6.0.0/lib/node_modules/jscs/node_modules/vow/lib/vow.js:712:56
)
    at Immediate.callFns [as _onImmediate] (/Users/mota/.nvm/versions/node/v6.0.0/lib/node_modules/jscs/node_modules/vow
/lib/vow.js:23:35)
markelog commented 8 years ago

Need to add support for this in cst first - https://github.com/cst/cst/issues/117

markelog commented 8 years ago

Fixed via a215e672ad76270881bfc7252a954762119c48a3