Merge pull request #3243 from valadaptive/no-unneeded-ternary Enable no-unneeded-ternary ESLint rule

6432adaf3c16c5356212c975c5a253f77e55d8bd

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
3 files changed, +3 -2Ignore whitespace
.eslintrc.cjs+1 -0
@@ -91,6 +91,7 @@ module.exports = {
91 'space-infix-ops': 'error',91 'space-infix-ops': 'error',
92 'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],92 'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
93 'no-cond-assign': 'error',93 'no-cond-assign': 'error',
94 'no-unneeded-ternary': 'error',
9495
95 // These rules should eventually be enabled.96 // These rules should eventually be enabled.
96 'no-async-promise-executor': 'off',97 'no-async-promise-executor': 'off',
public/scripts/authors-note.js+1 -1
@@ -440,7 +440,7 @@ async function onChatChanged() {
440 const context = getContext();440 const context = getContext();
441441
442 // Disable the chara note if in a group442 // Disable the chara note if in a group
443 $('#extension_floating_chara').prop('disabled', context.groupId ? true : false);443 $('#extension_floating_chara').prop('disabled', !!context.groupId);
444444
445 const tokenCounter1 = chat_metadata[metadata_keys.prompt] ? await getTokenCountAsync(chat_metadata[metadata_keys.prompt]) : 0;445 const tokenCounter1 = chat_metadata[metadata_keys.prompt] ? await getTokenCountAsync(chat_metadata[metadata_keys.prompt]) : 0;
446 $('#extension_floating_prompt_token_counter').text(tokenCounter1);446 $('#extension_floating_prompt_token_counter').text(tokenCounter1);
public/scripts/world-info.js+1 -1
@@ -4681,7 +4681,7 @@ function convertCharacterBook(characterBook) {
4681 preventRecursion: entry.extensions?.prevent_recursion ?? false,4681 preventRecursion: entry.extensions?.prevent_recursion ?? false,
4682 delayUntilRecursion: entry.extensions?.delay_until_recursion ?? false,4682 delayUntilRecursion: entry.extensions?.delay_until_recursion ?? false,
4683 disable: !entry.enabled,4683 disable: !entry.enabled,
4684 addMemo: entry.comment ? true : false,4684 addMemo: !!entry.comment,
4685 displayIndex: entry.extensions?.display_index ?? index,4685 displayIndex: entry.extensions?.display_index ?? index,
4686 probability: entry.extensions?.probability ?? 100,4686 probability: entry.extensions?.probability ?? 100,
4687 useProbability: entry.extensions?.useProbability ?? true,4687 useProbability: entry.extensions?.useProbability ?? true,