Skip to content

Latest commit

 

History

History
77 lines (51 loc) · 1.33 KB

empty-func-parens.md

File metadata and controls

77 lines (51 loc) · 1.33 KB

coffee/empty-func-parens

This rule enforces or disallows the use of parentheses when defining a function with an empty parameter list

Options

This rule has a string option:

"coffee/empty-func-parens": ["error", "never"]
  • "never" (default) disallows parentheses for empty parameter lists
  • "always" requires parentheses for empty parameter lists

👎 Examples of incorrect code for this rule with the default "never" option:

###eslint coffee/empty-func-parens: ["error", "never"]###

() ->

() =>
  doSomething()
  
class A
  b: () ->
    c()

👍 Examples of correct code for this rule with the default "never" option:

###eslint coffee/empty-func-parens: ["error", "never"]###

->

=>
  doSomething()
  
class A
  b: ->
    c()

(a) -> a + 1

👎 Examples of incorrect code for this rule with the "always" option:

###eslint coffee/empty-func-parens: ["error", "always"]###

->

=>
  doSomething()
  
class A
  b: ->
    c()

👍 Examples of correct code for this rule with the "always" option:

###eslint coffee/empty-func-parens: ["error", "always"]###

() ->

() =>
  doSomething()
  
class A
  b: () ->
    c()
    
(a) -> a + 1