Skip to content

Suggestion, add way to ignore single lines to leftCurly/rightCurly #528

Open
@Geokureli

Description

@Geokureli

I'm looking for a way to disallow cuddling, but allow single line blocks

// Should cause Error: leftCurly
typedef FooCuddle = {
    a:Int,
    b:String
};
// correct way
typedef FooCorrect =
{
    a:Int,
    b:String
};
// Allowed
typedef Foo = { a:Int, b:String };

If possible, I would like to be able to allow this for only specific tokens

Options:

  1. New option: "nlas" for "new line allow single [line]. Doc: should occur on a new line unless the entire token and block are a single line
  2. New prop: "ignoreSingleLines". Doc: allow the token and block to be a single line

I prefer option 2, as "nlas" is cryptic, in fact I'd prefer if "nlow" had a separate prop as well, though i don't know what that should be

For either option, you could enable this for certain tokens by creating multiple left curly checks with different props on different tokens

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions