From 76ed63395c93ebbe2336634ba8eb1b3f6a2100a3 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Thu, 22 Feb 2024 19:32:36 -0700 Subject: [PATCH] Use prettier when checking for changes --- bin/assert-no-changes.sh | 1 + flake.lock | 4 +--- package.json | 9 ++++++++- yarn.lock | 10 ++++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/bin/assert-no-changes.sh b/bin/assert-no-changes.sh index e19f366..2d7c473 100755 --- a/bin/assert-no-changes.sh +++ b/bin/assert-no-changes.sh @@ -3,6 +3,7 @@ git ls-files | xargs md5sum > before.txt yarn install yarn graphql-codegen +prettier ./src --write git ls-files | xargs md5sum > after.txt diff --git a/flake.lock b/flake.lock index 988b051..1ac5273 100644 --- a/flake.lock +++ b/flake.lock @@ -20,9 +20,7 @@ }, "gitignore": { "inputs": { - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": ["nixpkgs"] }, "locked": { "lastModified": 1703887061, diff --git a/package.json b/package.json index 9313d7b..b05d0d2 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,14 @@ "@graphql-codegen/typescript": "^4.0.1", "@graphql-codegen/typescript-operations": "^4.0.1", "@graphql-codegen/typescript-react-apollo": "^4.2.0", - "graphql": "^16.8.1" + "graphql": "^16.8.1", + "prettier": "^3.2.5", + "prettier-plugin-organize-imports": "^3.2.4" + }, + "prettier": { + "plugins": [ + "prettier-plugin-organize-imports" + ] }, "devDependencies": { "typescript": "^4.x" diff --git a/yarn.lock b/yarn.lock index 2599f39..c27b204 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2548,6 +2548,16 @@ picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +prettier-plugin-organize-imports@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-3.2.4.tgz#77967f69d335e9c8e6e5d224074609309c62845e" + integrity sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog== + +prettier@^3.2.5: + version "3.2.5" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" + integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== + promise@^7.1.1: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"