fix(prettier): Properly handle lint-stage files (#6970)

Now handles top level files and recursive files in folders.

Set max line length to be 100
This commit is contained in:
Diamond Lewis
2020-10-25 15:06:58 -05:00
committed by GitHub
parent c2f2281e6d
commit e6ac3b6932
178 changed files with 5585 additions and 10688 deletions

View File

@@ -47,18 +47,13 @@ const encodeBody = function ({ body, headers = {} }) {
} else {
/* istanbul ignore next */
if (contentTypeKeys.length > 1) {
log.error(
'Parse.Cloud.httpRequest',
'multiple content-type headers are set.'
);
log.error('Parse.Cloud.httpRequest', 'multiple content-type headers are set.');
}
// There maybe many, we'll just take the 1st one
var contentType = contentTypeKeys[0];
if (headers[contentType].match(/application\/json/i)) {
body = JSON.stringify(body);
} else if (
headers[contentType].match(/application\/x-www-form-urlencoded/i)
) {
} else if (headers[contentType].match(/application\/x-www-form-urlencoded/i)) {
body = querystring.stringify(body);
}
}
@@ -137,10 +132,7 @@ module.exports = function httpRequest(options) {
requestOptions.agent = options.agent;
}
return new Promise((resolve, reject) => {
const req = client.request(
requestOptions,
makeCallback(resolve, reject, options)
);
const req = client.request(requestOptions, makeCallback(resolve, reject, options));
if (options.body) {
req.write(options.body);
}