isAfterStandardPropertyDeclaration.js 632 B

1234567891011121314151617181920
  1. 'use strict';
  2. const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode');
  3. const isCustomProperty = require('./isCustomProperty');
  4. const isStandardSyntaxDeclaration = require('./isStandardSyntaxDeclaration');
  5. const { isDeclaration } = require('./typeGuards');
  6. /**
  7. * @param {import('postcss').Node} node
  8. */
  9. module.exports = function isAfterStandardPropertyDeclaration(node) {
  10. const prevNode = getPreviousNonSharedLineCommentNode(node);
  11. return (
  12. prevNode !== undefined &&
  13. isDeclaration(prevNode) &&
  14. isStandardSyntaxDeclaration(prevNode) &&
  15. !isCustomProperty(prevNode.prop || '')
  16. );
  17. };