Skip to content

Commit 79af5c7

Browse files
committed
chore: fix lint warnings and errors
1 parent 264ce03 commit 79af5c7

File tree

7 files changed

+284
-283
lines changed

7 files changed

+284
-283
lines changed

build/change-version.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-r
1818

1919
// These are the filetypes we only care about replacing the version
2020
const GLOB = [
21-
'**/*.{css,html,js,json,md,pug,scss,txt,yml}',
21+
'**/*.{css,html,js,json,md,pug,scss,txt,yml}'
2222
]
2323
const GLOBBY_OPTIONS = {
2424
cwd: path.join(__dirname, '..'),
25-
gitignore: true,
25+
gitignore: true
2626
}
2727
const EXCLUDED_FILES = [
28-
'CHANGELOG.md',
28+
'CHANGELOG.md'
2929
]
3030

3131
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
@@ -40,7 +40,7 @@ function regExpQuoteReplacement(string) {
4040
async function replaceRecursively(file, oldVersion, newVersion) {
4141
const originalString = await fs.readFile(file, 'utf8')
4242
const newString = originalString.replace(
43-
new RegExp(regExpQuote(oldVersion), 'g'), regExpQuoteReplacement(newVersion),
43+
new RegExp(regExpQuote(oldVersion), 'g'), regExpQuoteReplacement(newVersion)
4444
)
4545

4646
// No need to move any further if the strings are identical

build/postcss.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
'use strict'
22

33
module.exports = ctx => ({
4-
map: ctx.file.dirname.includes('examples')
5-
? false
6-
: {
4+
map: ctx.file.dirname.includes('examples') ?
5+
false :
6+
{
77
inline: false,
88
annotation: true,
9-
sourcesContent: true,
9+
sourcesContent: true
1010
},
1111
plugins: {
1212
autoprefixer: {
13-
cascade: false,
13+
cascade: false
1414
},
15-
'postcss-combine-duplicated-selectors': {},
16-
},
15+
'postcss-combine-duplicated-selectors': {}
16+
}
1717
})

build/pug.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,34 @@ const globby = require('globby')
1111

1212
// These are the filetypes we only care about replacing the version
1313
const GLOB = [
14-
'**/*.pug',
14+
'**/*.pug'
1515
]
1616

1717
const SRC = 'src/pug/views/'
1818

1919
const GLOBBY_OPTIONS = {
20-
cwd: path.join(__dirname, '..', SRC),
20+
cwd: path.join(__dirname, '..', SRC)
21+
}
22+
23+
const base = levels => {
24+
let path = './'
25+
while (levels > 0) {
26+
levels -= 1
27+
path += '../'
28+
}
29+
30+
return path
2131
}
2232

2333
const compile = (filename, basedir) => {
2434
const levels = basedir.split(`${sep}`).filter(el => el !== '').length
25-
const base = levels => {
26-
let path = './'
27-
while (levels > 0) {
28-
levels -= 1
29-
path += '../'
30-
}
31-
32-
return path
33-
}
3435

3536
const fn = pug.compileFile(filename, {
3637
basedir: './pug/',
37-
pretty: true,
38+
pretty: true
3839
})
3940
const html = fn({
40-
base: base(levels),
41+
base: base(levels)
4142
})
4243
return html
4344
}

src/js/charts.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ const lineChart = new Chart(document.getElementById('canvas-1'), {
2222
borderColor: 'rgba(220, 220, 220, 1)',
2323
pointBackgroundColor: 'rgba(220, 220, 220, 1)',
2424
pointBorderColor: '#fff',
25-
data: [random(), random(), random(), random(), random(), random(), random()],
25+
data: [random(), random(), random(), random(), random(), random(), random()]
2626
},
2727
{
2828
label: 'My Second dataset',
2929
backgroundColor: 'rgba(151, 187, 205, 0.2)',
3030
borderColor: 'rgba(151, 187, 205, 1)',
3131
pointBackgroundColor: 'rgba(151, 187, 205, 1)',
3232
pointBorderColor: '#fff',
33-
data: [random(), random(), random(), random(), random(), random(), random()],
34-
},
35-
],
33+
data: [random(), random(), random(), random(), random(), random(), random()]
34+
}
35+
]
3636
},
3737
options: {
38-
responsive: true,
39-
},
38+
responsive: true
39+
}
4040
})
4141

4242
// eslint-disable-next-line no-unused-vars
@@ -50,20 +50,20 @@ const barChart = new Chart(document.getElementById('canvas-2'), {
5050
borderColor: 'rgba(220, 220, 220, 0.8)',
5151
highlightFill: 'rgba(220, 220, 220, 0.75)',
5252
highlightStroke: 'rgba(220, 220, 220, 1)',
53-
data: [random(), random(), random(), random(), random(), random(), random()],
53+
data: [random(), random(), random(), random(), random(), random(), random()]
5454
},
5555
{
5656
backgroundColor: 'rgba(151, 187, 205, 0.5)',
5757
borderColor: 'rgba(151, 187, 205, 0.8)',
5858
highlightFill: 'rgba(151, 187, 205, 0.75)',
5959
highlightStroke: 'rgba(151, 187, 205, 1)',
60-
data: [random(), random(), random(), random(), random(), random(), random()],
61-
},
62-
],
60+
data: [random(), random(), random(), random(), random(), random(), random()]
61+
}
62+
]
6363
},
6464
options: {
65-
responsive: true,
66-
},
65+
responsive: true
66+
}
6767
})
6868

6969
// eslint-disable-next-line no-unused-vars
@@ -74,12 +74,12 @@ const doughnutChart = new Chart(document.getElementById('canvas-3'), {
7474
datasets: [{
7575
data: [300, 50, 100],
7676
backgroundColor: ['#FF6384', '#36A2EB', '#FFCE56'],
77-
hoverBackgroundColor: ['#FF6384', '#36A2EB', '#FFCE56'],
78-
}],
77+
hoverBackgroundColor: ['#FF6384', '#36A2EB', '#FFCE56']
78+
}]
7979
},
8080
options: {
81-
responsive: true,
82-
},
81+
responsive: true
82+
}
8383
})
8484

8585
// eslint-disable-next-line no-unused-vars
@@ -96,7 +96,7 @@ const radarChart = new Chart(document.getElementById('canvas-4'), {
9696
pointBorderColor: '#fff',
9797
pointHighlightFill: '#fff',
9898
pointHighlightStroke: 'rgba(220, 220, 220, 1)',
99-
data: [65, 59, 90, 81, 56, 55, 40],
99+
data: [65, 59, 90, 81, 56, 55, 40]
100100
},
101101
{
102102
label: 'My Second dataset',
@@ -106,13 +106,13 @@ const radarChart = new Chart(document.getElementById('canvas-4'), {
106106
pointBorderColor: '#fff',
107107
pointHighlightFill: '#fff',
108108
pointHighlightStroke: 'rgba(151, 187, 205, 1)',
109-
data: [28, 48, 40, 19, 96, 27, 100],
110-
},
111-
],
109+
data: [28, 48, 40, 19, 96, 27, 100]
110+
}
111+
]
112112
},
113113
options: {
114-
responsive: true,
115-
},
114+
responsive: true
115+
}
116116
})
117117

118118
// eslint-disable-next-line no-unused-vars
@@ -123,12 +123,12 @@ const pieChart = new Chart(document.getElementById('canvas-5'), {
123123
datasets: [{
124124
data: [300, 50, 100],
125125
backgroundColor: ['#FF6384', '#36A2EB', '#FFCE56'],
126-
hoverBackgroundColor: ['#FF6384', '#36A2EB', '#FFCE56'],
127-
}],
126+
hoverBackgroundColor: ['#FF6384', '#36A2EB', '#FFCE56']
127+
}]
128128
},
129129
options: {
130-
responsive: true,
131-
},
130+
responsive: true
131+
}
132132
})
133133

134134
// eslint-disable-next-line no-unused-vars
@@ -138,10 +138,10 @@ const polarAreaChart = new Chart(document.getElementById('canvas-6'), {
138138
labels: ['Red', 'Green', 'Yellow', 'Grey', 'Blue'],
139139
datasets: [{
140140
data: [11, 16, 7, 3, 14],
141-
backgroundColor: ['#FF6384', '#4BC0C0', '#FFCE56', '#E7E9ED', '#36A2EB'],
142-
}],
141+
backgroundColor: ['#FF6384', '#4BC0C0', '#FFCE56', '#E7E9ED', '#36A2EB']
142+
}]
143143
},
144144
options: {
145-
responsive: true,
146-
},
145+
responsive: true
146+
}
147147
})

src/js/colors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ document.querySelectorAll('.theme-color').forEach(element => {
2323
</tr>
2424
</table>
2525
`
26-
element.parentNode.appendChild(table)
26+
element.parentNode.append(table)
2727
})

0 commit comments

Comments
 (0)