Skip to content

Commit e313de6

Browse files
committed
Fix lint issues
1 parent d6e22b9 commit e313de6

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

src/flagged/applyComplexClasses.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
import _ from 'lodash'
22
import selectorParser from 'postcss-selector-parser'
33

4+
function hasInject(css) {
5+
let foundInject = false
6+
7+
css.walkAtRules('apply', () => {
8+
foundInject = true
9+
return false
10+
})
11+
12+
return foundInject
13+
}
414
function applyUtility(rule, className, replaceWith) {
5-
const selectors = rule.selectors.map(selector => {
15+
const processedSelectors = rule.selectors.map(selector => {
616
const processor = selectorParser(selectors => {
717
selectors.walkClasses(c => {
818
if (c.value === className) {
@@ -34,7 +44,7 @@ function applyUtility(rule, className, replaceWith) {
3444
parent = parent.parent
3545
}
3646

37-
cloned.selectors = selectors
47+
cloned.selectors = processedSelectors
3848
return current
3949
}
4050

@@ -115,7 +125,7 @@ function mergeAdjacentRules(initialRule, rulesToInsert) {
115125
function makeExtractUtilityRules(css) {
116126
const utilityMap = buildUtilityMap(css)
117127
const orderUtilityMap = Object.fromEntries(
118-
Object.entries(utilityMap).flatMap(([utilityName, utilities]) => {
128+
Object.entries(utilityMap).flatMap(([_utilityName, utilities]) => {
119129
return utilities.map(utility => {
120130
return [utility.index, utility]
121131
})
@@ -137,17 +147,6 @@ function makeExtractUtilityRules(css) {
137147
}
138148
}
139149

140-
function hasInject(css) {
141-
let foundInject = false
142-
143-
css.walkAtRules('apply', () => {
144-
foundInject = true
145-
return false
146-
})
147-
148-
return foundInject
149-
}
150-
151150
export default function applyComplexClasses(css) {
152151
const extractUtilityRules = makeExtractUtilityRules(css)
153152

0 commit comments

Comments
 (0)