1234567891011121314151617181920212223242526272829303132333435363738394041 |
- 'use strict';
- const createPartialStylelintResult = require('./createPartialStylelintResult');
- module.exports = async function createStylelintResult(
- stylelint,
- postcssResult,
- filePath,
- cssSyntaxError,
- ) {
- let stylelintResult = createPartialStylelintResult(postcssResult, cssSyntaxError);
- const configForFile = await stylelint.getConfigForFile(filePath, filePath);
- const config = configForFile === null ? {} : configForFile.config;
- const file = stylelintResult.source || (cssSyntaxError && cssSyntaxError.file);
- if (config.resultProcessors) {
- for (const resultProcessor of config.resultProcessors) {
-
-
- const returned = resultProcessor(stylelintResult, file);
- if (returned) {
- stylelintResult = returned;
- }
- }
- }
- return stylelintResult;
- };
|