# Extension points — stylelint/stylelint

> Canonical page: https://codevetter.com/unpack/stylelint/extension-points

# Extension points — stylelint/stylelint

Scanned commit bc06c7cdb1413de3d8dc939b33af138ab7e59df1 (2026-10-01). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Stylelint exposes extension interfaces for rules, syntaxes, configuration, reporting, and reference loading. Core rules and formatters use explicit registries, while configured plugin definitions are normalized into lookup tables. Most extension behavior converges on PostCSS roots and the shared reporting utility.
- New core rules plug into ruleNames in lib/rules/index.mjs; enumerable getters resolve each rule's index.mjs through a cached import promise. — [lib/rules/index.mjs#L11-23](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/rules/index.mjs#L11-L23) [lib/rules/index.mjs#L175-187](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/rules/index.mjs#L175-L187)
- createPlugin returns {ruleName, rule}; plugin augmentation accepts a single definition or array, requires names containing '/', and installs functions into config._pluginFunctions. — [lib/createPlugin.mjs#L4-8](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/createPlugin.mjs#L4-L8) [lib/augmentConfig.mjs#L412-433](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/augmentConfig.mjs#L412-L433)
- Rule factories receive primary settings, secondary options, and context, returning callbacks invoked with root and result; promise aggregation accommodates asynchronous callbacks. — [lib/lintPostcssResult.mjs#L98-140](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/lintPostcssResult.mjs#L98-L140) [lib/lintPostcssResult.mjs#L143-154](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/lintPostcssResult.mjs#L143-L154) [docs/developer-guide/plugins.md#L97-126](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/docs/developer-guide/plugins.md#L97-L126)
- Public plugin utilities include report, ruleMessages, validateOptions, and checkAgainstRule; report integrates severity, disable ranges, fix callbacks, and edit information. — [lib/index.mjs#L22-27](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/index.mjs#L22-L27) [lib/utils/report.mjs#L36-105](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/utils/report.mjs#L36-L105)
- Custom syntaxes can supply parse/stringify objects or modules; extension-language configs can select syntax through overrides and disable incompatible core rules. — [lib/utils/getCustomSyntax.mjs#L12-40](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/utils/getCustomSyntax.mjs#L12-L40) [docs/developer-guide/syntaxes.md#L28-53](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/docs/developer-guide/syntaxes.md#L28-L53)
- Custom formatters implement formatter(results, returnValue); API selection accepts functions/promises or existing file paths, and the CLI separately imports --custom-formatter modules. — [docs/developer-guide/formatters.md#L3-16](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/docs/developer-guide/formatters.md#L3-L16) [lib/utils/getFormatter.mjs#L15-42](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/utils/getFormatter.mjs#L15-L42) [lib/cli.mjs#L711-718](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/cli.mjs#L711-L718)
- Configured processors are factories returning name and postprocess; augmentation validates both fields, stores callbacks by name, and standalone invokes them on each converted result and its root. — [lib/augmentConfig.mjs#L442-482](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/augmentConfig.mjs#L442-L482) [lib/standalone.mjs#L402-412](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/standalone.mjs#L402-L412)
- referenceFiles entries accept files, customSyntax, and loader; loaders can be imported modules or supplied PostCSS plugins and are installed into a dedicated reference-file processor. — [lib/augmentConfig.mjs#L203-219](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/augmentConfig.mjs#L203-L219) [lib/augmentConfig.mjs#L505-518](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/augmentConfig.mjs#L505-L518) [lib/utils/getLoader.mjs#L10-24](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/utils/getLoader.mjs#L10-L24) [lib/utils/getReferenceRoots.mjs#L23-32](https://github.com/stylelint/stylelint/blob/bc06c7cdb1413de3d8dc939b33af138ab7e59df1/lib/utils/getReferenceRoots.mjs#L23-L32)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
