CodeVetter · Repo Unpack · Data flow
stylelint/stylelint
Input paths are normalized and filtered before stylesheet reads. Per-file configuration controls parsing, reference loading, rule execution, and diagnostic transformation. PostCSS results own execution metadata, while standalone turns those results into reports and optional disk writes.
- standalone resolves relative codeFilename against cwd; file inputs escape existing literal paths, add default node_modules exclusions, expand globs to absolute paths, and apply ignore-file patterns.
- getConfigForFile prefers options.config, then configFile, then searchPath discovery with a cwd fallback; augmented configuration is cached per target path.
- augmentConfigFull applies basic augmentation, plugins, processors, reference-file resolution, custom syntax, rule normalization, and language-option validation in that order.
- getPostcssResult selects supplied code or UTF-8 file contents, parses through PostCSS, and caches results by normalized path; lax mode selects postcss-safe-parser.
- Reference stylesheets are independently read and processed with optional loaders; Document nodes are flattened into roots, then attached to result.stylelint alongside the lexer and rule metadata.
- report resolves severity and custom messages, filters quiet warnings, applies eligible fixes, records disabled warnings, and otherwise emits PostCSS warnings with locations and optional edit data.
- createPartialStylelintResult separates deprecations, invalid options, and parse errors from ordinary warnings; prepareReturnValue derives errored/maxWarningsExceeded and calls the selected formatter.
- String input returns fixed CSS as result.code; file input conditionally writes changed CSS atomically, applies result processors and suppressions, reconciles caching, and then formats aggregate output.