mirror of
https://github.com/discourse/discourse.git
synced 2025-02-22 00:03:26 +08:00
DEV: Fix no-extra-boolean-cast
lint (#24582)
This commit is contained in:
parent
cbc5694b77
commit
a80e32fe75
@ -56,8 +56,7 @@ export default function makeEngine(
|
|||||||
allowLister.allowListFeature(feature, info);
|
allowLister.allowListFeature(feature, info);
|
||||||
});
|
});
|
||||||
|
|
||||||
options.sanitizer = options.discourse.sanitizer = !!options.discourse
|
options.sanitizer = options.discourse.sanitizer = options.discourse.sanitize
|
||||||
.sanitize
|
|
||||||
? (a) => sanitize(a, allowLister)
|
? (a) => sanitize(a, allowLister)
|
||||||
: (a) => a;
|
: (a) => a;
|
||||||
}
|
}
|
||||||
|
@ -389,7 +389,7 @@ export default Controller.extend({
|
|||||||
Promise.resolve(categoryTagSearch)
|
Promise.resolve(categoryTagSearch)
|
||||||
.then(async (results) => {
|
.then(async (results) => {
|
||||||
const categories = results.filter((c) => Boolean(c.model));
|
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 })) || {};
|
const model = (await translateResults({ categories, tags })) || {};
|
||||||
this.set("model", model);
|
this.set("model", model);
|
||||||
})
|
})
|
||||||
|
@ -206,7 +206,7 @@ export default class StoreService extends Service {
|
|||||||
createRecord(type, attrs) {
|
createRecord(type, attrs) {
|
||||||
attrs = attrs || {};
|
attrs = attrs || {};
|
||||||
const adapter = this.adapterFor(type);
|
const adapter = this.adapterFor(type);
|
||||||
return !!attrs[adapter.primaryKey]
|
return attrs[adapter.primaryKey]
|
||||||
? this._hydrate(type, attrs)
|
? this._hydrate(type, attrs)
|
||||||
: this._build(type, attrs);
|
: this._build(type, attrs);
|
||||||
}
|
}
|
||||||
|
@ -122,11 +122,11 @@ export function performEmojiEscape(string, opts) {
|
|||||||
|
|
||||||
const replacementFunction = (m, index) => {
|
const replacementFunction = (m, index) => {
|
||||||
if (isReplaceableInlineEmoji(string, index, opts.inlineEmoji)) {
|
if (isReplaceableInlineEmoji(string, index, opts.inlineEmoji)) {
|
||||||
if (!!allTranslations[m]) {
|
if (allTranslations[m]) {
|
||||||
return opts.emojiShortcuts ? `:${allTranslations[m]}:` : m;
|
return opts.emojiShortcuts ? `:${allTranslations[m]}:` : m;
|
||||||
} else if (!!replacements[m]) {
|
} else if (replacements[m]) {
|
||||||
return `:${replacements[m]}:`;
|
return `:${replacements[m]}:`;
|
||||||
} else if (!!replacements[m[0]]) {
|
} else if (replacements[m[0]]) {
|
||||||
return `:${replacements[m[0]]}:`;
|
return `:${replacements[m[0]]}:`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ const chatTranscriptRule = {
|
|||||||
|
|
||||||
let wrapperClasses = ["chat-transcript"];
|
let wrapperClasses = ["chat-transcript"];
|
||||||
|
|
||||||
if (!!tagInfo.attrs.chained) {
|
if (tagInfo.attrs.chained) {
|
||||||
wrapperClasses.push("chat-transcript-chained");
|
wrapperClasses.push("chat-transcript-chained");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user