mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 01:07:01 +08:00
Add one more deps "@typescript-eslint/utils" to top level to be used in our own custom rules (also needed override if I didn't). Bug: none Change-Id: I130415d1ec5f096ca51200df3eb688dadd963d0f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6343232 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
29 lines
836 B
JavaScript
29 lines
836 B
JavaScript
// NOTICE: This file is generated by Rollup. To modify it,
|
|
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
|
|
'use strict';
|
|
|
|
const findNodeUpToRoot = require('./findNodeUpToRoot.cjs');
|
|
const typeGuards = require('./typeGuards.cjs');
|
|
const atKeywords = require('../reference/atKeywords.cjs');
|
|
|
|
/** @import { Declaration, Node } from 'postcss' */
|
|
|
|
/**
|
|
* Check whether a declaration is a descriptor one
|
|
*
|
|
* @param {Declaration} decl
|
|
* @returns {boolean}
|
|
*/
|
|
function isDescriptorDeclaration(decl) {
|
|
return Boolean(findNodeUpToRoot(decl, isAtRuleSupportingDescriptors));
|
|
}
|
|
|
|
/**
|
|
* @param {Node} node
|
|
*/
|
|
function isAtRuleSupportingDescriptors(node) {
|
|
return typeGuards.isAtRule(node) && !atKeywords.nestingSupportedAtKeywords.has(node.name.toLowerCase());
|
|
}
|
|
|
|
module.exports = isDescriptorDeclaration;
|