MCPcopy
hub / github.com/stylelint/stylelint

github.com/stylelint/stylelint @17.14.0 sqlite

repository ↗ · DeepWiki ↗ · release 17.14.0 ↗
998 symbols 4,282 edges 756 files 366 documented · 37%
README

Stylelint

npm version npm downloads CI

A mighty CSS linter that helps you avoid errors and enforce conventions.

Features

It's mighty as it:

  • has over 100 built-in rules for modern CSS syntax and features
  • supports plugins so you can create your own custom rules
  • automatically fixes problems where possible
  • supports shareable configs that you can create or extend
  • can be customized to your exact needs
  • has 15k unit tests making it robust
  • is trusted by companies worldwide like Google and GitHub

And it can be extended to:

  • extract embedded styles from HTML, Markdown and CSS-in-JS template literals
  • parse CSS-like languages like SCSS, Sass, Less and SugarSS

How it'll help you

It'll help you avoid errors, for example:

  • invalid things, e.g. malformed grid areas
  • valid things that are problematic, e.g. duplicate selectors
  • unknown things, e.g. misspelled property names

And enforce conventions, for example:

  • disallow things, e.g. specific units
  • enforce naming patterns, e.g. for custom properties
  • set limits, e.g. the number of ID selectors
  • specify notations, e.g. for modern color functions

We recommend using a pretty printer like Prettier alongside Stylelint. Linters and pretty printers are complementary tools that work together to help you write consistent and error-free code.

Example output

Example

Guides

Contributors

Stylelint is maintained by volunteers. Without the code contributions from all these fantastic people, Stylelint would not exist. Become a contributor.

Alumni

We'd like to thank all past members for their invaluable contributions, including two of Stylelint's co-creators @davidtheclark and @MoOx.

Sponsors, backers and donors

Financial contributions help us dedicate time to Stylelint and cover our infrastructure costs.

A big thank you to everyone who sponsors us on Open Collective:

And thank you to all our Open Collective backers, GitHub sponsors and one-off donors.

Contribute via Open Collective or sponsor us on GitHub.

Website hosting

Deploys by Netlify

License

The MIT License.

Core symbols most depended-on inside this repo

testRule
called by 695
types/stylelint/type-test.ts
standalone
called by 332
lib/standalone.mjs
report
called by 208
lib/utils/report.mjs
validateOptions
called by 191
lib/utils/validateOptions.mjs
optionsMatches
called by 167
lib/utils/optionsMatches.mjs
getDimension
called by 165
lib/utils/getDimension.mjs
ruleMessages
called by 156
lib/utils/ruleMessages.mjs
get
called by 101
lib/utils/MemoryCache.mjs

Shape

Function 950
Method 30
Class 18

Languages

TypeScript100%

Modules by API surface

lib/rules/function-calc-no-unspaced-operator/index.mjs21 symbols
lib/augmentConfig.mjs18 symbols
lib/assignDisabledRanges.mjs15 symbols
lib/utils/validateTypes.mjs14 symbols
lib/utils/typeGuards.mjs13 symbols
lib/utils/errors.mjs12 symbols
lib/rules/length-zero-no-unit/index.mjs12 symbols
lib/utils/report.mjs11 symbols
lib/rules/selector-max-type/index.mjs11 symbols
lib/rules/font-family-name-quotes/index.mjs11 symbols
scripts/benchmarking/reporter.mjs10 symbols
lib/rules/no-irregular-whitespace/index.mjs10 symbols

Dependencies from manifests, versioned

@changesets/cli2.31.0 · 1×
@changesets/get-github-info0.8.0 · 1×
@csstools/css-calc3.2.1 · 1×
@csstools/css-parser-algorithms4.0.0 · 1×
@csstools/css-syntax-patches-for-csstree1.1.5 · 1×
@csstools/css-tokenizer4.0.0 · 1×
@csstools/media-query-list-parser5.0.0 · 1×
@csstools/selector-resolve-nested4.0.0 · 1×
@csstools/selector-specificity6.0.0 · 1×
@jest/globals30.4.1 · 1×
@stylelint/prettier-config4.0.0 · 1×
@stylelint/remark-preset5.1.1 · 1×

For agents

$ claude mcp add stylelint \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact