This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/node_modules/stylelint/lib/utils/isAfterStandardPropertyDeclaration.js
2020-11-01 22:46:04 +00:00

21 lines
585 B
JavaScript

'use strict';
const _ = require('lodash');
const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode');
const isCustomProperty = require('./isCustomProperty');
const isStandardSyntaxDeclaration = require('./isStandardSyntaxDeclaration');
/**
* @param {import('postcss').Node} node
*/
module.exports = function (node) {
const prevNode = getPreviousNonSharedLineCommentNode(node);
return (
prevNode !== undefined &&
prevNode.type === 'decl' &&
isStandardSyntaxDeclaration(prevNode) &&
!isCustomProperty(_.get(prevNode, 'prop', ''))
);
};