This rule requires or disallows usage of specific boolean keywords
🔧 The --fix
option on the command line
can automatically fix some of the problems reported by this rule.
This rule has a required object option:
"coffee/boolean-keywords": ["error", {"allow": ["yes", "no"]}]
Either:
- "allow": a list of which boolean keywords are allowed
- "disallow": a list of which boolean keywords are not allowed
###eslint coffee/boolean-keywords: ["error", {"allow": ["yes", "no"]}]###
a is true
someFunction(on)
b = false if c()
off
###eslint coffee/boolean-keywords: ["error", {"allow": ["yes", "no", "on", "off"]}]###
x = true
y or false
###eslint coffee/boolean-keywords: ["error", {"allow": ["true", "false"]}]###
someFunction(on)
off
yes if b
c = no
###eslint coffee/boolean-keywords: ["error", {"allow": ["yes", "no", "on", "off"]}]###
a is yes
b = no if c()
someSetting = on
someOtherSetting = off
###eslint coffee/boolean-keywords: ["error", {"disallow": ["yes", "no"]}]###
a is yes
b = no if c()
###eslint coffee/boolean-keywords: ["error", {"disallow": ["true", "false"]}]###
x = true
y or false
###eslint coffee/boolean-keywords: ["error", {"disallow": ["yes", "no"]}]###
a is true
y or false
someSetting = on
someOtherSetting = off