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