Skip to content

Commit 516c186

Browse files
committed
chore: improve linting
1 parent ce0e311 commit 516c186

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
sourceType: 'module',
55
},
66
plugins: ['@typescript-eslint/eslint-plugin'],
7-
extends: ['plugin:@typescript-eslint/recommended'],
7+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
88
root: true,
99
env: {
1010
node: true,

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ export const run = (isPrimary: boolean) => {
1212
if (require.main === module) {
1313
run(cluster.isPrimary)()
1414
}
15-

src/utils/proof-of-work.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function msb(b: number) {
1818
return 8
1919
}
2020

21+
// eslint-disable-next-line no-cond-assign
2122
while (b >>= 1) {
2223
n++
2324
}

src/utils/runes/alternative.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { IAlternative } from '../../@types/runes'
22

3-
const punctuations = /[!"#\$%&'()*+-.\/:;<=>?@\[\\\]^`{|}~]/
3+
const punctuations = /[!"#$%&'()*+-./:;<=>?@[\\\]^`{|}~]/
44

55
const hasPunctuation = (input) => punctuations.test(input)
66

@@ -54,19 +54,21 @@ export class Alternative implements IAlternative {
5454
return why(values[this.field].includes(this.value), this.field, `does not contain ${this.value}`)
5555
case '<':
5656
case '>':
57-
const actualInt = Number.parseInt(val)
58-
if (Number.isNaN(actualInt)) {
59-
return why(false, this.field, 'not an integer field')
60-
}
61-
const restrictionVal = Number.parseInt(this.value)
62-
if (Number.isNaN(restrictionVal)) {
63-
return why(false, this.field, 'not a valid integer')
64-
}
65-
66-
if (this.cond === '<') {
67-
return why(actualInt < restrictionVal, this.field, `>= ${restrictionVal}`)
68-
} else {
69-
return why(actualInt > restrictionVal, this.field, `<= ${restrictionVal}`)
57+
{
58+
const actualInt = Number.parseInt(val)
59+
if (Number.isNaN(actualInt)) {
60+
return why(false, this.field, 'not an integer field')
61+
}
62+
const restrictionVal = Number.parseInt(this.value)
63+
if (Number.isNaN(restrictionVal)) {
64+
return why(false, this.field, 'not a valid integer')
65+
}
66+
67+
if (this.cond === '<') {
68+
return why(actualInt < restrictionVal, this.field, `>= ${restrictionVal}`)
69+
} else {
70+
return why(actualInt > restrictionVal, this.field, `<= ${restrictionVal}`)
71+
}
7072
}
7173
case '{':
7274
return why(val < this.value, this.field, `is the same or ordered after ${this.value}`)

0 commit comments

Comments
 (0)