fix: lint arrays from recipe's base property (ComplexStyleRule) (#8)
Some checks failed
CI / Build (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled

* fix support ComplexStyleRule array in recipe base
* cover base array sorting in alphabetical and custom order rules
This commit is contained in:
Seongmin Choi 2026-04-28 13:16:21 +09:00 committed by GitHub
parent 62b1844b44
commit aec1bf7d5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 143 additions and 7 deletions

View file

@ -36,6 +36,18 @@ run({
}
});
`,
// Recipe with base as array (ComplexStyleRule)
`
import { recipe } from '@vanilla-extract/recipes';
const myRecipe = recipe({
base: [{
alignItems: 'center',
display: 'flex'
}],
});
`,
],
invalid: [
// Recipe with incorrect ordering
@ -88,5 +100,28 @@ run({
});
`,
},
// Recipe with base array in incorrect order
{
code: `
import { recipe } from '@vanilla-extract/recipes';
const myRecipe = recipe({
base: [{
display: 'flex',
alignItems: 'center'
}],
});
`,
errors: [{ messageId: 'alphabeticalOrder' }],
output: `
import { recipe } from '@vanilla-extract/recipes';
const myRecipe = recipe({
base: [{
alignItems: 'center',
display: 'flex'
}],
});
`,
},
],
});