Merge pull request #3243 from valadaptive/no-unneeded-ternary Enable no-unneeded-ternary ESLint rule
Signed| @@ -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', | ||
| 94 | 95 | ||
| 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', |
| @@ -440,7 +440,7 @@ async function onChatChanged() { | |||
| 440 | const context = getContext(); | 440 | const context = getContext(); |
| 441 | 441 | ||
| 442 | // Disable the chara note if in a group | 442 | // 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); |
| 444 | 444 | ||
| 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); |
| @@ -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, |