diff --git a/.eslintrc.js b/.eslintrc.js index 01b4ac33..042057ec 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -18,6 +18,7 @@ module.exports = { '@typescript-eslint/no-unused-vars': ['error'], // 'spaced-comment': ['error', 'always', { markers: ['#region'], exceptions: ['#endregion'] }], 'quote-props': ['error', 'consistent-as-needed'], + '@typescript-eslint/strict-boolean-expressions': 'off', // '@typescript-eslint/no-use-before-define': 'off', // 'vue/no-mutating-props': 'off', // '@typescript-eslint/member-delimiter-style': 'off', @@ -27,7 +28,7 @@ module.exports = { // 'vue/no-deprecated-filter': 'off', // 'vue/no-deprecated-slot-attribute': 'off', // 'no-unused-vars': 'off', - // '@typescript-eslint/no-non-null-assertion': 'off' + '@typescript-eslint/no-non-null-assertion': 'off' }, parserOptions: { parser: '@typescript-eslint/parser', diff --git a/src/web/map-check/WidgetMapCheck.vue b/src/web/map-check/WidgetMapCheck.vue index d6e42691..87dac2e6 100644 --- a/src/web/map-check/WidgetMapCheck.vue +++ b/src/web/map-check/WidgetMapCheck.vue @@ -88,7 +88,7 @@ export default defineComponent({ const mapStats = computed(() => { return prepareMapStats(item.value!) }) - const image = computed (() => { + const image = computed(() => { if (!item.value) return undefined const entry = mapName.value && MAP_IMGS.get(mapName.value) diff --git a/src/web/price-check/filters/FilterModifierAnointment.vue b/src/web/price-check/filters/FilterModifierAnointment.vue index 18d4a629..6ab76e1a 100644 --- a/src/web/price-check/filters/FilterModifierAnointment.vue +++ b/src/web/price-check/filters/FilterModifierAnointment.vue @@ -50,6 +50,6 @@ export default defineComponent({ return { result } - } + } }) diff --git a/src/web/price-check/filters/FilterName.vue b/src/web/price-check/filters/FilterName.vue index b58cfe66..922ed318 100644 --- a/src/web/price-check/filters/FilterName.vue +++ b/src/web/price-check/filters/FilterName.vue @@ -30,7 +30,7 @@ export default defineComponent({ required: true } }, - setup (props, ctx) { + setup (props) { const { t } = useI18n() const label = computed(() => { diff --git a/src/web/price-check/filters/unique-roll.ts b/src/web/price-check/filters/unique-roll.ts index 5b397cff..6432c62e 100644 --- a/src/web/price-check/filters/unique-roll.ts +++ b/src/web/price-check/filters/unique-roll.ts @@ -6,7 +6,7 @@ import { StatFilter } from './interfaces' import { getRollAsSingleNumber } from '@/parser/utils' import { Config } from '@/web/Config' -function isConstantMod (mod: UniqueItem['stats'][0]) { +function isConstantMod (mod: UniqueItem['stats'][0]): boolean { return mod.bounds.every(b => b.min === b.max) } @@ -23,7 +23,7 @@ export function uniqueModFilterPartial ( mod: ItemModifier, filter: Writeable ): void { - const uniqueInfo = UNIQUES.get(`${item.name} ${item.baseType}`) + const uniqueInfo = UNIQUES.get(`${item.name} ${item.baseType!}`) if (!uniqueInfo) return fallbackToExact(mod, filter) const modInfo = uniqueInfo.stats.find(stat => @@ -63,7 +63,7 @@ export function uniqueModFilterPartial ( } } -function fallbackToExact (mod: ItemModifier, filter: Writeable) { +function fallbackToExact (mod: ItemModifier, filter: Writeable): void { if (mod.values) { filter.roll = getRollAsSingleNumber(mod.values) filter.defaultMin = filter.roll diff --git a/src/web/price-check/filters/util.ts b/src/web/price-check/filters/util.ts index 79ce282d..61d375bf 100644 --- a/src/web/price-check/filters/util.ts +++ b/src/web/price-check/filters/util.ts @@ -2,14 +2,14 @@ import { StatFilter } from './interfaces' import { rollCountDecimals } from '@/parser/utils' import { Config } from '@/web/Config' -function percentRoll (value: number, p: number, method: Math['floor'] | Math['ceil'], decimals?: number) { +function percentRoll (value: number, p: number, method: Math['floor'] | Math['ceil'], decimals?: number): number { const res = value + value * p / 100 const rounding = Math.pow(10, decimals != null ? decimals : rollCountDecimals(value)) return method((res + Number.EPSILON) * rounding) / rounding } -export function percentRollDelta (value: number, delta: number, p: number, method: Math['floor'] | Math['ceil']) { +export function percentRollDelta (value: number, delta: number, p: number, method: Math['floor'] | Math['ceil']): number { const res = value + delta * p / 100 const rounding = Math.pow(10, rollCountDecimals(value)) @@ -18,10 +18,8 @@ export function percentRollDelta (value: number, delta: number, p: number, metho export function rollToFilter ( roll: number, - opts?: { - neverNegated?: true - decimals?: number -}): Pick { + opts?: { neverNegated?: true, decimals?: number } +): Pick { const percent = Config.store.searchStatRange // opts.neverNegated is false only in one case, but keep it diff --git a/src/web/price-check/price-prediction/poeprices.ts b/src/web/price-check/price-prediction/poeprices.ts index 6a9d8ef4..2d9afc83 100644 --- a/src/web/price-check/price-prediction/poeprices.ts +++ b/src/web/price-check/price-prediction/poeprices.ts @@ -55,7 +55,7 @@ export async function requestPoeprices (item: ParsedItem): Promise { const body = new FormData() body.append('selector', feedback.option) body.append('feedbacktxt', feedback.text) diff --git a/src/web/price-check/trade/common.ts b/src/web/price-check/trade/common.ts index 7f144a67..ed19ce9e 100644 --- a/src/web/price-check/trade/common.ts +++ b/src/web/price-check/trade/common.ts @@ -24,7 +24,7 @@ export interface SearchResult { } export function apiToSatisfySearch (item: ParsedItem, stats: StatFilter[]): 'trade' | 'bulk' { - if (stats.some(s => s.disabled === false)) { + if (stats.some(s => !s.disabled)) { return 'trade' } @@ -54,7 +54,7 @@ const ENDPOINT_BY_LANG = { ru: 'ru.pathofexile.com' } -export function getTradeEndpoint () { +export function getTradeEndpoint (): string { return ENDPOINT_BY_LANG[Config.store.language] } @@ -71,7 +71,7 @@ export const RATE_LIMIT_RULES = { ] } -export function adjustRateLimits (clientLimits: RateLimiter[], headers: Headers) { +export function adjustRateLimits (clientLimits: RateLimiter[], headers: Headers): RateLimiter[] { if (!headers.has('x-rate-limit-rules')) return clientLimits const rules = headers.get('x-rate-limit-rules')!.split(',') @@ -83,7 +83,7 @@ export function adjustRateLimits (clientLimits: RateLimiter[], headers: Headers) ) } -function _adjustRateLimits (clientLimits: RateLimiter[], limitStr: string, stateStr: string) { /* eslint-disable no-console */ +function _adjustRateLimits (clientLimits: RateLimiter[], limitStr: string, stateStr: string): RateLimiter[] { /* eslint-disable no-console */ const DEBUG = false const DESYNC_FIX = 0 @@ -137,6 +137,7 @@ function _adjustRateLimits (clientLimits: RateLimiter[], limitStr: string, state DEBUG && console.log('Add', rl.toString()) Array(serverLimit.state).fill(undefined).forEach(() => { + // eslint-disable-next-line @typescript-eslint/no-floating-promises rl.wait() }) }