Welcome to mirror list, hosted at ThFree Co, Russian Federation.

transformSelector.js « utils « lib « stylelint « node_modules « assets - github.com/fourtyone11/origin-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 62216af704e4391e4e0f90071fcb2408ce26d749 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict';

const selectorParser = require('postcss-selector-parser');

/**
 * @param {import('stylelint').PostcssResult} result
 * @param {import('postcss').Node} node
 * @param {Function} cb
 */
module.exports = function(result, node, cb) {
	try {
		// @ts-ignore TODO TYPES wrong postcss-selector-parser definitions
		return selectorParser(cb).processSync(node, { updateSelector: true });
	} catch (e) {
		result.warn('Cannot parse selector', { node, stylelintType: 'parseError' });
	}
};