DEV: Fix `no-extra-boolean-cast` lint (#24582)

This commit is contained in:
Jarek Radosz 2023-11-28 10:37:23 +01:00 committed by GitHub
parent cbc5694b77
commit a80e32fe75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 8 deletions

View File

@ -56,8 +56,7 @@ export default function makeEngine(
allowLister.allowListFeature(feature, info);
});
options.sanitizer = options.discourse.sanitizer = !!options.discourse
.sanitize
options.sanitizer = options.discourse.sanitizer = options.discourse.sanitize
? (a) => sanitize(a, allowLister)
: (a) => a;
}

View File

@ -389,7 +389,7 @@ export default Controller.extend({
Promise.resolve(categoryTagSearch)
.then(async (results) => {
const categories = results.filter((c) => Boolean(c.model));
const tags = results.filter((c) => !Boolean(c.model));
const tags = results.filter((c) => !c.model);
const model = (await translateResults({ categories, tags })) || {};
this.set("model", model);
})

View File

@ -206,7 +206,7 @@ export default class StoreService extends Service {
createRecord(type, attrs) {
attrs = attrs || {};
const adapter = this.adapterFor(type);
return !!attrs[adapter.primaryKey]
return attrs[adapter.primaryKey]
? this._hydrate(type, attrs)
: this._build(type, attrs);
}

View File

@ -122,11 +122,11 @@ export function performEmojiEscape(string, opts) {
const replacementFunction = (m, index) => {
if (isReplaceableInlineEmoji(string, index, opts.inlineEmoji)) {
if (!!allTranslations[m]) {
if (allTranslations[m]) {
return opts.emojiShortcuts ? `:${allTranslations[m]}:` : m;
} else if (!!replacements[m]) {
} else if (replacements[m]) {
return `:${replacements[m]}:`;
} else if (!!replacements[m[0]]) {
} else if (replacements[m[0]]) {
return `:${replacements[m[0]]}:`;
}
}

View File

@ -105,7 +105,7 @@ const chatTranscriptRule = {
let wrapperClasses = ["chat-transcript"];
if (!!tagInfo.attrs.chained) {
if (tagInfo.attrs.chained) {
wrapperClasses.push("chat-transcript-chained");
}