securityos/node_modules/stylelint/lib/utils/isAfterStandardPropertyDecl...

21 lines
632 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
'use strict';
const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode');
const isCustomProperty = require('./isCustomProperty');
const isStandardSyntaxDeclaration = require('./isStandardSyntaxDeclaration');
const { isDeclaration } = require('./typeGuards');
/**
* @param {import('postcss').Node} node
*/
module.exports = function isAfterStandardPropertyDeclaration(node) {
const prevNode = getPreviousNonSharedLineCommentNode(node);
return (
prevNode !== undefined &&
isDeclaration(prevNode) &&
isStandardSyntaxDeclaration(prevNode) &&
!isCustomProperty(prevNode.prop || '')
);
};