chore: update prettier (#5412)

This commit is contained in:
Vladislav Shkodin
2021-05-19 14:39:35 +02:00
committed by GitHub
parent 46738492a0
commit 39f113715a
66 changed files with 1625 additions and 1763 deletions

View File

@ -310,10 +310,10 @@ export default class API {
let responseStatus = 500;
try {
const req = (unsentRequest.fromFetchArguments(url, {
const req = unsentRequest.fromFetchArguments(url, {
...options,
headers,
}) as unknown) as ApiRequest;
}) as unknown as ApiRequest;
const response = await requestWithBackoff(this, req);
responseStatus = response.status;
const parsedResponse = await parser(response);
@ -366,8 +366,7 @@ export default class API {
.catch(() => {
// Meta ref doesn't exist
const readme = {
raw:
'# Netlify CMS\n\nThis tree is used by the Netlify CMS to store metadata information for specific files and branches.',
raw: '# Netlify CMS\n\nThis tree is used by the Netlify CMS to store metadata information for specific files and branches.',
};
return this.uploadBlob(readme)
@ -808,7 +807,8 @@ export default class API {
let branches: string[];
if (this.useOpenAuthoring) {
// open authoring branches can exist without a pr
const cmsBranches: Octokit.GitListMatchingRefsResponse = await this.getOpenAuthoringBranches();
const cmsBranches: Octokit.GitListMatchingRefsResponse =
await this.getOpenAuthoringBranches();
branches = cmsBranches.map(b => b.ref.substring('refs/heads/'.length));
// filter irrelevant branches
const branchesWithFilter = await Promise.all(
@ -1036,7 +1036,7 @@ export default class API {
author,
committer,
);
return (newCommit as unknown) as GitHubCompareCommit;
return newCommit as unknown as GitHubCompareCommit;
} else {
return commit;
}

View File

@ -75,10 +75,8 @@ export default class GitHubAuthenticationPage extends React.Component {
};
const auth = new NetlifyAuthenticator(cfg);
const {
open_authoring: openAuthoring = false,
auth_scope: authScope = '',
} = this.props.config.backend;
const { open_authoring: openAuthoring = false, auth_scope: authScope = '' } =
this.props.config.backend;
const scope = authScope || (openAuthoring ? 'public_repo' : 'repo');
auth.authenticate({ provider: 'github', scope }, (err, data) => {

View File

@ -300,7 +300,7 @@ export default class GraphQLAPI extends API {
const mapped = pullRequests.nodes.map(transformPullRequest);
return ((mapped as unknown) as Octokit.PullsListResponseItem[]).filter(
return (mapped as unknown as Octokit.PullsListResponseItem[]).filter(
pr => pr.head.ref.startsWith(`${CMS_BRANCH_PREFIX}/`) && predicate(pr),
);
}
@ -673,7 +673,7 @@ export default class GraphQLAPI extends API {
},
});
const { pullRequest } = data!.createPullRequest;
return (transformPullRequest(pullRequest) as unknown) as Octokit.PullsCreateResponse;
return transformPullRequest(pullRequest) as unknown as Octokit.PullsCreateResponse;
}
async getFileSha(path: string, { repoURL = this.repoURL, branch = this.branch } = {}) {

View File

@ -537,9 +537,9 @@ export default class GitHub implements Implementation {
}
const readFile = (path: string, id: string | null | undefined) =>
this.api!.readFile(path, id, { repoURL: this.api!.originRepoURL }).catch(() => '') as Promise<
string
>;
this.api!.readFile(path, id, { repoURL: this.api!.originRepoURL }).catch(
() => '',
) as Promise<string>;
const entries = await entriesByFiles(
result.files,