mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-17 10:27:03 -04:00
more eslint
This commit is contained in:
parent
350e7b0a6a
commit
36f4478a4f
13 changed files with 39 additions and 19 deletions
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue