feat 🥁: add no-empty-style-blocks rule

Add comprehensive rule to detect and prevent empty CSS style blocks:

- Identify style objects with no properties
- Flag empty style blocks as potential code quality issues
- Provide auto-fix capability to remove empty blocks
- Handle edge cases like comments-only blocks

This rule helps maintain cleaner codebases by eliminating empty style definitions that often result from incomplete refactoring or forgotten implementations, reducing confusion and unnecessary code.
This commit is contained in:
Ante Budimir 2025-04-06 11:37:34 +03:00
parent f346002fb0
commit 175ce9aef8
45 changed files with 2674 additions and 566 deletions

View file

@ -4,7 +4,6 @@ import { FlatCompat } from '@eslint/eslintrc';
import eslintPluginESLintPlugin from 'eslint-plugin-eslint-plugin';
import importPlugin from 'eslint-plugin-import';
import * as tseslint from 'typescript-eslint';
import vanillaExtract from '@antebudimir/eslint-plugin-vanilla-extract';
// mimic CommonJS variables
const __filename = fileURLToPath(import.meta.url);
@ -77,25 +76,6 @@ export default [
},
...tseslint.configs.recommended,
{
files: ['**/*.css.ts'],
plugins: {
'vanilla-extract': vanillaExtract,
},
rules: {
// 'vanilla-extract/alphabetical-order': 'warn',
// 'vanilla-extract/concentric-order': 'error',
'vanilla-extract/custom-order': [
'error',
{
groupOrder: ['dimensions', 'margin', 'font', 'border', 'boxShadow'],
// Optional
sortRemainingProperties: 'concentric', // or 'alphabetical' (default)
},
],
},
},
{
files: ['**/*.{js,ts}'],
languageOptions: {