coffeelint-no-accessor-existential-operator
CoffeeLint plugin for prohibiting accessor with existential operator.
When coffeescript transpile to ES2015(ES6) by transpiler(decaf, decaffeinate), accessor with existential operator is transpiled complex code.
Example:
# coffeescript sample using accessor with existential operator hoge?fuga?piyo # transpiled JS by decaf var ref;typeof hoge !== "undefined" && hoge !== null ? ref = hogefuga != null ? refpiyo : void 0 : void 0;
I recommend fix coffeescript before transpile.
Install
$ npm install --save-dev coffeelint-no-accessor-existential-operator
Usage
Put this in your coffeelint config
Examples
# Bad hoge?fugadoit if hoge?fuga? # Good (Note that following code not equals completely) hogefuga if hoge?doit if hoge && hogefuga?
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request