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

Feature: implement ignore-pattern based on word before, not object name #137

Open
2 tasks done
rtatarinov opened this issue Apr 25, 2024 · 0 comments
Open
2 tasks done
Labels
enhancement New feature or request

Comments

@rtatarinov
Copy link

rtatarinov commented Apr 25, 2024

What rule do you want to change?

ignore-inline-pattern

Describe the problem

I have the following problem. When I use for example effector library (store managment) I have a strict order in the specific cases. For example:

import { sample } from "effector";

sample({
      clock: event,
      source: $store,
      filter: isNotNil,
      fn: (sourceData => sourceData.id,
      target: effectFx,
});

This is a right ordering in the sample operator from effector. But it conflicts with asc ordering from sort-objects
The library allows to ignore-pattern for any object with specific name/file name. But I don't use name at all. So, the following implementation doesn't work:

"perfectionist/sort-objects": [
       "error",
        {
             "order": "asc",
             "type": "natural",
             "ignore-pattern": ["sample(*"]
        }
  ],

Proposal
Implement inline code cheching by regex to check symbol by symbol string and exclude anything matches the specific pattern

Code example

"perfectionist/sort-objects": [
            "error",
            {
                "order": "asc",
                "type": "natural",
                "ignore-inline-pattern": ["sample(*"]
            }
],

Additional comments

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@rtatarinov rtatarinov added the enhancement New feature or request label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant