From d5a57fbb275de5f07ff4d6652dafbee224808efb Mon Sep 17 00:00:00 2001 From: Quramy Date: Fri, 15 Mar 2024 16:35:46 +0900 Subject: [PATCH 1/2] chore: Modify prettier config --- .prettierignore | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.prettierignore b/.prettierignore index 5f4ffde38..519db9e91 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,7 +1,11 @@ dist/ lib/ -project-fixtures/ __snapshots__/ **/testing/resources/*.graphql coverage/ e2e_coverage/ +.husky/ +project-fixtures/**/*.invalid.json +project-fixtures/**/__generated__/ +project-fixtures/**/manifest.json +project-fixtures/**/GRAPHQL_OPERATIONS.md diff --git a/package.json b/package.json index b15825b80..a27c21c13 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "e2e": "node e2e/run.js", "e2e:ci": "c8 -o e2e_coverage -x e2e -r json -i \"src/**/*\" node e2e/run.js", "test": "npm run format:check && npm run lint && npm run jest:ci && npm run e2e:ci", - "prettier": "prettier \"*.js\" \"*.md\" \"*.json\" \"*.yml\" \"src/**/*\" \"e2e/**/*\" \"docs/**/*\"", + "prettier": "prettier .", "format": "npm run prettier -- --write", "format:check": "npm run prettier -- --check", "doc:toc": "ts-node -P tools/tsconfig.json tools/add-toc.ts", From eb94c4fd8b5378416becb222da28b694d20ddfef Mon Sep 17 00:00:00 2001 From: Quramy Date: Fri, 15 Mar 2024 16:36:04 +0900 Subject: [PATCH 2/2] chore: Re-format --- .github/ISSUE_TEMPLATE.md | 1 - project-fixtures/gql-errors-prj/graphql-tag.d.ts | 2 +- project-fixtures/gql-errors-prj/main.ts | 4 ++-- project-fixtures/no-config-prj/graphql-tag.d.ts | 2 +- project-fixtures/react-apollo-prj/schema.graphql | 12 ++++++------ project-fixtures/react-apollo-prj/src/index.tsx | 2 +- project-fixtures/simple-prj/addon.js | 2 +- project-fixtures/simple-prj/graphql-tag.d.ts | 2 +- project-fixtures/transformation-prj/tag.ts | 2 +- .../transformation-prj/webpack.config.js | 16 ++++++---------- .../typegen-addon-prj/graphql-tag.d.ts | 2 +- 11 files changed, 21 insertions(+), 26 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 7e9aa5237..7adedeab7 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,4 @@ --- - name: Bug report about: Create a report to help us improve title: '' diff --git a/project-fixtures/gql-errors-prj/graphql-tag.d.ts b/project-fixtures/gql-errors-prj/graphql-tag.d.ts index 9725dde88..02ca46cde 100644 --- a/project-fixtures/gql-errors-prj/graphql-tag.d.ts +++ b/project-fixtures/gql-errors-prj/graphql-tag.d.ts @@ -1,4 +1,4 @@ -declare module "graphql-tag" { +declare module 'graphql-tag' { const gql: any; export default gql; } diff --git a/project-fixtures/gql-errors-prj/main.ts b/project-fixtures/gql-errors-prj/main.ts index a4be8414e..0b620bf8e 100644 --- a/project-fixtures/gql-errors-prj/main.ts +++ b/project-fixtures/gql-errors-prj/main.ts @@ -12,9 +12,9 @@ const tooComplexExpressionQuery = gql` query { ${getField()} } -` +`; const semanticErrorFragment = gql` - fragment MyFragment on Query { + fragment MyFragment on Query { hoge } `; diff --git a/project-fixtures/no-config-prj/graphql-tag.d.ts b/project-fixtures/no-config-prj/graphql-tag.d.ts index 9725dde88..02ca46cde 100644 --- a/project-fixtures/no-config-prj/graphql-tag.d.ts +++ b/project-fixtures/no-config-prj/graphql-tag.d.ts @@ -1,4 +1,4 @@ -declare module "graphql-tag" { +declare module 'graphql-tag' { const gql: any; export default gql; } diff --git a/project-fixtures/react-apollo-prj/schema.graphql b/project-fixtures/react-apollo-prj/schema.graphql index ee8d8737b..8532e5b02 100644 --- a/project-fixtures/react-apollo-prj/schema.graphql +++ b/project-fixtures/react-apollo-prj/schema.graphql @@ -10180,7 +10180,7 @@ type IssueTimelineConnection { An item in an issue timeline """ union IssueTimelineItem = - AssignedEvent + | AssignedEvent | ClosedEvent | Commit | CrossReferencedEvent @@ -10219,7 +10219,7 @@ type IssueTimelineItemEdge { An item in an issue timeline """ union IssueTimelineItems = - AddedToProjectEvent + | AddedToProjectEvent | AssignedEvent | ClosedEvent | CommentDeletedEvent @@ -15572,7 +15572,7 @@ type OrgRestoreMemberAuditEntry implements AuditEntry & Node & OrganizationAudit Types of memberships that can be restored for an Organization member. """ union OrgRestoreMemberAuditEntryMembership = - OrgRestoreMemberMembershipOrganizationAuditEntryData + | OrgRestoreMemberMembershipOrganizationAuditEntryData | OrgRestoreMemberMembershipRepositoryAuditEntryData | OrgRestoreMemberMembershipTeamAuditEntryData @@ -16987,7 +16987,7 @@ type Organization implements Actor & MemberStatusable & Node & ProfileOwner & Pr An audit entry in an organization audit log. """ union OrganizationAuditEntry = - MembersCanDeleteReposClearAuditEntry + | MembersCanDeleteReposClearAuditEntry | MembersCanDeleteReposDisableAuditEntry | MembersCanDeleteReposEnableAuditEntry | OauthApplicationCreateAuditEntry @@ -20762,7 +20762,7 @@ type PullRequestTimelineConnection { An item in an pull request timeline """ union PullRequestTimelineItem = - AssignedEvent + | AssignedEvent | BaseRefForcePushedEvent | ClosedEvent | Commit @@ -20814,7 +20814,7 @@ type PullRequestTimelineItemEdge { An item in a pull request timeline """ union PullRequestTimelineItems = - AddedToProjectEvent + | AddedToProjectEvent | AssignedEvent | BaseRefChangedEvent | BaseRefForcePushedEvent diff --git a/project-fixtures/react-apollo-prj/src/index.tsx b/project-fixtures/react-apollo-prj/src/index.tsx index 9a2879b08..4a0fc2ae4 100644 --- a/project-fixtures/react-apollo-prj/src/index.tsx +++ b/project-fixtures/react-apollo-prj/src/index.tsx @@ -24,7 +24,7 @@ const query = gql` const mutation = gql` mutation UpdateMyRepository($repositoryId: ID!) { - updateRepository(input: { repositoryId: $repositoryId } ) { + updateRepository(input: { repositoryId: $repositoryId }) { clientMutationId } } diff --git a/project-fixtures/simple-prj/addon.js b/project-fixtures/simple-prj/addon.js index 12aecf0be..0b678a161 100644 --- a/project-fixtures/simple-prj/addon.js +++ b/project-fixtures/simple-prj/addon.js @@ -1,4 +1,4 @@ -module.exports = (ctx) => { +module.exports = ctx => { return { document: () => { ctx.source.writeLeadingComment('Hello, Addon!'); diff --git a/project-fixtures/simple-prj/graphql-tag.d.ts b/project-fixtures/simple-prj/graphql-tag.d.ts index 9725dde88..02ca46cde 100644 --- a/project-fixtures/simple-prj/graphql-tag.d.ts +++ b/project-fixtures/simple-prj/graphql-tag.d.ts @@ -1,4 +1,4 @@ -declare module "graphql-tag" { +declare module 'graphql-tag' { const gql: any; export default gql; } diff --git a/project-fixtures/transformation-prj/tag.ts b/project-fixtures/transformation-prj/tag.ts index 8406ab2b7..8317cd610 100644 --- a/project-fixtures/transformation-prj/tag.ts +++ b/project-fixtures/transformation-prj/tag.ts @@ -1,4 +1,4 @@ export default function gql(literals: TemplateStringsArray, ...args: unknown[]) { // dummy impl - return "" + return ''; } diff --git a/project-fixtures/transformation-prj/webpack.config.js b/project-fixtures/transformation-prj/webpack.config.js index 311e8ea3c..454bdefe5 100644 --- a/project-fixtures/transformation-prj/webpack.config.js +++ b/project-fixtures/transformation-prj/webpack.config.js @@ -9,11 +9,11 @@ module.exports = { extensions: ['.ts', '.js'], }, entry: { - main: path.resolve(__dirname, "query.ts"), + main: path.resolve(__dirname, 'query.ts'), }, output: { - path: path.resolve(__dirname, "dist"), - filename: "[name].js", + path: path.resolve(__dirname, 'dist'), + filename: '[name].js', }, module: { rules: [ @@ -24,16 +24,12 @@ module.exports = { options: { transpileOnly: true, getCustomTransformers: () => ({ - before: [ - tsgqlPlugin.getTransformer(), - ], + before: [tsgqlPlugin.getTransformer()], }), }, - } + }, ], }, - plugins: [ - tsgqlPlugin, - ], + plugins: [tsgqlPlugin], devtool: false, }; diff --git a/project-fixtures/typegen-addon-prj/graphql-tag.d.ts b/project-fixtures/typegen-addon-prj/graphql-tag.d.ts index 806b65c49..9055ef089 100644 --- a/project-fixtures/typegen-addon-prj/graphql-tag.d.ts +++ b/project-fixtures/typegen-addon-prj/graphql-tag.d.ts @@ -1,4 +1,4 @@ declare module 'graphql-tag' { - function gql (...args: any[]): any; + function gql(...args: any[]): any; export default gql; }