mirror of
https://github.com/Cameri/nostream.git
synced 2025-03-17 13:21:45 +01:00
chore: improve linting
This commit is contained in:
parent
cda8df166f
commit
4941f8307a
@ -4,7 +4,7 @@ module.exports = {
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['@typescript-eslint/eslint-plugin'],
|
||||
extends: ['plugin:@typescript-eslint/recommended'],
|
||||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
|
||||
root: true,
|
||||
env: {
|
||||
node: true,
|
||||
|
@ -12,4 +12,3 @@ export const run = (isPrimary: boolean) => {
|
||||
if (require.main === module) {
|
||||
run(cluster.isPrimary)()
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ function msb(b: number) {
|
||||
return 8
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-cond-assign
|
||||
while (b >>= 1) {
|
||||
n++
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { IAlternative } from '../../@types/runes'
|
||||
|
||||
const punctuations = /[!"#\$%&'()*+-.\/:;<=>?@\[\\\]^`{|}~]/
|
||||
const punctuations = /[!"#$%&'()*+-./:;<=>?@[\\\]^`{|}~]/
|
||||
|
||||
const hasPunctuation = (input) => punctuations.test(input)
|
||||
|
||||
@ -54,19 +54,21 @@ export class Alternative implements IAlternative {
|
||||
return why(values[this.field].includes(this.value), this.field, `does not contain ${this.value}`)
|
||||
case '<':
|
||||
case '>':
|
||||
const actualInt = Number.parseInt(val)
|
||||
if (Number.isNaN(actualInt)) {
|
||||
return why(false, this.field, 'not an integer field')
|
||||
}
|
||||
const restrictionVal = Number.parseInt(this.value)
|
||||
if (Number.isNaN(restrictionVal)) {
|
||||
return why(false, this.field, 'not a valid integer')
|
||||
}
|
||||
{
|
||||
const actualInt = Number.parseInt(val)
|
||||
if (Number.isNaN(actualInt)) {
|
||||
return why(false, this.field, 'not an integer field')
|
||||
}
|
||||
const restrictionVal = Number.parseInt(this.value)
|
||||
if (Number.isNaN(restrictionVal)) {
|
||||
return why(false, this.field, 'not a valid integer')
|
||||
}
|
||||
|
||||
if (this.cond === '<') {
|
||||
return why(actualInt < restrictionVal, this.field, `>= ${restrictionVal}`)
|
||||
} else {
|
||||
return why(actualInt > restrictionVal, this.field, `<= ${restrictionVal}`)
|
||||
if (this.cond === '<') {
|
||||
return why(actualInt < restrictionVal, this.field, `>= ${restrictionVal}`)
|
||||
} else {
|
||||
return why(actualInt > restrictionVal, this.field, `<= ${restrictionVal}`)
|
||||
}
|
||||
}
|
||||
case '{':
|
||||
return why(val < this.value, this.field, `is the same or ordered after ${this.value}`)
|
||||
|
Loading…
x
Reference in New Issue
Block a user