epiphany/node_modules/stylelint/lib/utils/isAfterStandardPropertyDeclaration.js
2023-12-09 22:48:07 -08:00

20 lines
632 B
JavaScript

'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 || '')
);
};