azat-io / eslint-plugin-perfectionist

🦄 ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.
https://eslint-plugin-perfectionist.azat.io
MIT License
1.62k stars 28 forks source link

Bug: ignore-pattern not followed in sort-objects #104

Open ArthurGuez opened 3 months ago

ArthurGuez commented 3 months ago

Describe the bug

Hi there,

I'm using Panda CSS to write my CSS and use an object syntax.

I'd like sort-objects to ignore those objects since I have my own way of sorting them. However, using the options provided (ignore-pattern and/or styled-components) doesn't work as expected.

Code example

My class :

const headerClass = css({ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginTop: '3', gridGap: '8', });

My rule config :

"perfectionist/sort-objects": [ "error", { "ignore-pattern": ["*Class"], "styled-components": false } ],

Having "styled-components": true makes no difference

ESLint version

v8.56.0

ESLint Plugin Perfectionist version

v2.5.0

Additional comments

No response

Validations