{"enrichment":{"faq":[{"a":"Stylelint brings CSS and SCSS linting to .NET projects. Install stylelint and a config preset via npm (e.g., `npm install --save-dev stylelint stylelint-config-standard`), then create a `.stylelintrc.json` file in your repo root with your rules. For .NET repos with frontend code in `wwwroot` or `ClientApp`, point stylelint at those directories in your lint command: `stylelint \"src/**/*.scss\"`. Commit the config file so all team members use identical rules.","q":"How do I set up stylelint SCSS in a .NET project?"},{"a":"Stylelint's `.stylelintrc` configuration file (JSON, YAML, or JS) defines which CSS/SCSS rules to enforce across your codebase. It specifies rule severity (error, warning, off), extends shared configs, and ignores paths like generated assets. For .NET projects, a clear `.stylelintrc` prevents duplicate styles, enforces naming conventions, and ensures consistent stylesheet quality without conflicting with other linters in your build pipeline.","q":"What is stylelint .stylelintrc configuration and why do I need it?"},{"a":"Stylelint enforces stylesheet naming conventions and detects duplicate CSS rules through rules like `no-duplicate-selectors` and `declaration-block-no-duplicate-properties`. Enable these in your `.stylelintrc`, then run stylelint on your stylesheets to identify violations. Combined with autofix (`--fix` flag), stylelint can safely resolve many duplicates automatically, reducing stylesheet bloat in your .NET frontend bundles.","q":"How can stylelint detect and help clean up duplicate CSS rules?"},{"a":"Stylelint integrates into CI by adding a lint command to `package.json` (e.g., `\"lint:styles\": \"stylelint src/**/*.scss\"`) and calling it in your build or pre-commit hooks. For .NET repos, invoke this command in your CI workflow (GitHub Actions, Azure Pipelines, etc.) as a validation gate before deployment. This ensures all stylesheets meet your naming and quality standards before reaching production.","q":"How do I integrate stylelint into my CI/build pipeline?"},{"a":"Stylelint unknown rule errors occur when your `.stylelintrc` references a rule that isn't installed or recognized. Check that all required plugins (e.g., `stylelint-scss` for SCSS rules) are listed in `devDependencies` and properly configured in your config file. Verify rule names match the stylelint documentation for your version. If upgrading stylelint, review the changelog for renamed or removed rules and update your config accordingly.","q":"What should I do when stylelint reports an unknown rule error?"},{"a":"Stylelint autofix uses the `--fix` flag to automatically correct fixable violations: `stylelint \"src/**/*.scss\" --fix`. This safely resolves issues like formatting, property order, and some duplicates without manual editing. Always review changes in version control before committing. For .NET projects, integrate autofix into pre-commit hooks or local development workflows, then run full validation in CI to catch any remaining violations.","q":"How do I use stylelint autofix to safely resolve CSS errors?"}],"shadow_tags":["css-validation","style-linting","dotnet-frontend","scss-rules","stylesheet-enforcement","design-system-guardrails","autofix-workflow","asset-cleanup"],"summary_rewrite":"Stylelint brings CSS and SCSS linting to .NET projects that bundle stylesheets alongside web frontends. Set up repo-local configuration, define clear ownership boundaries, and enforce naming conventions and duplicate-style cleanup without conflicting with other linters."},"files":[{"bytes":6832,"path":"catalog/Tools/Stylelint/skills/stylelint/SKILL.md","sha256":"648f16387d0d787b8dba2181a5990d2f4222f0e6f11b633cea1713c61739c9c7","url":"https://skillfed.io/files/managedcode/dotnet-skills/stylelint/22e7a334/SKILL.md"}],"id":"managedcode/dotnet-skills/stylelint","links":{"html":"https://skillfed.io/managedcode/dotnet-skills/stylelint","md":"https://skillfed.io/managedcode/dotnet-skills/stylelint.md","repo":"https://github.com/managedcode/dotnet-skills"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":35,"language":"C#","last_updated":"2026-07-25","license":"MIT","name":"stylelint","publisher":"managedcode","stars":463},"relations":{"similar":[{"id":"managedcode/dotnet-skills/metalint"},{"id":"managedcode/dotnet-skills/biome"},{"id":"managedcode/dotnet-skills/eslint"},{"id":"managedcode/dotnet-skills/webhint"},{"id":"managedcode/dotnet-skills/chous"},{"id":"managedcode/dotnet-skills/quality-ci"},{"id":"managedcode/dotnet-skills/htmlhint"},{"id":"managedcode/dotnet-skills/complexity"},{"id":"managedcode/dotnet-skills/sonarjs"},{"id":"managedcode/dotnet-skills/stylecop-analyzers"}]},"slug":{"owner":"managedcode","repo":"dotnet-skills","skill":"stylelint"},"version":"22e7a334"}
