0.0.1 • Published 10 years ago
coffeelint-prefer-english-operator-streamline v0.0.1
coffeelint-prefer-english-operator-streamline
This is a custom rule for CoffeeLint extending prefer_english_operator to
allow Streamline.js futures syntax (!_).
It disallows use of symbolic operators such as ==, !=, &&, ||, and !.
Instead, it recommends using is, isnt, and, or, and not instead.
Double not !! is allowed by default for boolean coercion but can be disallowed
via doubleNotLevel configuration.
a is a # yes
a == a # no
a isnt a # yes
a != a # no
a and b # yes
a && b # no
a or b # yes
a || b # no
!!a # yes
not not a # yes
f !_ # yesHow to Install
- Run
npm install --save-dev coffeelint-prefer-english-operator-streamline.
How to Use
In your coffeelint.json, add
{
// other lint rules
"prefer_english_operator_streamline": {
"module": "coffeelint-prefer-english-operator-streamline",
"level": "error"
}
}and run coffeelint.
Acknowledgements
Forked from coffeelint-prefer-english-operator by @parakeety.
0.0.1
10 years ago