mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-05 11:31:31 +08:00
- Updates stylelint to 13.8.0 - Updates ESLint to 7.14.0 - Updates @typescript-eslint to 4.9.0 DISABLE_THIRD_PARTY_CHECK=NPM update R=jacktfranklin@chromium.org Change-Id: I207e204607ede782710e042c17d6510c7f696905 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2566806 Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
35 lines
815 B
JavaScript
35 lines
815 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Check whether a combinator is standard
|
|
*
|
|
* @param {import('postcss-selector-parser').Combinator} node postcss-selector-parser node (of type combinator)
|
|
* @return {boolean} If `true`, the combinator is standard
|
|
*/
|
|
module.exports = function (node) {
|
|
// if it's not a combinator, then it's not a standard combinator
|
|
if (node.type !== 'combinator') {
|
|
return false;
|
|
}
|
|
|
|
// Ignore reference combinators like `/deep/`
|
|
if (node.value.startsWith('/') || node.value.endsWith('/')) {
|
|
return false;
|
|
}
|
|
|
|
// ignore the combinators that are the first or last node in their container
|
|
if (node.parent !== undefined && node.parent !== null) {
|
|
let parent = node.parent;
|
|
|
|
if (node === parent.first) {
|
|
return false;
|
|
}
|
|
|
|
if (node === parent.last) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
};
|