gochan-org / gochan

Either all code paths should have explicit returns, or none of them JS-0045
Anti-pattern
Minor
2 months ago2 years old
Expected to return a value at the end of arrow function
23	if(!canNotify())
24		return;
25
26	Notification.requestPermission().then(granted => {27		if(granted !== "granted")
28			return Promise.reject("denied");
29	}).catch(err => {
Expected to return a value at the end of function 'getAction'
227	);
228}
229
230function getAction(id: string) {231	for(const action of staffActions) {
232		if(action.id === id) {
233			return action;
Function 'banSelectedPost' expected no return value
204	const checks = $("input[type=checkbox]");
205	if(checks.length === 0) {
206		alertLightbox("No posts selected");
207		return false;208	}
209	let postID = 0;
210	for(let i = 0; i < checks.length; i++) {
Method 'success' expected no return value
236				});
237				if(!getBooleanStorageVal("persistentqr", false))
238					closeQR();
239				return false;240			},
241			error: (_jqXHR, _status, error) => {
242				alertLightbox(error, "Error");
Function 'initQR' expected no return value
100	}
101
102	if(!getBooleanStorageVal("useqr", true)) {
103		return closeQR();104	}
105
106	const onPostingPage = $("form input[name=boardid]").length > 0;