UNPKG

585 BJavaScriptView Raw
1'use strict';
2
3const _ = require('lodash');
4const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode');
5const isCustomProperty = require('./isCustomProperty');
6const isStandardSyntaxDeclaration = require('./isStandardSyntaxDeclaration');
7
8/**
9 * @param {import('postcss').Node} node
10 */
11module.exports = function (node) {
12 const prevNode = getPreviousNonSharedLineCommentNode(node);
13
14 return (
15 prevNode !== undefined &&
16 prevNode.type === 'decl' &&
17 isStandardSyntaxDeclaration(prevNode) &&
18 !isCustomProperty(_.get(prevNode, 'prop', ''))
19 );
20};