brenolf / polyjuice

A utility to convert JSHint and JSCS files into ESLint files and vice-versa
MIT License
275 stars 15 forks source link

TypeError: Cannot read property 'indexOf' of undefined #13

Closed kokarn closed 9 years ago

kokarn commented 9 years ago

Hello! This looks great but i'm unable to convert my jscs.

polyjuice --jscs=.jscsrc > .eslintrc

Gives me this error

/usr/local/lib/node_modules/polyjuice/lib/dictionaries/jscs.js:534
      if (value.allExcept.indexOf('{') > -1) {
                         ^
TypeError: Cannot read property 'indexOf' of undefined
    at Object.module.exports.requireSpacesInsideArrayBrackets._truthy (/usr/local/lib/node_modules/polyjuice/lib/dictionaries/jscs.js:534:26)
    at get (/usr/local/lib/node_modules/polyjuice/lib/polyjuice/reader.js:59:37)
    at module.exports (/usr/local/lib/node_modules/polyjuice/lib/polyjuice/interpreter.js:26:24)
    at Object.module.exports [as jscs] (/usr/local/lib/node_modules/polyjuice/lib/polyjuice/jscs.js:21:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/polyjuice/lib/bin.js:40:27)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)

This is the .jscsrc file i'm tryint to convert https://gist.github.com/kokarn/d41147c9526b5933c538

Thanks!

brenolf commented 9 years ago

Thanks :smile: I'll take a look soon

kokarn commented 9 years ago

No problem! I only think this will get more and more attention now that eslint is stable :-)

On Fri, Aug 28, 2015, 16:03 Breno Lima de Freitas notifications@github.com wrote:

Thanks :D I'll take a look soon

— Reply to this email directly or view it on GitHub https://github.com/brenolf/polyjuice/issues/13#issuecomment-135782299.

brenolf commented 9 years ago

Done :+1: I need to review the conversions for JSCS and write tests for it yet :confounded:

Also, I plan to add support to ESLint to JSHint/JSCS conversion soon

kokarn commented 9 years ago

Great! Seems to work fine. Will test first thing monday morning if it for some reason spits out invalid rules.

Thanks for the quick help!