Open mhmdtshref opened 5 years ago
https://github.com/FACK1/fid-or/blob/237efa19fb1ea0d38b98eb9e85c9d8fe0d74fb16/src/handler.js#L9-L16
You need to use eslint to make your code use some standards, on this code, the eslint will require a return statement, because there is no return statement if the if statement conditions is false, so the code should be like this:
eslint
if
false
if (error) { response.writeHead (500, {"content-type": "text/plain"}); response.end("Server Error!"); } else{ response.writeHead(200, {"content-type": "text/html"}); response.end(html); } });
Because also if the returned value is unused when it's called, it will make an eslint errors.
Thank you for your feedback :)
https://github.com/FACK1/fid-or/blob/237efa19fb1ea0d38b98eb9e85c9d8fe0d74fb16/src/handler.js#L9-L16
You need to use
eslint
to make your code use some standards, on this code, theeslint
will require a return statement, because there is no return statement if theif
statement conditions isfalse
, so the code should be like this:Because also if the returned value is unused when it's called, it will make an eslint errors.