Skip to content

Commit 973adeb

Browse files
thenaeshkaicataldo
authored andcommitted
Docs: State that functions option only applies in ES2017 (fixes #7809) (#8468)
Add documentation for the comma-dangle rule that states that requiring trailing commas in parameter lists may cause errors in pre-ES2017 code.
1 parent 7bc6fe0 commit 973adeb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/rules/comma-dangle.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ The default for each option is `"never"` unless otherwise specified.
6868
* `objects` is for object literals and object patterns of destructuring. (e.g. `let {a,} = {a: 1};`)
6969
* `imports` is for import declarations of ES Modules. (e.g. `import {a,} from "foo";`)
7070
* `exports` is for export declarations of ES Modules. (e.g. `export {a,};`)
71-
* `functions` is for function declarations and function calls. (e.g. `(function(a,){ })(b,);`)<br>
72-
`functions` is set to `"ignore"` by default for consistency with the string option.
71+
* `functions` is for function declarations and function calls. (e.g. `(function(a,){ })(b,);`)
72+
* `functions` is set to `"ignore"` by default for consistency with the string option.
73+
* `functions` should only be enabled when linting ECMAScript 2017 or higher.
7374

7475
### never
7576

0 commit comments

Comments
 (0)