mirror of
https://github.com/antebudimir/eslint-plugin-vanilla-extract.git
synced 2026-06-27 15:10:47 +00:00
fix: lint arrays from recipe's base property (ComplexStyleRule) (#8)
* fix support ComplexStyleRule array in recipe base * cover base array sorting in alphabetical and custom order rules
This commit is contained in:
parent
62b1844b44
commit
aec1bf7d5d
4 changed files with 143 additions and 7 deletions
|
|
@ -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'
|
||||
}],
|
||||
});
|
||||
`,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue