summaryrefslogtreecommitdiff
path: root/scripts/frontend/stylelint/stylelint-utils.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 18:18:33 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 18:18:33 +0000
commitf64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch)
treea2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /scripts/frontend/stylelint/stylelint-utils.js
parentbfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff)
downloadgitlab-ce-f64a639bcfa1fc2bc89ca7db268f594306edfd7c.tar.gz
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'scripts/frontend/stylelint/stylelint-utils.js')
-rw-r--r--scripts/frontend/stylelint/stylelint-utils.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/frontend/stylelint/stylelint-utils.js b/scripts/frontend/stylelint/stylelint-utils.js
index e7452b0cdb2..c9d9c7d9aad 100644
--- a/scripts/frontend/stylelint/stylelint-utils.js
+++ b/scripts/frontend/stylelint/stylelint-utils.js
@@ -1,5 +1,5 @@
-const stylelint = require('stylelint');
const md5 = require('md5');
+const stylelint = require('stylelint');
module.exports.createPropertiesHashmap = (
ruleRoot,
@@ -15,7 +15,7 @@ module.exports.createPropertiesHashmap = (
if (
rule &&
rule.parent &&
- rule.parent.type != 'atrule' &&
+ rule.parent.type !== 'atrule' &&
!(
selector.includes('-webkit-') ||
selector.includes('-moz-') ||
@@ -25,7 +25,7 @@ module.exports.createPropertiesHashmap = (
)
) {
let cssArray = [];
- rule.nodes.forEach(function (property) {
+ rule.nodes.forEach((property) => {
const { prop, value } = property;
if (property && value) {
const propval = `${prop}${value}${property.important ? '!important' : ''}`;
@@ -41,11 +41,11 @@ module.exports.createPropertiesHashmap = (
const selObj = selectorGroups[hashValue];
const selectorLine = `${selector} (${
- rule.source.input.file ? rule.source.input.file + ' -' : ''
+ rule.source.input.file ? `${rule.source.input.file} -` : ''
}${rule.source.start.line}:${rule.source.start.column})`;
if (selObj) {
- if (selectorGroups[hashValue].selectors.indexOf(selector) == -1) {
+ if (selectorGroups[hashValue].selectors.indexOf(selector) === -1) {
let lastSelector =
selectorGroups[hashValue].selectors[selectorGroups[hashValue].selectors.length - 1];
@@ -67,6 +67,7 @@ module.exports.createPropertiesHashmap = (
}
}
} else if (addSelectors) {
+ // eslint-disable-next-line no-param-reassign
selectorGroups[hashValue] = {
selectors: [selectorLine],
};