@coffeelint/cli
Version:
Lint your CoffeeScript
40 lines (31 loc) • 896 B
JavaScript
(function() {
var NoEmptyParamList;
module.exports = NoEmptyParamList = (function() {
class NoEmptyParamList {
lintToken(token, tokenApi) {
var nextType;
nextType = tokenApi.peek()[0];
if (nextType === 'PARAM_END') {
return {token};
}
}
};
NoEmptyParamList.prototype.rule = {
type: 'style',
name: 'no_empty_param_list',
level: 'ignore',
message: 'Empty parameter list is forbidden',
description: `This rule prohibits empty parameter lists in function definitions.
<pre>
<code># The empty parameter list in here is unnecessary:
myFunction = () ->
# We might favor this instead:
myFunction = ->
</code>
</pre>
Empty parameter lists are permitted by default.`
};
NoEmptyParamList.prototype.tokens = ['PARAM_START'];
return NoEmptyParamList;
}).call(this);
}).call(this);