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',
|
sourceType: 'module',
|
||||||
},
|
},
|
||||||
plugins: ['@typescript-eslint/eslint-plugin'],
|
plugins: ['@typescript-eslint/eslint-plugin'],
|
||||||
extends: ['plugin:@typescript-eslint/recommended'],
|
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
|
||||||
root: true,
|
root: true,
|
||||||
env: {
|
env: {
|
||||||
node: true,
|
node: true,
|
||||||
|
@ -12,4 +12,3 @@ export const run = (isPrimary: boolean) => {
|
|||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
run(cluster.isPrimary)()
|
run(cluster.isPrimary)()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ function msb(b: number) {
|
|||||||
return 8
|
return 8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-cond-assign
|
||||||
while (b >>= 1) {
|
while (b >>= 1) {
|
||||||
n++
|
n++
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { IAlternative } from '../../@types/runes'
|
import { IAlternative } from '../../@types/runes'
|
||||||
|
|
||||||
const punctuations = /[!"#\$%&'()*+-.\/:;<=>?@\[\\\]^`{|}~]/
|
const punctuations = /[!"#$%&'()*+-./:;<=>?@[\\\]^`{|}~]/
|
||||||
|
|
||||||
const hasPunctuation = (input) => punctuations.test(input)
|
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}`)
|
return why(values[this.field].includes(this.value), this.field, `does not contain ${this.value}`)
|
||||||
case '<':
|
case '<':
|
||||||
case '>':
|
case '>':
|
||||||
const actualInt = Number.parseInt(val)
|
{
|
||||||
if (Number.isNaN(actualInt)) {
|
const actualInt = Number.parseInt(val)
|
||||||
return why(false, this.field, 'not an integer field')
|
if (Number.isNaN(actualInt)) {
|
||||||
}
|
return why(false, this.field, 'not an integer field')
|
||||||
const restrictionVal = Number.parseInt(this.value)
|
}
|
||||||
if (Number.isNaN(restrictionVal)) {
|
const restrictionVal = Number.parseInt(this.value)
|
||||||
return why(false, this.field, 'not a valid integer')
|
if (Number.isNaN(restrictionVal)) {
|
||||||
}
|
return why(false, this.field, 'not a valid integer')
|
||||||
|
}
|
||||||
|
|
||||||
if (this.cond === '<') {
|
if (this.cond === '<') {
|
||||||
return why(actualInt < restrictionVal, this.field, `>= ${restrictionVal}`)
|
return why(actualInt < restrictionVal, this.field, `>= ${restrictionVal}`)
|
||||||
} else {
|
} else {
|
||||||
return why(actualInt > restrictionVal, this.field, `<= ${restrictionVal}`)
|
return why(actualInt > restrictionVal, this.field, `<= ${restrictionVal}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case '{':
|
case '{':
|
||||||
return why(val < this.value, this.field, `is the same or ordered after ${this.value}`)
|
return why(val < this.value, this.field, `is the same or ordered after ${this.value}`)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user