A CoffeeLint rule that searches for specified regular expressions in code and fails when it founds them.
npm install coffeelint-forbidden-regex
Add the following entry to your coffeelint.json
file:
"forbidden_regex": {
"module": "coffeelint-forbidden-regex",
"level": "error",
"regexList": [
"sampleForbiddenRegex1",
"sampleForbiddenRegex2"
]
}
If you want to reject cosole.log
or console.err
calls, add it as forbidden regular expression for coffeelint:
"forbidden_regex": {
"module": "coffeelint-forbidden-regex",
"level": "error",
"regexList": [
"console\\.(log|err)"
]
}