Skip to content

Commit

Permalink
feat: support inexact object notation in delimiter-dangle rule (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwoltman authored and gajus committed Nov 24, 2019
1 parent 9b046e4 commit 3258d30
Show file tree
Hide file tree
Showing 4 changed files with 868 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .README/rules/delimiter-dangle.md
Expand Up @@ -4,9 +4,11 @@ _The `--fix` option on the command line automatically fixes problems reported by

Enforces consistent use of trailing commas in Object and Tuple annotations.

This rule takes two arguments which both mirror ESLint's default `comma-dangle` rule.
The first argument is for Object and Tuple annotations.
The second argument is used for Interface annotations as ESLint's default `comma-dangle` doesn't apply to interfaces - this defaults to whatever the first argument is.
This rule takes three arguments where the possible values are the same as ESLint's default `comma-dangle` rule:

1. The first argument is for Object and Tuple annotations. The default value is `'never'`.
2. The second argument is used for Interface annotations. This defaults to the value of the first argument.
3. The third argument is used for inexact object notation (trailing `...`). The default value is `'never'`.

If it is `'never'` then a problem is raised when there is a trailing comma.

Expand All @@ -16,6 +18,4 @@ If it is `'always-multiline'` then a problem is raised when there is no trailing

If it is `'only-multiline'` then a problem is raised when there is a trailing comma on a single-line definition. It allows, but does not enforce, trailing commas on multi-line definitions.

The default value is `'never'`.

<!-- assertions delimiterDangle -->

0 comments on commit 3258d30

Please sign in to comment.