Skip to content

Commit 9136c82

Browse files
committed
refactor: fix lint errors and warnings
1 parent 5e1a9b8 commit 9136c82

File tree

5 files changed

+32
-36
lines changed

5 files changed

+32
-36
lines changed

src/js/charts.js

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable object-curly-newline */
21
/* global Chart */
32

43
/**
@@ -8,31 +7,30 @@
87
* --------------------------------------------------------------------------
98
*/
109

11-
/* eslint-disable no-magic-numbers */
1210
// random Numbers
1311
const random = () => Math.round(Math.random() * 100)
1412

1513
// eslint-disable-next-line no-unused-vars
1614
const lineChart = new Chart(document.getElementById('canvas-1'), {
1715
type: 'line',
1816
data: {
19-
labels : ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
20-
datasets : [
17+
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
18+
datasets: [
2119
{
2220
label: 'My First dataset',
23-
backgroundColor : 'rgba(220, 220, 220, 0.2)',
24-
borderColor : 'rgba(220, 220, 220, 1)',
25-
pointBackgroundColor : 'rgba(220, 220, 220, 1)',
26-
pointBorderColor : '#fff',
27-
data : [random(), random(), random(), random(), random(), random(), random()]
21+
backgroundColor: 'rgba(220, 220, 220, 0.2)',
22+
borderColor: 'rgba(220, 220, 220, 1)',
23+
pointBackgroundColor: 'rgba(220, 220, 220, 1)',
24+
pointBorderColor: '#fff',
25+
data: [random(), random(), random(), random(), random(), random(), random()]
2826
},
2927
{
3028
label: 'My Second dataset',
31-
backgroundColor : 'rgba(151, 187, 205, 0.2)',
32-
borderColor : 'rgba(151, 187, 205, 1)',
33-
pointBackgroundColor : 'rgba(151, 187, 205, 1)',
34-
pointBorderColor : '#fff',
35-
data : [random(), random(), random(), random(), random(), random(), random()]
29+
backgroundColor: 'rgba(151, 187, 205, 0.2)',
30+
borderColor: 'rgba(151, 187, 205, 1)',
31+
pointBackgroundColor: 'rgba(151, 187, 205, 1)',
32+
pointBorderColor: '#fff',
33+
data: [random(), random(), random(), random(), random(), random(), random()]
3634
}
3735
]
3836
},
@@ -45,21 +43,21 @@ const lineChart = new Chart(document.getElementById('canvas-1'), {
4543
const barChart = new Chart(document.getElementById('canvas-2'), {
4644
type: 'bar',
4745
data: {
48-
labels : ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
49-
datasets : [
46+
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
47+
datasets: [
5048
{
51-
backgroundColor : 'rgba(220, 220, 220, 0.5)',
52-
borderColor : 'rgba(220, 220, 220, 0.8)',
49+
backgroundColor: 'rgba(220, 220, 220, 0.5)',
50+
borderColor: 'rgba(220, 220, 220, 0.8)',
5351
highlightFill: 'rgba(220, 220, 220, 0.75)',
5452
highlightStroke: 'rgba(220, 220, 220, 1)',
55-
data : [random(), random(), random(), random(), random(), random(), random()]
53+
data: [random(), random(), random(), random(), random(), random(), random()]
5654
},
5755
{
58-
backgroundColor : 'rgba(151, 187, 205, 0.5)',
59-
borderColor : 'rgba(151, 187, 205, 0.8)',
60-
highlightFill : 'rgba(151, 187, 205, 0.75)',
61-
highlightStroke : 'rgba(151, 187, 205, 1)',
62-
data : [random(), random(), random(), random(), random(), random(), random()]
56+
backgroundColor: 'rgba(151, 187, 205, 0.5)',
57+
borderColor: 'rgba(151, 187, 205, 0.8)',
58+
highlightFill: 'rgba(151, 187, 205, 0.75)',
59+
highlightStroke: 'rgba(151, 187, 205, 1)',
60+
data: [random(), random(), random(), random(), random(), random(), random()]
6361
}
6462
]
6563
},

src/js/colors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global coreui.Utils.rgbToHex */
1+
/* global coreui */
22

33
/**
44
* --------------------------------------------------------------------------
@@ -7,7 +7,7 @@
77
* --------------------------------------------------------------------------
88
*/
99

10-
document.querySelectorAll('.theme-color').forEach((element) => {
10+
document.querySelectorAll('.theme-color').forEach(element => {
1111
const color = getComputedStyle(element, null).getPropertyValue('background-color')
1212
const table = document.createElement('table')
1313
table.classList.add('w-100')

src/js/main.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/* eslint-disable object-shorthand */
2-
/* global Chart, coreui, coreui.Utils.getStyle, coreui.Utils.hexToRgba */
1+
/* global Chart, coreui */
32

43
/**
54
* --------------------------------------------------------------------------
@@ -8,7 +7,6 @@
87
* --------------------------------------------------------------------------
98
*/
109

11-
/* eslint-disable no-magic-numbers */
1210
// Disable the on-canvas tooltip
1311
Chart.defaults.pointHitDetectionRadius = 1
1412
Chart.defaults.plugins.tooltip.enabled = false
@@ -43,7 +41,7 @@ const cardChart1 = new Chart(document.getElementById('card-chart1'), {
4341
x: {
4442
grid: {
4543
display: false,
46-
drawBorder: false,
44+
drawBorder: false
4745
},
4846
ticks: {
4947
display: false
@@ -57,7 +55,7 @@ const cardChart1 = new Chart(document.getElementById('card-chart1'), {
5755
display: false
5856
},
5957
ticks: {
60-
display: false,
58+
display: false
6159
}
6260
}
6361
},

src/js/toasts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
const toastTrigger = document.getElementById('liveToastBtn')
1111
const toastLiveExample = document.getElementById('liveToast')
1212
if (toastTrigger) {
13-
toastTrigger.addEventListener('click', function () {
13+
toastTrigger.addEventListener('click', () => {
1414
const toast = new coreui.Toast(toastLiveExample)
1515
toast.show()
1616
})
17-
}
17+
}

src/js/widgets.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* --------------------------------------------------------------------------
88
*/
99

10-
/* eslint-disable no-magic-numbers */
1110
// Disable the on-canvas tooltip
1211
Chart.defaults.pointHitDetectionRadius = 1
1312
Chart.defaults.plugins.tooltip.enabled = false
@@ -42,7 +41,7 @@ const cardChart1 = new Chart(document.getElementById('card-chart1'), {
4241
x: {
4342
grid: {
4443
display: false,
45-
drawBorder: false,
44+
drawBorder: false
4645
},
4746
ticks: {
4847
display: false
@@ -56,7 +55,7 @@ const cardChart1 = new Chart(document.getElementById('card-chart1'), {
5655
display: false
5756
},
5857
ticks: {
59-
display: false,
58+
display: false
6059
}
6160
}
6261
},
@@ -223,6 +222,7 @@ const cardChart4 = new Chart(document.getElementById('card-chart4'), {
223222
})
224223

225224
// Random Numbers
225+
// eslint-disable-next-line no-mixed-operators
226226
const random = (min, max) => Math.floor(Math.random() * (max - min + 1) + min)
227227

228228
// eslint-disable-next-line no-unused-vars

0 commit comments

Comments
 (0)