Skip to content

Commit f16be58

Browse files
tenshiAMDBerkmann18
authored andcommitted
chore: lint codes
1 parent eb87e4d commit f16be58

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/aboutLabels.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const ck = require('chalk')
21
const {join} = require('path')
2+
const ck = require('chalk')
33
const labels = require(join(__dirname, './labels.json'))
44
const cats = require(join(__dirname, './categories.json'))
55

src/confusionMatrix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class ConfusionMatrix {
8181
this.matrix = objectify(this.classes)
8282
for (const category in this.matrix) {
8383
if (this.matrix.hasOwnProperty(category))
84-
this.matrix[category] = objectify(this.classes, 0)
84+
{this.matrix[category] = objectify(this.classes, 0)}
8585
}
8686
} else this.matrix = matrix
8787
}
@@ -130,7 +130,7 @@ class ConfusionMatrix {
130130
*/
131131
static fromData(actual, predictions, classes = []) {
132132
if (actual.length !== predictions.length)
133-
throw new Error("actual and predictions don't have the same length")
133+
{throw new Error("actual and predictions don't have the same length")}
134134
const cm = new ConfusionMatrix(
135135
classes.length ? classes : [...actual, ...predictions],
136136
)

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ class Learner {
102102
predicted.push(guess) //Ignores the rest (as it only wants one guess)
103103
if (log) {
104104
if (guess === data.output)
105-
succ(`Classified "${data.input}" as "${guess}"`)
105+
{succ(`Classified "${data.input}" as "${guess}"`)}
106106
else
107-
error(
107+
{error(
108108
`Classified "${data.input}" as "${guess}" instead of "${use(
109109
'info',
110110
data.output,
111111
)}"`,
112-
)
112+
)}
113113
}
114114
spinner.message(
115115
`Evaluating instances (${Math.round((idx++ / len) * 10000) / 100}%)`,
@@ -337,7 +337,7 @@ class Learner {
337337
++res[data.output].overall
338338
if (hasInput(this.trainSet, data.input)) ++res[data.output].train
339339
if (hasInput(this.validationSet, data.input))
340-
++res[data.output].validation
340+
{++res[data.output].validation}
341341
if (hasInput(this.testSet, data.input)) ++res[data.output].test
342342
})
343343

src/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const copy = el => {
1111
typeof el === 'number' ||
1212
typeof el === 'boolean'
1313
)
14-
return el
14+
{return el}
1515
//As they are immutable types
1616
else {
1717
const clone = {}
@@ -124,7 +124,7 @@ const rmEmpty = matrix => {
124124
const nonEmpty = {}
125125
for (const row in matrix) {
126126
if (matrix.hasOwnProperty(row) && !empty.includes(row))
127-
nonEmpty[row] = matrix[row]
127+
{nonEmpty[row] = matrix[row]}
128128
}
129129
return nonEmpty
130130
}
@@ -140,7 +140,7 @@ const rmEmpty = matrix => {
140140
*/
141141
const hexSeries = (position, start = 0.1, inc = 0.1) => {
142142
if (position < 0 || position > 2)
143-
throw new Error('position needs be between 0 and 2')
143+
{throw new Error('position needs be between 0 and 2')}
144144
const TEMPLATE = ['00', '00', '00']
145145
const res = []
146146
for (let i = start; i <= 1; i += inc) {

0 commit comments

Comments
 (0)