Class: NoThrowingStrings
Defined in: | node_modules/gulp-coffeelint/node_modules/coffeelint/src/rules/no_throwing_strings.coffee |
Variables Summary
- rule =
-
{ name: 'no_throwing_strings', level: 'error', message: 'Throwing strings is forbidden', description: "This rule forbids throwing string literals or interpolations. While\nJavaScript (and CoffeeScript by extension) allow any expression to\nbe thrown, it is best to only throw <a\nhref=\"https://developer.mozilla.org\n/en/JavaScript/Reference/Global_Objects/Error\"> Error</a> objects,\nbecause they contain valuable debugging information like the stack\ntrace. Because of JavaScript's dynamic nature, CoffeeLint cannot\nensure you are always throwing instances of <tt>Error</tt>. It will\nonly catch the simple but real case of throwing literal strings.\n<pre>\n<code># CoffeeLint will catch this:\nthrow \"i made a boo boo\"\n\nthrow getSomeString()\n</code>\n</pre>\nThis rule is enabled by default." }
- tokens =
-
['THROW']
Instance Method Summary
Instance Method Details
#
(void)
lintToken(token, tokenApi)