CoffeeLint plugin for prohibiting accessor with existential operator.
npm install coffeelint-no-accessor-existential-operatorWhen coffeescript transpile to ES2015(ES6) by transpiler(decaf, decaffeinate), accessor with existential operator is transpiled complex code.
Example:
``coffeescriptcoffeescript sample using accessor with existential operator
hoge?.fuga?.piyo()
I recommend fix coffeescript before transpile.
Install
`sh
$ npm install --save-dev coffeelint-no-accessor-existential-operator
`Usage
Put this in your coffeelint config
`json
{
"no_accessor_existential_operator": {
"module": "coffeelint-no-accessor-existential-operator"
}
}
`Examples
`coffeescript
Bad
hoge?.fuga
doit() if hoge?.fuga?Good (Note that following code not equals completely)
hoge.fuga if hoge?
doit() if hoge && hoge.fuga?
`Contributing
1. Fork it
2. Create your feature branch (
git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature`)