@antebudimir/eslint-plugin-vanilla-extract 1.6.0 → 1.7.0

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.
package/README.md CHANGED
@@ -51,6 +51,43 @@ Create or update your `eslint.config.js` or `eslint.config.mjs` file:
51
51
  ```typescript
52
52
  import vanillaExtract from '@antebudimir/eslint-plugin-vanilla-extract';
53
53
 
54
+ // Using the recommended configuration
55
+ export default [
56
+ {
57
+ files: ['**/*.css.ts'],
58
+ ignores: ['src/**/theme-contract.css.ts'],
59
+ plugins: {
60
+ 'vanilla-extract': vanillaExtract,
61
+ },
62
+ rules: {
63
+ // Apply all recommended rules
64
+ ...vanillaExtract.configs.recommended.rules,
65
+
66
+ // Optionally override specific rules
67
+ // 'vanilla-extract/concentric-order': 'warn', // Change severity from error to warn
68
+ // 'vanilla-extract/no-empty-style-blocks': 'off', // Disable a recommended rule
69
+
70
+ // Add additional rules not in recommended config
71
+ // 'vanilla-extract/alphabetical-order': 'error', // Override concentric-order rule
72
+ },
73
+ },
74
+ ];
75
+ ```
76
+
77
+ ### Recommended Configuration
78
+
79
+ The recommended configuration enables the following rules with error severity:
80
+
81
+ - `vanilla-extract/concentric-order`: Enforces concentric CSS property ordering
82
+ - `vanilla-extract/no-empty-style-blocks`: Prevents empty style blocks
83
+
84
+ You can use the recommended configuration as a starting point and override rules as needed for your project.
85
+
86
+ ### Custom Configuration
87
+
88
+ If you prefer not to use the recommended configuration, you can still configure rules manually:
89
+
90
+ ```typescript
54
91
  export default [
55
92
  {
56
93
  files: ['**/*.css.ts'],
@@ -303,17 +340,17 @@ The roadmap outlines the project's current status and future plans:
303
340
  - Auto-fix capability integrated into ESLint.
304
341
  - Support for multiple vanilla-extract APIs (e.g., `style`, `styleVariants`, `recipe`, `globalStyle`, `fontFace`, etc.).
305
342
  - `no-empty-style-blocks` rule to disallow empty blocks.
343
+ - Recommended ESLint configuration for the plugin.
306
344
  - Comprehensive rule testing.
307
345
 
308
346
  ### Current Work
309
347
 
310
- - Setting up recommended ESLint configuration for the plugin.
348
+ - `no-zero-unit` rule to disallow units when the value is zero.
311
349
 
312
350
  ### Upcoming Features
313
351
 
314
352
  - `no-unknown-units` rule to disallow unknown units.
315
353
  - `no-number-trailing-zeros` rule to disallow trailing zeros in numbers.
316
- - `no-zero-unit` rule to disallow units when the value is zero.
317
354
  - `no-px-unit` rule to disallow use of `px` units with configurable whitelist.
318
355
  - `prefer-logical-properties` rule to enforce use of logical properties.
319
356
  - `prefer-theme-tokens` rule to enforce use of theme tokens instead of hard-coded values when available.
package/dist/index.d.ts CHANGED
@@ -11,31 +11,12 @@ export declare const vanillaExtract: {
11
11
  };
12
12
  configs: {
13
13
  recommended: {
14
- plugins: {
15
- 'vanilla-extract': {
16
- rules: {
17
- 'concentric-order': import("eslint").Rule.RuleModule;
18
- 'no-empty-style-blocks': import("eslint").Rule.RuleModule;
19
- };
20
- };
21
- };
14
+ plugins: string[];
22
15
  rules: {
23
16
  'vanilla-extract/concentric-order': string;
24
17
  'vanilla-extract/no-empty-style-blocks': string;
25
18
  };
26
- }[];
27
- alphabetical: {
28
- plugins: {
29
- 'vanilla-extract': {
30
- rules: {
31
- 'alphabetical-order': import("eslint").Rule.RuleModule;
32
- };
33
- };
34
- };
35
- rules: {
36
- 'vanilla-extract/alphabetical-order': string;
37
- };
38
- }[];
19
+ };
39
20
  };
40
21
  };
41
22
  export default vanillaExtract;
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import noEmptyStyleBlocksRule from './css-rules/no-empty-blocks/rule-definition.
5
5
  export const vanillaExtract = {
6
6
  meta: {
7
7
  name: '@antebudimir/eslint-plugin-vanilla-extract',
8
- version: '1.6.0',
8
+ version: '1.7.0',
9
9
  },
10
10
  rules: {
11
11
  'alphabetical-order': alphabeticalOrderRule,
@@ -14,32 +14,13 @@ export const vanillaExtract = {
14
14
  'no-empty-style-blocks': noEmptyStyleBlocksRule,
15
15
  },
16
16
  configs: {
17
- recommended: [
18
- {
19
- plugins: {
20
- 'vanilla-extract': {
21
- rules: {
22
- 'concentric-order': concentricOrderRule,
23
- 'no-empty-style-blocks': noEmptyStyleBlocksRule,
24
- },
25
- },
26
- },
27
- rules: {
28
- 'vanilla-extract/concentric-order': 'warn',
29
- 'vanilla-extract/no-empty-style-blocks': 'warn',
30
- },
17
+ recommended: {
18
+ plugins: ['vanilla-extract'],
19
+ rules: {
20
+ 'vanilla-extract/concentric-order': 'error',
21
+ 'vanilla-extract/no-empty-style-blocks': 'error',
31
22
  },
32
- ],
33
- alphabetical: [
34
- {
35
- plugins: {
36
- 'vanilla-extract': {
37
- rules: { 'alphabetical-order': alphabeticalOrderRule },
38
- },
39
- },
40
- rules: { 'vanilla-extract/alphabetical-order': 'warn' },
41
- },
42
- ],
23
+ },
43
24
  },
44
25
  };
45
26
  export default vanillaExtract;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antebudimir/eslint-plugin-vanilla-extract",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "ESLint plugin for enforcing best practices in vanilla-extract CSS styles, including CSS property ordering and additional linting rules.",
5
5
  "author": "Ante Budimir",
6
6
  "license": "MIT",