You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
496 B
18 lines
496 B
'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' });
|
|
}
|
|
};
|