Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Geokureli opened this issue Nov 5, 2024 · 0 comments
Open

Comments

@Geokureli
Copy link

Geokureli commented Nov 5, 2024

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

@Geokureli Geokureli changed the title Suggestion, add way to ignore singleLines to leftCurly/rightCurly Suggestion, add way to ignore single lines to leftCurly/rightCurly Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants