This repository was archived by the owner on Jan 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT][BREAKING][1/2][member-delimiter-style] Better handling for sin…
…gle line (#203) 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.: ```TS 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`](https://eslint.org/docs/rules/comma-dangle#options). (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.
- Loading branch information
1 parent
be72d06
commit ecf9cb0
Showing
3 changed files
with
474 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.