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.
17 lines
492 B
17 lines
492 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 { |
|
result.warn('Cannot parse selector', { node, stylelintType: 'parseError' }); |
|
} |
|
};
|
|
|