Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

[FEAT][BREAKING][1/2][member-delimiter-style] Better handling for single line #203

Merged
merged 5 commits into from
Dec 11, 2018

Conversation

bradzacher
Copy link
Owner

This PR adds better handling for single line delimiters, and better enforces the requrieLast option.

Fixes #92

Single line delimiters

Previously single line delimiters were either checked or not. This meant that if you used

{
    delimiter: "none",
    ignoreSingleLine: false,
}

then the fixer would break your code by removing the delimiter from single line statements i.e.:

interface Foo { bar: string, baz: number }
// fixed to this broken line
interface Foo { bar: string baz: number }

Breaking change:

  • Removed option ignoreSingleLine
  • Added option singleLine: "none" | "semi" | "comma"

singleLine works the same as delimiter, except for single line statements only.

Stricter requireLast

Previously requireLast did nothing when turned off, and enforced having a delimiter when turned on.

I felt this was inconsistent with the goals of the linter; being a tool to provide consistent coding conventions.

This is the first of two changes to bring the option into line with eslint's comma-dangle. (The next change will replace the boolean with an enum; I didn't want to overload this PR).

Breaking change:

  • requireLast: false now enforces that there is no delimiter on the last member.

@bradzacher bradzacher changed the title [FEAT][BREAKING][member-delimiter-style] Better handling for single line [FEAT][BREAKING][1/2][member-delimiter-style] Better handling for single line Dec 5, 2018
@bradzacher bradzacher merged commit ecf9cb0 into master Dec 11, 2018
@bradzacher bradzacher deleted the 92-single-line-member-delimiter branch December 11, 2018 02:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[member-delimiter-style] allow delimiter to be specified for single lines
2 participants