2 title: default-param-last
7 Putting default parameter at last allows function calls to omit optional tail arguments.
10 // Correct: optional argument can be omitted
11 function createUser(id, isAdmin = false) {}
14 // Incorrect: optional argument can **not** be omitted
15 function createUser(isAdmin = false, id) {}
16 createUser(undefined, "tabby")
21 This rule enforces default parameters to be the last of parameters.
23 Examples of **incorrect** code for this rule:
28 /* eslint default-param-last: ["error"] */
30 function f(a = 0, b) {}
32 function f(a, b = 0, c) {}
37 Examples of **correct** code for this rule:
42 /* eslint default-param-last: ["error"] */
44 function f(a, b = 0) {}