Skip to content

Commit 89ca966

Browse files
authored
Update deps (#172)
* update XO and Ava * update various deps Co-authored-by: Bart Veneman <bartveneman@users.noreply.github.com>
1 parent 4c961f4 commit 89ca966

File tree

11 files changed

+2855
-3412
lines changed

11 files changed

+2855
-3412
lines changed

package-lock.json

Lines changed: 2828 additions & 3388 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
]
5555
},
5656
"dependencies": {
57-
"color-sorter": "^4.0.0",
57+
"color-sorter": "^4.0.1",
5858
"css-at-supports-browser-h4cks-analyzer": "^2.0.0",
5959
"css-media-query-browser-h4cks-analyzer": "^2.0.0",
6060
"css-property-browser-h4cks-analyzer": "^2.0.0",
@@ -68,20 +68,20 @@
6868
"gzip-size": "^5.1.1",
6969
"is-vendor-prefixed": "^3.3.1",
7070
"path": "^0.12.7",
71-
"postcss": "^7.0.26",
72-
"postcss-values-parser": "^3.0.5",
71+
"postcss": "^7.0.27",
72+
"postcss-values-parser": "^3.1.1",
7373
"specificity": "^0.4.1",
7474
"split-css-value": "^0.1.1",
7575
"split-lines": "^2.0.0",
76-
"string-natural-compare": "^3.0.0",
76+
"string-natural-compare": "^3.0.1",
7777
"tinycolor2": "^1.4.1",
7878
"vendor-prefixes": "^1.0.0"
7979
},
8080
"devDependencies": {
81-
"ava": "^2.4.0",
81+
"ava": "^3.5.0",
8282
"coveralls": "^3.0.9",
8383
"nyc": "^15.0.0",
84-
"xo": "^0.25.3"
84+
"xo": "^0.28.0"
8585
},
8686
"nyc": {
8787
"reporter": [

src/analyzer/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const flat = require('flat')
22
const parser = require('../parser')
33

4-
function flattenObject(obj) {
5-
return flat(obj, {safe: true})
4+
function flattenObject(object) {
5+
return flat(object, {safe: true})
66
}
77

88
module.exports = async rawCss => {

src/analyzer/selectors/identifiers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = selectors => {
3535

3636
const totalIdentifiers = identifiersPerSelector
3737
.map(({count}) => count)
38-
.reduce((prev, curr) => prev + curr, 0)
38+
.reduce((total, current) => total + current, 0)
3939

4040
const sorted = identifiersPerSelector.sort(sortByIdentifiersCount)
4141
const [max] = sorted

src/analyzer/selectors/js.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const uniquer = require('../../utils/uniquer')
22

3-
const JS_REGEX = /[.|#|(?:="|')]js/i
3+
const JS_REGEX = /[.|#(?:=")]js/i
44

55
module.exports = selectors => {
66
const all = selectors.filter(selector => JS_REGEX.test(selector))

src/analyzer/values/colors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const normalizeColors = color => {
9090
}
9191
}
9292

93-
const rmTmpProps = color => {
93+
const removeTemporaryProperties = color => {
9494
// Remove temporary props that were needed for analysis
9595
return {
9696
...color,
@@ -111,7 +111,7 @@ const withDuplicateNotations = colors =>
111111
.filter(filterDuplicateColors)
112112
.map(addCount)
113113
.map(addMostCommonNotation)
114-
.map(rmTmpProps)
114+
.map(removeTemporaryProperties)
115115

116116
module.exports = declarations => {
117117
const all = declarations

src/analyzer/values/font-families.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ const uniquer = require('../../utils/uniquer')
33
const {KEYWORDS} = require('../../utils/css')
44

55
module.exports = declarations => {
6-
const all = declarations.reduce((prev, {property, value}) => {
6+
const all = declarations.reduce((previous, {property, value}) => {
77
if (KEYWORDS.includes(value)) {
8-
return prev
8+
return previous
99
}
1010

1111
if (property === 'font-family') {
12-
prev = [...prev, value]
12+
previous = [...previous, value]
1313
}
1414

1515
if (property === 'font') {
1616
const expanded = expand('font', value)
1717

1818
if (expanded) {
19-
prev = [...prev, expanded['font-family']]
19+
previous = [...previous, expanded['font-family']]
2020
}
2121
}
2222

23-
return prev
23+
return previous
2424
}, [])
2525

2626
return {

src/analyzer/values/font-sizes.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ const uniquer = require('../../utils/uniquer')
44
const {KEYWORDS} = require('../../utils/css')
55

66
module.exports = declarations => {
7-
const all = declarations.reduce((prev, {property, value}) => {
7+
const all = declarations.reduce((previous, {property, value}) => {
88
if (KEYWORDS.includes(value)) {
9-
return prev
9+
return previous
1010
}
1111

1212
if (property === 'font-size') {
13-
prev = [...prev, value]
13+
previous = [...previous, value]
1414
}
1515

1616
if (property === 'font') {
1717
const expanded = expand('font', value)
1818

1919
if (expanded) {
20-
prev = [...prev, expanded['font-size']]
20+
previous = [...previous, expanded['font-size']]
2121
}
2222
}
2323

24-
return prev
24+
return previous
2525
}, [])
2626

2727
return {

src/utils/uniquer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = (values, sortFn) => {
1414
}, new Map())
1515
].map(([value, count]) => ({value, count}))
1616

17-
const sorted = reduced.map(el => el.value).sort(sortFn)
17+
const sorted = reduced.map(element => element.value).sort(sortFn)
1818
const unique = sorted.map(value => reduced.find(r => r.value === value))
1919

2020
return {

test/parser/declarations.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ test('basic declarations are parsed', async t => {
3232
})
3333

3434
test('!important is parsed', async t => {
35+
// eslint-disable-next-line unicorn/string-content
3536
const fixture = `html {
3637
color: red !important;
3738
content: '!important';
@@ -48,7 +49,8 @@ test('!important is parsed', async t => {
4849
},
4950
{
5051
property: 'content',
51-
value: "'!important'", // eslint-disable-line quotes
52+
// eslint-disable-next-line quotes
53+
value: `'!important'`, // eslint-disable-line unicorn/string-content
5254
important: false
5355
},
5456
{

0 commit comments

Comments
 (0)