more eslint

This commit is contained in:
Vendicated 2022-10-20 11:58:20 +02:00
parent 350e7b0a6a
commit 36f4478a4f
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3
13 changed files with 39 additions and 19 deletions

View file

@ -18,7 +18,7 @@ export function SettingBooleanComponent({ option, pluginSettings, id, onChange,
];
function handleChange(newValue: boolean): void {
let isValid = (option.isValid && option.isValid(newValue)) ?? true;
const isValid = (option.isValid && option.isValid(newValue)) ?? true;
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else {

View file

@ -18,7 +18,7 @@ export function SettingNumericComponent({ option, pluginSettings, id, onChange,
}, [error]);
function handleChange(newValue) {
let isValid = (option.isValid && option.isValid(newValue)) ?? true;
const isValid = (option.isValid && option.isValid(newValue)) ?? true;
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else if (option.type === OptionType.NUMBER && BigInt(newValue) >= MAX_SAFE_NUMBER) {

View file

@ -13,7 +13,7 @@ export function SettingSelectComponent({ option, pluginSettings, onChange, onErr
}, [error]);
function handleChange(newValue) {
let isValid = (option.isValid && option.isValid(newValue)) ?? true;
const isValid = (option.isValid && option.isValid(newValue)) ?? true;
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else {

View file

@ -20,7 +20,7 @@ export function SettingSliderComponent({ option, pluginSettings, id, onChange, o
}, [error]);
function handleChange(newValue: number): void {
let isValid = (option.isValid && option.isValid(newValue)) ?? true;
const isValid = (option.isValid && option.isValid(newValue)) ?? true;
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else {

View file

@ -11,7 +11,7 @@ export function SettingInputComponent({ option, pluginSettings, id, onChange, on
}, [error]);
function handleChange(newValue) {
let isValid = (option.isValid && option.isValid(newValue)) ?? true;
const isValid = (option.isValid && option.isValid(newValue)) ?? true;
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else {