-
Notifications
You must be signed in to change notification settings - Fork 45
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
feat: makes partitionByComment
support line
and block
filters
#433
base: main
Are you sure you want to change the base?
Conversation
b06e023
to
3200b45
Compare
- Uses object-based parameters. - Moves `hasPartitionComment` to its own file.
3200b45
to
fe4841f
Compare
fe4841f
to
cb30325
Compare
4a7198e
to
4b5cd3b
Compare
4b5cd3b
to
731bbe1
Compare
@@ -192,6 +192,11 @@ Allows you to group array elements by their kind, determining whether spread val | |||
|
|||
### partitionByComment | |||
|
|||
<sub> | |||
- type: | |||
- `boolean | string | string[]` (`BaseType`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure we need this block? We just have default values in other places.
@@ -200,6 +205,7 @@ Allows you to use comments to separate the members of arrays into logical groups | |||
- `false` — Comments will not be used as delimiters. | |||
- `string` — A regexp pattern to specify which comments should act as delimiters. | |||
- `string[]` — A list of regexp patterns to specify which comments should act as delimiters. | |||
- `{ block: BaseType; line: BaseType }` — Specify which block and line comments should act as delimiters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's clear what BaseType means here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azat-io The idea is to tell that block
and line
can be string | string[] | boolean
.
I felt that
`{ block: string | string[] | boolean; line: string | string[] | boolean }`
was a bit hard to read but we can do that if you feel that it's better.
Resolves #432
Most of the lines added are tests and documentation.
Description
Updates the
partitionByComment
option to supportblock
andline
filters:Affected rules
sort-enums
sort-array-includes
sort-sets
sort-decorators
sort-object-types
sort-interfaces
sort-modules
sort-classes
sort-variable-declarations
sort-union-types
sort-intersection-types
sort-objects
sort-named-imports
sort-named-exports
sort-maps
sort-imports
sort-exports
What is the purpose of this pull request?