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

@@ -66,7 +66,7 @@ export default class PromiseRouter {
let handler = handlers[0];
if (handlers.length > 1) {
handler = function(req) {
handler = function (req) {
return handlers.reduce((promise, handler) => {
return promise.then(() => {
return handler(req);
@@ -121,10 +121,7 @@ export default class PromiseRouter {
tryRouteRequest(method, path, request) {
var match = this.match(method, path);
if (!match) {
throw new Parse.Error(
Parse.Error.INVALID_JSON,
'cannot route ' + method + ' ' + path
);
throw new Parse.Error(Parse.Error.INVALID_JSON, 'cannot route ' + method + ' ' + path);
}
request.params = match.params;
return new Promise((resolve, reject) => {
@@ -138,7 +135,7 @@ export default class PromiseRouter {
// Express handlers should never throw; if a promise handler throws we
// just treat it like it resolved to an error.
function makeExpressHandler(appId, promiseHandler) {
return function(req, res, next) {
return function (req, res, next) {
try {
const url = maskSensitiveUrl(req);
const body = Object.assign({}, req.body);
@@ -155,9 +152,7 @@ function makeExpressHandler(appId, promiseHandler) {
result => {
clearSchemaCache(req);
if (!result.response && !result.location && !result.text) {
log.error(
'the handler did not include a "response" or a "location" field'
);
log.error('the handler did not include a "response" or a "location" field');
throw 'control should not get here';
}