# stylelint/stylelint

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/stylelint-stylelint).**

11,484 stars · 1,010 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/stylelint/stylelint
- Homepage: https://stylelint.io
- awesome-repositories: https://awesome-repositories.com/repository/stylelint-stylelint.md

## Description

Stylelint is a static code analysis tool and linter for CSS and style-like languages. It identifies errors, enforces coding conventions, and operates as a PostCSS plugin to validate stylesheets during build pipelines.

The project distinguishes itself through support for non-standard syntaxes, including preprocessor parsing for SCSS and Less, and the ability to extract and lint embedded styles from JavaScript, HTML, and template literals. It features an automated fixing system that programmatically corrects repairable styling violations to ensure consistency.

The system provides a plugin architecture for creating custom rules, syntaxes, and formatters. It covers a broad range of quality assurance capabilities, including the prevention of deprecated syntax, selector specificity validation, and the enforcement of naming patterns and stylistic conventions. Configuration is managed through a cascading merge logic that supports shareable presets and file-specific overrides.

The tool is accessible via a command-line interface, a programmatic API, and various editor integrations.

## Tags

### Development Tools & Productivity

- [Stylesheet Analysis CLIs](https://awesome-repositories.com/f/development-tools-productivity/stylesheet-analysis-clis.md) — Provides a command-line tool for scanning stylesheets to identify errors and enforce coding conventions. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/cli.md))
- [Command Line Interfaces](https://awesome-repositories.com/f/development-tools-productivity/command-line-interfaces.md) — Provides a ready-to-run command-line application for executing style analysis and managing configuration. ([source](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md))
- [CSS AST Analysis](https://awesome-repositories.com/f/development-tools-productivity/import-sorters/ast-based-analysis/css-ast-analysis.md) — Analyzes CSS stylesheets using abstract syntax trees generated via PostCSS to evaluate code structure.
- [Automated Code Fix Suggestions](https://awesome-repositories.com/f/development-tools-productivity/automated-code-fix-suggestions.md) — Provides actionable code change suggestions by identifying character ranges and replacement text to resolve styling violations. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/node-api.md))
- [Editor Integrations](https://awesome-repositories.com/f/development-tools-productivity/code-editors-ides/extension-ecosystems-management/editor-extensions/editor-integrations.md) — Connects linting feedback and error highlighting directly into the editor workflow via extensions. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/customize.md))
- [Custom Lint Rule Plugins](https://awesome-repositories.com/f/development-tools-productivity/code-quality-analysis/static-analysis-engines/static-analysis-tools/static-analysis-rules/framework-linting-rules/core-rule-extensions/custom-lint-rule-plugins.md) — Provides a plugin interface for adding custom lint rules and embedded style support. ([source](https://github.com/stylelint/stylelint#readme))
- [Custom Lint Rule Definitions](https://awesome-repositories.com/f/development-tools-productivity/code-quality-analysis/static-analysis-engines/static-analysis-tools/static-analysis-rules/framework-linting-rules/core-rule-extensions/custom-lint-rule-plugins/custom-lint-rule-definitions.md) — Provides interfaces for defining custom rules to enforce team-specific CSS and style standards. ([source](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md))
- [Style Syntax Definitions](https://awesome-repositories.com/f/development-tools-productivity/custom-parser-definitions/style-syntax-definitions.md) — Allows modification of the parser to recognize specialized CSS at-rules, keywords, and units. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/configure.md))
- [Lint Result Formatters](https://awesome-repositories.com/f/development-tools-productivity/output-formatters/lint-result-formatters.md) — Transforms lint results into multiple output formats like JSON, XML, or TAP for integration with build systems. ([source](https://github.com/stylelint/stylelint/blob/main/docs/developer-guide/formatters.md))

### Testing & Quality Assurance

- [Code Quality Tools](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/code-quality-tools.md) — Identifies syntax errors and enforces consistent coding conventions across stylesheets to prevent bugs.
- [Static Code Analysis Tools](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/code-quality-tools/static-code-analysis-tools.md) — Implements a system that scans stylesheets for syntax errors and problematic patterns without executing the code.
- [Automated Code Fixers](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/automated-code-fixers.md) — Provides a utility that automatically corrects repairable styling violations to ensure consistency.
- [CSS Linters](https://awesome-repositories.com/f/testing-quality-assurance/css-linters.md) — Provides a validator that supports non-standard syntaxes like SCSS and Less for style linting.
- [CSS Linting](https://awesome-repositories.com/f/testing-quality-assurance/css-linting.md) — Analyzes non-standard syntaxes like SCSS and Less to apply validation rules to pre-processed styles.
- [CSS Syntax Error Detection](https://awesome-repositories.com/f/testing-quality-assurance/css-syntax-error-detection.md) — Identifies malformed CSS values, such as invalid hex codes or media queries, that cause browser parsing errors. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/rules.md))
- [Selector Complexity Limits](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/browser-ui-interaction/ui-element-selectors/dom-element-selectors/selector-performance-optimization/selector-complexity-limits.md) — Constrains the number of IDs, classes, or attributes in a CSS selector to optimize browser performance. ([source](https://github.com/stylelint/stylelint/blob/main/docs/migration-guide/to-17.md))

### Content Management & Publishing

- [Linting Error Corrections](https://awesome-repositories.com/f/content-management-publishing/automated-text-corrections/linting-error-corrections.md) — Automatically corrects repairable coding problems to maintain consistency across stylesheets. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/cli.md))

### Programming Languages & Runtimes

- [CSS and Preprocessor Formatting](https://awesome-repositories.com/f/programming-languages-runtimes/css-and-preprocessor-formatting.md) — Automatically corrects repairable styling violations and convention errors to maintain a clean codebase.
- [Custom Style Syntaxes](https://awesome-repositories.com/f/programming-languages-runtimes/custom-style-syntaxes.md) — Supports non-standard style languages and preprocessors through a modular custom parsing architecture.

### Software Engineering & Architecture

- [Syntax Validation](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-parsing/syntax-validation.md) — Verifies the grammatical correctness of stylesheets through AST analysis to detect malformed code or custom syntax. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/errors.md))
- [CSS Style Enforcement](https://awesome-repositories.com/f/software-engineering-architecture/coding-convention-specifications/css-style-enforcement.md) — Enforces consistency and syntax standards specifically for CSS and style-like languages. ([source](https://github.com/stylelint/stylelint#readme))
- [Plugin-Based Rule Engines](https://awesome-repositories.com/f/software-engineering-architecture/configuration-driven-rule-engines/plugin-based-rule-engines.md) — Implements a modular architecture where individual linting rules are encapsulated as decoupled plugin modules.
- [Automatic Lint Fixes](https://awesome-repositories.com/f/software-engineering-architecture/custom-log-formatting/automatic-format-detection/automatic-lint-fixes.md) — Automatically corrects formatting and style violations detected during linting without requiring manual intervention.
- [Extensible Plugin Architectures](https://awesome-repositories.com/f/software-engineering-architecture/extensible-plugin-architectures.md) — Implements a modular architecture for creating custom rules, syntaxes, and formatters via plugins. ([source](https://github.com/stylelint/stylelint/blob/main/docs/migration-guide/to-16.md))
- [CSS Preprocessor Parsing](https://awesome-repositories.com/f/software-engineering-architecture/syntax-parsing-engines/css-preprocessor-parsing.md) — Parses CSS preprocessor syntaxes such as SCSS and Less into structured trees for analysis. ([source](https://github.com/stylelint/stylelint#readme))
- [CSS Syntax Deprecation](https://awesome-repositories.com/f/software-engineering-architecture/deprecation-management/css-syntax-deprecation.md) — Identifies and blocks outdated CSS properties and selectors to ensure compatibility with modern standards. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/rules.md))
- [Duplicate Declaration Preventions](https://awesome-repositories.com/f/software-engineering-architecture/duplicate-declaration-preventions.md) — Identifies and prevents redundant property or selector declarations within stylesheets to reduce code bloat. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/rules.md))
- [Language-Specific Formatting Overrides](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/plugin-architectures/domain-specific/language-support-definitions/language-parsing-rules/language-specific-formatting-overrides.md) — Allows specification of different syntaxes and rule sets for specific file patterns to support multiple languages. ([source](https://github.com/stylelint/stylelint/blob/main/docs/migration-guide/to-14.md))
- [Property and Element Restrictions](https://awesome-repositories.com/f/software-engineering-architecture/property-and-element-restrictions.md) — Enforces constraints on which CSS properties, functions, or pseudo-classes are permitted using allow-lists and deny-lists. ([source](https://github.com/stylelint/stylelint/blob/main/docs/migration-guide/to-17.md))
- [Property Value Constraints](https://awesome-repositories.com/f/software-engineering-architecture/property-value-constraints.md) — Enforces limits on the number of values assigned to a specific CSS property using regular expressions. ([source](https://github.com/stylelint/stylelint/blob/main/docs/migration-guide/to-17.md))
- [CSS Redundancy Removal](https://awesome-repositories.com/f/software-engineering-architecture/redundant-definition-cleanup/redundant-keyword-removal/css-redundancy-removal.md) — Identifies and blocks unnecessary longhand properties or redundant nested rules in stylesheets. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/rules.md))
- [Recursive Configuration Merging](https://awesome-repositories.com/f/software-engineering-architecture/trie-data-structures/recursive-merging/recursive-configuration-merging.md) — Deeply merges global configurations with file-specific overrides to create a final resolved settings tree.
- [Unknown Identifier Detection](https://awesome-repositories.com/f/software-engineering-architecture/unknown-identifier-detection.md) — Flags unrecognized CSS properties, functions, and pseudo-elements to prevent typos and non-standard usage. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/rules.md))
- [Rule Suppression Comments](https://awesome-repositories.com/f/software-engineering-architecture/warning-issuance-systems/warning-suppressions/suppression-comment-governors/rule-suppression-comments.md) — Uses inline source code comments to disable specific linting rules for targeted lines or blocks.
- [Warning Threshold Enforcers](https://awesome-repositories.com/f/software-engineering-architecture/warning-issuance-systems/warning-threshold-enforcers.md) — Fails the build process when the number of emitted warnings exceeds a specified limit in CI. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/options.md))

### User Interface & Experience

- [Style Extraction](https://awesome-repositories.com/f/user-interface-experience/ui-styling/embedded-style-parsing/style-extraction.md) — Locates and extracts style definitions embedded within non-CSS files like HTML, Markdown, or template literals for analysis. ([source](https://github.com/stylelint/stylelint#readme))
- [CSS Property Value Validations](https://awesome-repositories.com/f/user-interface-experience/component-property-systems/property-validation/css-property-value-validations.md) — Flags property-value pairs that do not exist in specifications to ensure valid stylesheet syntax. ([source](https://github.com/stylelint/stylelint/blob/main/docs/migration-guide/to-15.md))
- [Selector Specificity Restrictions](https://awesome-repositories.com/f/user-interface-experience/css-selectors/selector-specificity-restrictions.md) — Ensures selectors adhere to maximum specificity thresholds to maintain a manageable CSS architecture. ([source](https://github.com/stylelint/stylelint/blob/main/docs/migration-guide/to-17.md))
- [CSS-in-JS Extraction](https://awesome-repositories.com/f/user-interface-experience/ui-styling/embedded-style-parsing/css-in-js-extraction.md) — Locates and extracts CSS styles embedded within JavaScript template literals or HTML for linting.

### Web Development

- [PostCSS Pipeline Integration](https://awesome-repositories.com/f/web-development/postcss-pipeline-integration.md) — Integrates stylesheet analysis as a plugin within a PostCSS processing pipeline to validate CSS during builds. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/postcss-plugin.md))
- [Vendor Prefix Restrictions](https://awesome-repositories.com/f/web-development/vendor-prefix-restrictions.md) — Disallows the use of vendor-prefixed properties and selectors to encourage adherence to standard CSS specifications. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/rules.md))

### Part of an Awesome List

- [Shareable Configurations](https://awesome-repositories.com/f/awesome-lists/devtools/shareable-configurations.md) — Supports the creation and inheritance of reusable rule sets to maintain consistency across projects. ([source](https://github.com/stylelint/stylelint#readme))
- [Code Quality Tools](https://awesome-repositories.com/f/awesome-lists/devtools/code-quality-tools.md) — Modern CSS and style sheet linting tool.
- [Web Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/web-frameworks.md) — Linter for enforcing style conventions.

### Data & Databases

- [Analysis Result Caches](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/caching-performance/caching-strategies/query-result-caching/method-result-caches/analysis-result-caches.md) — Stores intermediate analysis results for unchanged files to avoid redundant processing and improve performance.

### DevOps & Infrastructure

- [Configuration Cascade Resolutions](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/configuration-resolution-engines/configuration-cascade-resolutions.md) — Implements logic to determine the final active rule set by merging hierarchical configuration layers. ([source](https://github.com/stylelint/stylelint/blob/main/docs/user-guide/node-api.md))

### System Administration & Monitoring

- [Lint Rule Severity Levels](https://awesome-repositories.com/f/system-administration-monitoring/audit-log-filters/severity-level-filtering/log-severity-categorization/custom-severity-levels/severity-level-styling/pattern-severity-configurations/lint-rule-severity-levels.md) — Allows definition of rule activity and severity levels (error, warning, or off) via configuration. ([source](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md))
- [Lint Result Formatters](https://awesome-repositories.com/f/system-administration-monitoring/log-output-formatting/console-output-formatting/lint-result-formatters.md) — Transforms lint analysis results into multiple output formats for integration with editors, CI systems, and build pipelines.
