Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Added "check-preblock" option to whitespace rule #2002

Merged
merged 2 commits into from Jan 13, 2017

Conversation

cameron-mcateer
Copy link
Contributor

@cameron-mcateer cameron-mcateer commented Jan 6, 2017

Also added fixes for inserting spaces and updated tests

PR checklist

  • Addresses an existing issue: #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update
  • Enable CircleCI for your fork (https://circleci.com/add-projects)

What changes did you make?

I added the option to verify there is whitespace immediately before the opening brace of a block node. I also added fixes for the missing whitespace characters.

Also added fixes for inserting spaces and updated tests
@adidahiya
Copy link
Contributor

nice, this looks like a good rule option.

how does it handle plain blocks?

{
    const foo = 123;
    // code that just wants to be encapsulated in a block scope
}

@cameron-mcateer
Copy link
Contributor Author

@adidahiya Good question! I added a couple examples to the test to show that they still pass.

Copy link
Contributor

@nchen63 nchen63 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cameron-mcateer Looks good, thanks

@glen-84
Copy link
Contributor

glen-84 commented Jun 25, 2017

This seems to be covered by the one-line rule (with the check-whitespace option).

Unfortunately, neither of these rules check the number of spaces (see #628).

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.

None yet

4 participants