@antebudimir/eslint-plugin-vanilla-extract 1.4.6 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +2 -1
  3. package/dist/css-rules/alphabetical-order/__tests__/animation.test.d.ts +0 -1
  4. package/dist/css-rules/alphabetical-order/__tests__/animation.test.js +0 -108
  5. package/dist/css-rules/alphabetical-order/__tests__/font-face.test.d.ts +0 -1
  6. package/dist/css-rules/alphabetical-order/__tests__/font-face.test.js +0 -138
  7. package/dist/css-rules/alphabetical-order/__tests__/global.test.d.ts +0 -1
  8. package/dist/css-rules/alphabetical-order/__tests__/global.test.js +0 -51
  9. package/dist/css-rules/alphabetical-order/__tests__/recipe.test.d.ts +0 -1
  10. package/dist/css-rules/alphabetical-order/__tests__/recipe.test.js +0 -91
  11. package/dist/css-rules/alphabetical-order/__tests__/style.test.d.ts +0 -1
  12. package/dist/css-rules/alphabetical-order/__tests__/style.test.js +0 -108
  13. package/dist/css-rules/alphabetical-order/__tests__/variants.test.d.ts +0 -1
  14. package/dist/css-rules/alphabetical-order/__tests__/variants.test.js +0 -63
  15. package/dist/css-rules/concentric-order/__tests__/animation.test.d.ts +0 -1
  16. package/dist/css-rules/concentric-order/__tests__/animation.test.js +0 -69
  17. package/dist/css-rules/concentric-order/__tests__/font-face.test.d.ts +0 -1
  18. package/dist/css-rules/concentric-order/__tests__/font-face.test.js +0 -94
  19. package/dist/css-rules/concentric-order/__tests__/global.test.d.ts +0 -1
  20. package/dist/css-rules/concentric-order/__tests__/global.test.js +0 -57
  21. package/dist/css-rules/concentric-order/__tests__/recipe.test.d.ts +0 -1
  22. package/dist/css-rules/concentric-order/__tests__/recipe.test.js +0 -100
  23. package/dist/css-rules/concentric-order/__tests__/style.test.d.ts +0 -1
  24. package/dist/css-rules/concentric-order/__tests__/style.test.js +0 -126
  25. package/dist/css-rules/concentric-order/__tests__/variants.test.d.ts +0 -1
  26. package/dist/css-rules/concentric-order/__tests__/variants.test.js +0 -133
  27. package/dist/css-rules/custom-order/__tests__/animation.test.d.ts +0 -1
  28. package/dist/css-rules/custom-order/__tests__/animation.test.js +0 -148
  29. package/dist/css-rules/custom-order/__tests__/font-face.test.d.ts +0 -1
  30. package/dist/css-rules/custom-order/__tests__/font-face.test.js +0 -124
  31. package/dist/css-rules/custom-order/__tests__/global.test.d.ts +0 -1
  32. package/dist/css-rules/custom-order/__tests__/global.test.js +0 -124
  33. package/dist/css-rules/custom-order/__tests__/recipe.test.d.ts +0 -1
  34. package/dist/css-rules/custom-order/__tests__/recipe.test.js +0 -208
  35. package/dist/css-rules/custom-order/__tests__/style.test.d.ts +0 -1
  36. package/dist/css-rules/custom-order/__tests__/style.test.js +0 -249
  37. package/dist/css-rules/custom-order/__tests__/variants.test.d.ts +0 -1
  38. package/dist/css-rules/custom-order/__tests__/variants.test.js +0 -184
  39. package/dist/css-rules/shared-utils/__tests__/css-property-priority-map.test.d.ts +0 -1
  40. package/dist/css-rules/shared-utils/__tests__/css-property-priority-map.test.js +0 -37
  41. package/dist/css-rules/shared-utils/__tests__/font-face-property-order-enforcer.test.d.ts +0 -1
  42. package/dist/css-rules/shared-utils/__tests__/font-face-property-order-enforcer.test.js +0 -58
  43. package/dist/css-rules/shared-utils/__tests__/order-strategy-visitor-creator.test.d.ts +0 -1
  44. package/dist/css-rules/shared-utils/__tests__/order-strategy-visitor-creator.test.js +0 -125
  45. package/dist/css-rules/shared-utils/__tests__/property-name-extractor.test.d.ts +0 -1
  46. package/dist/css-rules/shared-utils/__tests__/property-name-extractor.test.js +0 -53
  47. package/dist/css-rules/shared-utils/__tests__/recipe-property-processor.test.d.ts +0 -1
  48. package/dist/css-rules/shared-utils/__tests__/recipe-property-processor.test.js +0 -116
  49. package/dist/css-rules/shared-utils/__tests__/style-node-processor.test.d.ts +0 -1
  50. package/dist/css-rules/shared-utils/__tests__/style-node-processor.test.js +0 -55
  51. package/dist/css-rules/shared-utils/__tests__/test-property-name-rule.d.ts +0 -3
  52. package/dist/css-rules/shared-utils/__tests__/test-property-name-rule.js +0 -30
@@ -1,53 +0,0 @@
1
- import tsParser from '@typescript-eslint/parser';
2
- import { run } from 'eslint-vitest-rule-tester';
3
- import testRuleForPropertyNameExtractor from './test-property-name-rule.js';
4
- run({
5
- name: 'vanilla-extract/property-name-extractor-tests',
6
- rule: testRuleForPropertyNameExtractor,
7
- languageOptions: {
8
- parser: tsParser,
9
- parserOptions: {
10
- ecmaVersion: 2022,
11
- sourceType: 'module',
12
- },
13
- },
14
- valid: [
15
- // Test for identifier and string literal keys (should return names)
16
- `
17
- import { style } from '@vanilla-extract/css';
18
-
19
- const myStyle = style({
20
- color: 'blue',
21
- 'background-color': 'white',
22
- fontSize: '16px'
23
- });
24
- `,
25
- // Test for computed property with non-string literal (should return empty string)
26
- `
27
- import { style } from '@vanilla-extract/css';
28
-
29
- const myStyle = style({
30
- [42]: 'numeric key',
31
- [true]: 'boolean key'
32
- });
33
- `,
34
- // Test for computed property with complex expression
35
- `
36
- import { style } from '@vanilla-extract/css';
37
-
38
- const myStyle = style({
39
- [Math.random() > 0.5 ? 'dynamicKey' : 'otherKey']: 'dynamic value'
40
- });
41
- `,
42
- // Test for property with template literal key
43
- `
44
- import { style } from '@vanilla-extract/css';
45
-
46
- const prefix = 'webkit';
47
- const myStyle = style({
48
- [\`-\${prefix}-appearance\`]: 'none'
49
- });
50
- `,
51
- ],
52
- invalid: [],
53
- });
@@ -1,116 +0,0 @@
1
- import tsParser from '@typescript-eslint/parser';
2
- import { run } from 'eslint-vitest-rule-tester';
3
- import alphabeticalOrderRule from '../../alphabetical-order/rule-definition.js';
4
- run({
5
- name: 'vanilla-extract/recipe-property-processor-tests',
6
- rule: alphabeticalOrderRule,
7
- languageOptions: {
8
- parser: tsParser,
9
- parserOptions: {
10
- ecmaVersion: 2022,
11
- sourceType: 'module',
12
- },
13
- },
14
- valid: [
15
- // Test for recipe with spread element (should trigger the early return)
16
- `
17
- import { recipe } from '@vanilla-extract/recipes';
18
- import { style } from '@vanilla-extract/css';
19
-
20
- const baseStyle = style({ backgroundColor: 'blue', color: 'white' });
21
-
22
- const myRecipe = recipe({
23
- base: baseStyle,
24
- ...{ someSpreadProperty: true },
25
- variants: {
26
- size: {
27
- small: style({ fontSize: '1.2rem', padding: '4rem' }),
28
- large: style({ fontSize: '1.8rem', padding: '12rem' })
29
- }
30
- }
31
- });
32
- `,
33
- // Test for recipe with computed property (non-Identifier key)
34
- `
35
- import { recipe } from '@vanilla-extract/recipes';
36
- import { style } from '@vanilla-extract/css';
37
-
38
- const propName = 'dynamicProp';
39
- const baseStyle = style({ backgroundColor: 'blue', color: 'white' });
40
-
41
- const myRecipe = recipe({
42
- base: baseStyle,
43
- [propName]: style({ fontSize: '1.4rem' }),
44
- variants: {
45
- size: {
46
- small: style({ fontSize: '1.2rem', padding: '4rem' }),
47
- large: style({ fontSize: '1.8rem', padding: '12rem' })
48
- }
49
- }
50
- });
51
- `,
52
- // Test for recipe with non-object values (should skip processing)
53
- `
54
- import { recipe } from '@vanilla-extract/recipes';
55
- import { style } from '@vanilla-extract/css';
56
-
57
- const baseStyle = style({ backgroundColor: 'blue', color: 'white' });
58
-
59
- const myRecipe = recipe({
60
- base: baseStyle,
61
- nonObjectProp: 'string value',
62
- numericProp: 42,
63
- booleanProp: true,
64
- nullProp: null,
65
- variants: {
66
- size: {
67
- small: style({ fontSize: '1.2rem', padding: '4rem' }),
68
- large: style({ fontSize: '1.8rem', padding: '12rem' })
69
- }
70
- }
71
- });
72
- `,
73
- ],
74
- invalid: [
75
- // Basic recipe with incorrect ordering in style calls
76
- {
77
- code: `
78
- import { recipe } from '@vanilla-extract/recipes';
79
- import { style } from '@vanilla-extract/css';
80
-
81
- const baseStyle = style({ color: 'blue', backgroundColor: 'white' });
82
-
83
- const myRecipe = recipe({
84
- base: baseStyle,
85
- variants: {
86
- size: {
87
- small: style({ padding: '4rem', fontSize: '1.2rem' }),
88
- large: style({ padding: '12rem', fontSize: '1.8rem' })
89
- }
90
- }
91
- });
92
- `,
93
- errors: [
94
- { messageId: 'alphabeticalOrder' },
95
- { messageId: 'alphabeticalOrder' },
96
- { messageId: 'alphabeticalOrder' },
97
- ],
98
- output: `
99
- import { recipe } from '@vanilla-extract/recipes';
100
- import { style } from '@vanilla-extract/css';
101
-
102
- const baseStyle = style({ backgroundColor: 'white', color: 'blue' });
103
-
104
- const myRecipe = recipe({
105
- base: baseStyle,
106
- variants: {
107
- size: {
108
- small: style({ fontSize: '1.2rem', padding: '4rem' }),
109
- large: style({ fontSize: '1.8rem', padding: '12rem' })
110
- }
111
- }
112
- });
113
- `,
114
- },
115
- ],
116
- });
@@ -1,55 +0,0 @@
1
- import tsParser from '@typescript-eslint/parser';
2
- import { run } from 'eslint-vitest-rule-tester';
3
- import alphabeticalOrderRule from '../../alphabetical-order/rule-definition.js';
4
- run({
5
- name: 'vanilla-extract/style-node-processor-tests',
6
- rule: alphabeticalOrderRule,
7
- languageOptions: {
8
- parser: tsParser,
9
- parserOptions: {
10
- ecmaVersion: 2022,
11
- sourceType: 'module',
12
- },
13
- },
14
- valid: [
15
- // Test for empty array
16
- `
17
- import { style } from '@vanilla-extract/css';
18
-
19
- const emptyStyle = style([]);
20
- `,
21
- // Test for null/undefined handling
22
- `
23
- import { style } from '@vanilla-extract/css';
24
-
25
- const dynamicStyle = style(undefined);
26
- const nullStyle = style(null);
27
- `,
28
- ],
29
- invalid: [
30
- // Test for array with mixed content
31
- {
32
- code: `
33
- import { style } from '@vanilla-extract/css';
34
-
35
- const myStyle = style([
36
- { zIndex: 1, position: 'relative' },
37
- null,
38
- undefined,
39
- { display: 'flex', alignItems: 'center' }
40
- ]);
41
- `,
42
- errors: [{ messageId: 'alphabeticalOrder' }, { messageId: 'alphabeticalOrder' }],
43
- output: `
44
- import { style } from '@vanilla-extract/css';
45
-
46
- const myStyle = style([
47
- { position: 'relative', zIndex: 1 },
48
- null,
49
- undefined,
50
- { alignItems: 'center', display: 'flex' }
51
- ]);
52
- `,
53
- },
54
- ],
55
- });
@@ -1,3 +0,0 @@
1
- import type { Rule } from 'eslint';
2
- declare const testRuleForPropertyNameExtractor: Rule.RuleModule;
3
- export default testRuleForPropertyNameExtractor;
@@ -1,30 +0,0 @@
1
- import { getPropertyName } from '../property-separator.js';
2
- const testRuleForPropertyNameExtractor = {
3
- meta: {
4
- type: 'suggestion',
5
- docs: {
6
- description: 'enforce test rule for property name extraction',
7
- category: 'Stylistic Issues',
8
- recommended: false,
9
- },
10
- fixable: undefined,
11
- schema: [],
12
- messages: {
13
- emptyName: 'Property name extraction returned an empty string for this property',
14
- },
15
- },
16
- create() {
17
- return {
18
- ObjectExpression(node) {
19
- // Extract property names without enforcing any order
20
- node.properties.forEach((property) => {
21
- if (property.type === 'Property') {
22
- // Test the getPropertyName function
23
- getPropertyName(property);
24
- }
25
- });
26
- },
27
- };
28
- },
29
- };
30
- export default testRuleForPropertyNameExtractor;