skillfed

stylelint

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.

Stylelint configures CSS and SCSS linting for .NET repositories with frontend stylesheet assets.

AI-generated summary based on this skill's SKILL.md

463 35 MIT updated by managedcode

Install

managedcode/dotnet-skills/stylelint · repository language: C#

git clone https://github.com/managedcode/dotnet-skills
cp -r dotnet-skills/catalog/Tools/Stylelint/skills/stylelint ~/.claude/skills/stylelint
npx skillfed install managedcode/dotnet-skills/stylelint

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I set up stylelint SCSS in a .NET project?

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.

What is stylelint .stylelintrc configuration and why do I need it?

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.

How can stylelint detect and help clean up duplicate CSS rules?

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.

How do I integrate stylelint into my CI/build pipeline?

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.

What should I do when stylelint reports an unknown rule error?

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.

How do I use stylelint autofix to safely resolve CSS errors?

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.

SKILL.md

rendered from the published skill — quoted content, verbatim

Stylelint for Stylesheets in .NET Repositories

Trigger On

  • the repo has stylelint.config.*, .stylelintrc*, or CSS and SCSS assets under frontend folders
  • the user asks for CSS linting, duplicate style cleanup, naming convention enforcement, or design-system guardrails
  • the repo needs a stylesheet gate beyond formatting alone

Do Not Use For

  • JavaScript or TypeScript ownership; route that to eslint or biome
  • runtime accessibility, performance, SEO, or header checks;

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 3 files
catalog/Tools/Stylelint/skills/stylelint/SKILL.md
catalog/Tools/Stylelint/skills/stylelint/manifest.json
catalog/Tools/Stylelint/skills/stylelint/references/release-notes.md

Related skills

Tags

css-validation style-linting dotnet-frontend scss-rules stylesheet-enforcement design-system-guardrails autofix-workflow asset-cleanup