mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-07 04:26:32 +08:00
This also upgrades PostCSS to 8.3.11. DISABLE_THIRD_PARTY_CHECK=Updating Stylelint configuration R=szuend@chromium.org Bug: none Change-Id: I606540b03509d7c6e73f3d490327cd4174e03d31 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3259541 Reviewed-by: Simon Zünd <szuend@chromium.org> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
37 lines
713 B
JavaScript
37 lines
713 B
JavaScript
'use strict';
|
|
|
|
/** @typedef {import('postcss').Node} Node */
|
|
|
|
/**
|
|
* @param {Node | void} node
|
|
*/
|
|
function getNodeLine(node) {
|
|
return node && node.source && node.source.start && node.source.start.line;
|
|
}
|
|
|
|
/**
|
|
* @param {Node | void} node
|
|
* @returns {Node | void}
|
|
*/
|
|
module.exports = function getNextNonSharedLineCommentNode(node) {
|
|
if (node === undefined) {
|
|
return undefined;
|
|
}
|
|
|
|
/** @type {Node | void} */
|
|
const nextNode = node.next();
|
|
|
|
if (!nextNode || nextNode.type !== 'comment') {
|
|
return nextNode;
|
|
}
|
|
|
|
if (
|
|
getNodeLine(node) === getNodeLine(nextNode) ||
|
|
getNodeLine(nextNode) === getNodeLine(nextNode.next())
|
|
) {
|
|
return getNextNonSharedLineCommentNode(nextNode);
|
|
}
|
|
|
|
return nextNode;
|
|
};
|