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

@@ -9,25 +9,20 @@ import { handleParseErrors, handleParseHeaders } from '../middlewares';
import requiredParameter from '../requiredParameter';
import defaultLogger from '../logger';
import { ParseGraphQLSchema } from './ParseGraphQLSchema';
import ParseGraphQLController, {
ParseGraphQLConfig,
} from '../Controllers/ParseGraphQLController';
import ParseGraphQLController, { ParseGraphQLConfig } from '../Controllers/ParseGraphQLController';
class ParseGraphQLServer {
parseGraphQLController: ParseGraphQLController;
constructor(parseServer, config) {
this.parseServer =
parseServer ||
requiredParameter('You must provide a parseServer instance!');
this.parseServer = parseServer || requiredParameter('You must provide a parseServer instance!');
if (!config || !config.graphQLPath) {
requiredParameter('You must provide a config.graphQLPath!');
}
this.config = config;
this.parseGraphQLController = this.parseServer.config.parseGraphQLController;
this.log =
(this.parseServer.config && this.parseServer.config.loggerController) ||
defaultLogger;
(this.parseServer.config && this.parseServer.config.loggerController) || defaultLogger;
this.parseGraphQLSchema = new ParseGraphQLSchema({
parseGraphQLController: this.parseGraphQLController,
databaseController: this.parseServer.config.databaseController,
@@ -52,9 +47,7 @@ class ParseGraphQLServer {
},
};
} catch (e) {
this.log.error(
e.stack || (typeof e.toString === 'function' && e.toString()) || e
);
this.log.error(e.stack || (typeof e.toString === 'function' && e.toString()) || e);
throw e;
}
}
@@ -101,9 +94,7 @@ class ParseGraphQLServer {
}
app.get(
this.config.playgroundPath ||
requiredParameter(
'You must provide a config.playgroundPath to applyPlayground!'
),
requiredParameter('You must provide a config.playgroundPath to applyPlayground!'),
(_req, res) => {
res.setHeader('Content-Type', 'text/html');
res.write(
@@ -128,19 +119,13 @@ class ParseGraphQLServer {
execute,
subscribe,
onOperation: async (_message, params, webSocket) =>
Object.assign(
{},
params,
await this._getGraphQLOptions(webSocket.upgradeReq)
),
Object.assign({}, params, await this._getGraphQLOptions(webSocket.upgradeReq)),
},
{
server,
path:
this.config.subscriptionsPath ||
requiredParameter(
'You must provide a config.subscriptionsPath to createSubscriptions!'
),
requiredParameter('You must provide a config.subscriptionsPath to createSubscriptions!'),
}
);
}