From c661abe46ba390c7e19326578e1cc60583560c78 Mon Sep 17 00:00:00 2001 From: Kishan Gajera Date: Tue, 29 Mar 2022 23:45:04 -0400 Subject: [PATCH 1/3] chore: introduce lint:fix command so CI does not fix lint errors --- packages/create-bison-app/template/package.json.ejs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/create-bison-app/template/package.json.ejs b/packages/create-bison-app/template/package.json.ejs index 202d7b8d..d7d1349c 100644 --- a/packages/create-bison-app/template/package.json.ejs +++ b/packages/create-bison-app/template/package.json.ejs @@ -32,7 +32,8 @@ "g:test:factory": "hygen test factory --name", "g:test:request": "hygen test request --name", "g:test:util": "hygen test util --name", - "lint": "yarn eslint . --ext .ts,.tsx --fix --ignore-pattern tmp", + "lint": "yarn eslint . --ext .ts,.tsx --ignore-pattern tmp", + "lint:fix": "yarn eslint . --ext .ts,.tsx --fix --ignore-pattern tmp", "run:script": "yarn ts-node prisma/scripts/run.ts -f", "setup:dev": "yarn db:deploy && yarn build:types && yarn db:seed", "start": "next start -p $PORT", From 60ef6808b23b44cfaa1146876e86c8cd985c2c33 Mon Sep 17 00:00:00 2001 From: Kishan Gajera Date: Tue, 29 Mar 2022 23:53:33 -0400 Subject: [PATCH 2/3] chore: upgrade @graphql-codegen --- packages/create-bison-app/template/package.json.ejs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/create-bison-app/template/package.json.ejs b/packages/create-bison-app/template/package.json.ejs index d7d1349c..55805ffb 100644 --- a/packages/create-bison-app/template/package.json.ejs +++ b/packages/create-bison-app/template/package.json.ejs @@ -76,11 +76,11 @@ }, "devDependencies": { "@apollo/react-testing": "^4.0.0", - "@graphql-codegen/cli": "^1.21.5", - "@graphql-codegen/typescript": "^1.22.1", - "@graphql-codegen/typescript-operations": "^1.18.0", - "@graphql-codegen/typescript-react-apollo": "^2.2.5", - "@graphql-codegen/typescript-resolvers": "^1.19.2", + "@graphql-codegen/cli": "^2.6.2", + "@graphql-codegen/typescript": "^2.4.8", + "@graphql-codegen/typescript-operations": "^2.3.5", + "@graphql-codegen/typescript-react-apollo": "^3.2.11", + "@graphql-codegen/typescript-resolvers": "^2.6.1", "@testing-library/cypress": "^8.0.0", "@testing-library/dom": "^8.1.0", "@testing-library/jest-dom": "^5.14.1", From 8a0495ef38bf177a6409ce2344fb200dd4b01f91 Mon Sep 17 00:00:00 2001 From: Kishan Gajera Date: Tue, 29 Mar 2022 23:54:30 -0400 Subject: [PATCH 3/3] chore: update lint:fix script to call the lint script and pass the fix flag --- packages/create-bison-app/template/codegen.yml | 5 ++--- packages/create-bison-app/template/package.json.ejs | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/create-bison-app/template/codegen.yml b/packages/create-bison-app/template/codegen.yml index 172ba9c3..7b1811b9 100644 --- a/packages/create-bison-app/template/codegen.yml +++ b/packages/create-bison-app/template/codegen.yml @@ -1,9 +1,6 @@ schema: - api.graphql overwrite: true -hooks: - afterOneFileWrite: - - yarn lint generates: types.ts: documents: @@ -14,6 +11,8 @@ generates: - 'context/**/*.{ts,tsx}' - '!pages/api*' plugins: + - add: + content: '/* eslint-disable */' - typescript - typescript-operations - typescript-react-apollo diff --git a/packages/create-bison-app/template/package.json.ejs b/packages/create-bison-app/template/package.json.ejs index 55805ffb..bea69288 100644 --- a/packages/create-bison-app/template/package.json.ejs +++ b/packages/create-bison-app/template/package.json.ejs @@ -33,7 +33,7 @@ "g:test:request": "hygen test request --name", "g:test:util": "hygen test util --name", "lint": "yarn eslint . --ext .ts,.tsx --ignore-pattern tmp", - "lint:fix": "yarn eslint . --ext .ts,.tsx --fix --ignore-pattern tmp", + "lint:fix": "yarn lint --fix", "run:script": "yarn ts-node prisma/scripts/run.ts -f", "setup:dev": "yarn db:deploy && yarn build:types && yarn db:seed", "start": "next start -p $PORT", @@ -76,6 +76,7 @@ }, "devDependencies": { "@apollo/react-testing": "^4.0.0", + "@graphql-codegen/add": "^3.1.1", "@graphql-codegen/cli": "^2.6.2", "@graphql-codegen/typescript": "^2.4.8", "@graphql-codegen/typescript-operations": "^2.3.5",