gochan-org / gochan

Avoid use of == and != JS-0050
Anti-pattern
12 days agoa year old
Expected '===' and instead saw '=='
13test("Checks mock themes to make sure the default one (defaultStyle) exists and is pipes.css", () => {
14	let styleName = "";
15	for(const style of styles) {
16		if(style.Filename == defaultStyle) {17			styleName = style.Name;
18		}
19	}
Expected '!==' and instead saw '!='
 7 */
 8function getCooldown(data: BoardsJSON, board: string, type: string) {
 9	for(const boardData of data.boards) {
10		if(boardData.board != board) continue;11		return (boardData.cooldowns as any)[type];
12	}
13}
Expected '===' and instead saw '=='
 5 * @param $elem the jQuery element of the post
 6 */
 7export function isThreadLocked($elem: JQuery<HTMLElement>) {
 8	return $elem.find("span.status-icons img.locked-icon").length == 1; 9}
10
11interface BoardLockJSON {
Expected '===' and instead saw '=='
39	}).then((_data) => {
40		alert("Thread " + (lock?"locked":"unlocked") + " successfully");
41		const $lockOpt = $(`select#op${op} option`)
42			.filter((_i, el) => el.textContent == "Lock thread" || el.textContent == "Unlock thread");43		if(lock) {
44			$(`div#op${op} span.status-icons`).append(
45				$("<img/>").attr({
Expected '===' and instead saw '=='
39	}).then((_data) => {
40		alert("Thread " + (lock?"locked":"unlocked") + " successfully");
41		const $lockOpt = $(`select#op${op} option`)
42			.filter((_i, el) => el.textContent == "Lock thread" || el.textContent == "Unlock thread");43		if(lock) {
44			$(`div#op${op} span.status-icons`).append(
45				$("<img/>").attr({