FACK1 / fid-or

0 stars 1 forks source link

eslint #18

Open mhmdtshref opened 5 years ago

mhmdtshref commented 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:

  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.

orjwan98 commented 5 years ago

Thank you for your feedback :)