From 88a9630c07f439863ab3824c54988bd5ba173350 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 17:23:08 -0700 Subject: [PATCH 01/15] yarn add --dev --exact --workspace @biomejs/biome --- package.json | 3 +- yarn.lock | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 84 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7daa76f1d3..89c34fb8d2 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "engines": { "node": ">=20" }, - "dependencies": { + "devDependencies": { "@babel/core": "^7.23.2", "@babel/eslint-parser": "^7.22.15", "@babel/eslint-plugin": "^7.22.10", @@ -22,6 +22,7 @@ "@babel/preset-env": "^7.23.2", "@babel/preset-react": "^7.22.12", "@babel/preset-typescript": "^7.23.2", + "@biomejs/biome": "1.9.4", "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "^2.22.0", "@cypress/code-coverage": "^3.12.24", diff --git a/yarn.lock b/yarn.lock index 49165c87f4..f8bface2d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1452,6 +1452,60 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@biomejs/biome@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-1.9.4.tgz#89766281cbc3a0aae865a7ff13d6aaffea2842bf" + integrity sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog== + optionalDependencies: + "@biomejs/cli-darwin-arm64" "1.9.4" + "@biomejs/cli-darwin-x64" "1.9.4" + "@biomejs/cli-linux-arm64" "1.9.4" + "@biomejs/cli-linux-arm64-musl" "1.9.4" + "@biomejs/cli-linux-x64" "1.9.4" + "@biomejs/cli-linux-x64-musl" "1.9.4" + "@biomejs/cli-win32-arm64" "1.9.4" + "@biomejs/cli-win32-x64" "1.9.4" + +"@biomejs/cli-darwin-arm64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz#dfa376d23a54a2d8f17133c92f23c1bf2e62509f" + integrity sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw== + +"@biomejs/cli-darwin-x64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz#eafc2ce3849d385fc02238aad1ca4a73395a64d9" + integrity sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg== + +"@biomejs/cli-linux-arm64-musl@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz#d780c3e01758fc90f3268357e3f19163d1f84fca" + integrity sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA== + +"@biomejs/cli-linux-arm64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz#8ed1dd0e89419a4b66a47f95aefb8c46ae6041c9" + integrity sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g== + +"@biomejs/cli-linux-x64-musl@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz#f36982b966bd671a36671e1de4417963d7db15fb" + integrity sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg== + +"@biomejs/cli-linux-x64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz#a0a7f56680c76b8034ddc149dbf398bdd3a462e8" + integrity sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg== + +"@biomejs/cli-win32-arm64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz#e2ef4e0084e76b7e26f0fc887c5ef1265ea56200" + integrity sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg== + +"@biomejs/cli-win32-x64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz#4c7afa90e3970213599b4095e62f87e5972b2340" + integrity sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA== + "@changesets/apply-release-plan@^6.0.0": version "6.0.0" resolved "https://registry.yarnpkg.com/@changesets/apply-release-plan/-/apply-release-plan-6.0.0.tgz#6c663ff99d919bba3902343d76c35cbbbb046520" @@ -15158,7 +15212,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -15176,6 +15230,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -15260,7 +15323,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15274,6 +15337,13 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -16502,7 +16572,7 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -16520,6 +16590,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 23fcacfbd81b8ab4ead01d23d13d3406b61d0bbd Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 17:23:57 -0700 Subject: [PATCH 02/15] yarn biome init --jsonc --- biome.jsonc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 biome.jsonc diff --git a/biome.jsonc b/biome.jsonc new file mode 100644 index 0000000000..2eb07517c0 --- /dev/null +++ b/biome.jsonc @@ -0,0 +1,30 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "vcs": { + "enabled": false, + "clientKind": "git", + "useIgnoreFile": false + }, + "files": { + "ignoreUnknown": false, + "ignore": [] + }, + "formatter": { + "enabled": true, + "indentStyle": "tab" + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + } +} From a86b69bd95a73d842d83838c2621cc6c4af3b2a6 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 17:48:57 -0700 Subject: [PATCH 03/15] Fix error in .editorconfig --- .editorconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.editorconfig b/.editorconfig index 961f8c5d4b..184babab9a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,9 @@ # https://editorconfig.org/#file-format-details +# top-most EditorConfig file root = true +[*] indent_style = space indent_size = 4 From 802af1ce6dbceea03595667e7ad995bf82dacc11 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 17:49:57 -0700 Subject: [PATCH 04/15] Initial working biome.jsonc --- biome.jsonc | 52 ++++++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/biome.jsonc b/biome.jsonc index 2eb07517c0..807e3eedd1 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -1,30 +1,26 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", - "vcs": { - "enabled": false, - "clientKind": "git", - "useIgnoreFile": false - }, - "files": { - "ignoreUnknown": false, - "ignore": [] - }, - "formatter": { - "enabled": true, - "indentStyle": "tab" - }, - "organizeImports": { - "enabled": true - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true - } - }, - "javascript": { - "formatter": { - "quoteStyle": "double" - } - } + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "files": { + "ignoreUnknown": false, + "ignore": [] + }, + "formatter": { + "useEditorconfig": true, + "enabled": true + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double", + "trailingCommas": "all" + } + } } From e43fb7cc5600b4d7f13188154077c02c4933ec63 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 17:50:27 -0700 Subject: [PATCH 05/15] Update repo vscode settings for Biome --- .vscode/settings.json | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8e0bf5ca48..389908027d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,14 +1,15 @@ { "editor.renderWhitespace": "boundary", + + "editor.defaultFormatter": "biomejs.biome", + "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.fixAll": "explicit" + "quickfix.biome": "explicit" }, - "eslint.codeActionsOnSave.mode": "all", "files.trimTrailingWhitespace": true, - "todo-tree.filtering.excludeGlobs": [ - "**/dist/**", - ], - "typescript.format.enable": false, + + "todo-tree.filtering.excludeGlobs": ["**/dist/**"], + "typescript.validate.enable": true, "typescript.tsdk": "node_modules/typescript/lib", "typescript.tsserver.experimental.enableProjectDiagnostics": true, @@ -26,5 +27,5 @@ "typescript.inlayHints.parameterNames.enabled": "all", "typescript.inlayHints.parameterTypes.enabled": true, "typescript.inlayHints.propertyDeclarationTypes.enabled": true, - "typescript.inlayHints.variableTypes.enabled": true, -} \ No newline at end of file + "typescript.inlayHints.variableTypes.enabled": true +} From e66d1cb1ce01e771b361113b59be1facd242fa4c Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 17:52:28 -0700 Subject: [PATCH 06/15] Change bracketSpacing to match prettier config --- biome.jsonc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/biome.jsonc b/biome.jsonc index 807e3eedd1..8e3541a4b0 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -20,7 +20,9 @@ "javascript": { "formatter": { "quoteStyle": "double", - "trailingCommas": "all" + "trailingCommas": "all", + + "bracketSpacing": false } } } From e7e4b924e9a91f586c01cda8fbefb3232d2b62db Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 18:03:10 -0700 Subject: [PATCH 07/15] Turn off organizeImports to start --- biome.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biome.jsonc b/biome.jsonc index 8e3541a4b0..a0d5cfb337 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -9,7 +9,7 @@ "enabled": true }, "organizeImports": { - "enabled": true + "enabled": false }, "linter": { "enabled": true, From 232dcbfff3825e0469f15f526e6c8cf05e732fb0 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 18:10:04 -0700 Subject: [PATCH 08/15] Disable linter to start --- biome.jsonc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/biome.jsonc b/biome.jsonc index a0d5cfb337..62f751bad0 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -5,14 +5,14 @@ "ignore": [] }, "formatter": { - "useEditorconfig": true, - "enabled": true + "enabled": true, + "useEditorconfig": true }, "organizeImports": { "enabled": false }, "linter": { - "enabled": true, + "enabled": false, "rules": { "recommended": true } From dc00715e50aad1bb39686c39619e31dc7e82c0f6 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 18:04:26 -0700 Subject: [PATCH 09/15] Ignore data/questions data files --- biome.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biome.jsonc b/biome.jsonc index 62f751bad0..a7cc4ed06d 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -2,7 +2,7 @@ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "files": { "ignoreUnknown": false, - "ignore": [] + "ignore": ["data/questions/"] }, "formatter": { "enabled": true, From 7ad0e2c73456f8f06749fc4d5f15806d9a81820d Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 18:07:34 -0700 Subject: [PATCH 10/15] Ignore genfiles --- biome.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biome.jsonc b/biome.jsonc index a7cc4ed06d..3c1f51c374 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -2,7 +2,7 @@ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "files": { "ignoreUnknown": false, - "ignore": ["data/questions/"] + "ignore": ["data/questions/", "__genfiles__/"] }, "formatter": { "enabled": true, From e12d529981769a59572ccf239c0883f7685dee9c Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 18:25:12 -0700 Subject: [PATCH 11/15] Ignore source files in vendor/ --- biome.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biome.jsonc b/biome.jsonc index 3c1f51c374..c234bc60da 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -2,7 +2,7 @@ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "files": { "ignoreUnknown": false, - "ignore": ["data/questions/", "__genfiles__/"] + "ignore": ["data/questions/", "__genfiles__/", "vendor/**/*.js"] }, "formatter": { "enabled": true, From 7dec92939276f8a73845981027174c9fe5b43d18 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 18:55:18 -0700 Subject: [PATCH 12/15] Ignore storybook-static, khan-exercise.css, and enable git integration --- biome.jsonc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/biome.jsonc b/biome.jsonc index c234bc60da..7d22155341 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -2,7 +2,17 @@ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "files": { "ignoreUnknown": false, - "ignore": ["data/questions/", "__genfiles__/", "vendor/**/*.js"] + "ignore": [ + "data/questions/", + "__genfiles__/", + "vendor/**/*.js", + "storybook-static/", + "styles/khan-exercise.css" + ] + }, + "vcs": { + "clientKind": "git", + "useIgnoreFile": true }, "formatter": { "enabled": true, From 94e96b6bf25e39bc961d2b85e82fadc0576d1e64 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Thu, 24 Oct 2024 09:16:07 -0700 Subject: [PATCH 13/15] Ignore dist/ directory --- biome.jsonc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/biome.jsonc b/biome.jsonc index 7d22155341..9f21799f32 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -5,7 +5,8 @@ "ignore": [ "data/questions/", "__genfiles__/", - "vendor/**/*.js", + "dist/", + "vendor/", "storybook-static/", "styles/khan-exercise.css" ] From f48d54df10328295893b1f24ecfe8dcc72134041 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 18:14:45 -0700 Subject: [PATCH 14/15] Configure Biome to handle JSONC tsconfig.json files --- biome.jsonc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/biome.jsonc b/biome.jsonc index 9f21799f32..f05c1abb1e 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -35,5 +35,24 @@ "bracketSpacing": false } - } + }, + "overrides": [ + { + "include": [ + "tsconfig-build.json", + "tsconfig-common.json", + "tsconfig-shared.json", + "tsconfig.json" + ], + "json": { + "formatter": { + "trailingCommas": "all" + }, + "parser": { + "allowTrailingCommas": true, + "allowComments": true + } + } + } + ] } From 363a63c1fe4cde50ca3eefc829d49618e8167e88 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Wed, 23 Oct 2024 18:20:35 -0700 Subject: [PATCH 15/15] Migrate from // prettier-ignore to // biome-ignore --- config/test/log-on-fail-reporter.js | 2 +- packages/perseus-linter/src/rule.ts | 2 +- packages/perseus/src/perseus-types.ts | 71 ++++++++++--------- packages/perseus/src/widgets/grapher/util.tsx | 2 +- 4 files changed, 40 insertions(+), 37 deletions(-) diff --git a/config/test/log-on-fail-reporter.js b/config/test/log-on-fail-reporter.js index e7561e6b05..6e5d6159b8 100644 --- a/config/test/log-on-fail-reporter.js +++ b/config/test/log-on-fail-reporter.js @@ -22,7 +22,7 @@ class LogOnFailedTestReporter extends DefaultReporter { const testFailed = result.numFailingTests > 0; if (testFailed && consoleBuffer && consoleBuffer.length) { - // prettier-ignore + // biome-ignore format: keep these on the same line this.log( ` ${TITLE_BULLET}Console\n\n${getConsoleOutput( consoleBuffer, diff --git a/packages/perseus-linter/src/rule.ts b/packages/perseus-linter/src/rule.ts index 772745725d..d1efa910bb 100644 --- a/packages/perseus-linter/src/rule.ts +++ b/packages/perseus-linter/src/rule.ts @@ -164,7 +164,7 @@ type RuleCheckReturnType = // This is the return type of the lint detection function passed as the 4th // argument to the Rule() constructor. It can return null or a string or an // object containing a string and two numbers. -// prettier-ignore +// biome-ignore format: keep these on the same line // (prettier formats this in a way that ka-lint does not like) type LintTesterReturnType = string | { message: string, diff --git a/packages/perseus/src/perseus-types.ts b/packages/perseus/src/perseus-types.ts index 3b50bc88ad..dcae4cb78e 100644 --- a/packages/perseus/src/perseus-types.ts +++ b/packages/perseus/src/perseus-types.ts @@ -194,74 +194,77 @@ type WidgetOptions = { version?: Version; }; -// prettier-ignore +// biome-ignore format: keep these on the same line export type CategorizerWidget = WidgetOptions<'categorizer', PerseusCategorizerWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type CSProgramWidget = WidgetOptions<'cs-program', PerseusCSProgramWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type DefinitionWidget = WidgetOptions<'definition', PerseusDefinitionWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type DropdownWidget = WidgetOptions<'dropdown', PerseusDropdownWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type ExplanationWidget = WidgetOptions<'explanation', PerseusExplanationWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type ExpressionWidget = WidgetOptions<'expression', PerseusExpressionWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type GradedGroupSetWidget = WidgetOptions<'graded-group-set', PerseusGradedGroupSetWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type GradedGroupWidget = WidgetOptions<'graded-group', PerseusGradedGroupWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type GrapherWidget = WidgetOptions<'grapher', PerseusGrapherWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type GroupWidget = WidgetOptions<'group', PerseusGroupWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type IFrameWidget = WidgetOptions<'iframe', PerseusIFrameWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type ImageWidget = WidgetOptions<'image', PerseusImageWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type InteractionWidget = WidgetOptions<'interaction', PerseusInteractionWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type InteractiveGraphWidget = WidgetOptions<'interactive-graph', PerseusInteractiveGraphWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type LabelImageWidget = WidgetOptions<'label-image', PerseusLabelImageWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type MatcherWidget = WidgetOptions<'matcher', PerseusMatcherWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type MatrixWidget = WidgetOptions<'matrix', PerseusMatrixWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type MeasurerWidget = WidgetOptions<'measurer', PerseusMeasurerWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type NumberLineWidget = WidgetOptions<'number-line', PerseusNumberLineWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type NumericInputWidget = WidgetOptions<'numeric-input', PerseusNumericInputWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type OrdererWidget = WidgetOptions<'orderer', PerseusOrdererWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type PassageRefWidget = WidgetOptions<'passage-ref', PerseusPassageRefWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type PassageWidget = WidgetOptions<'passage', PerseusPassageWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type PhetSimulationWidget = WidgetOptions<'phet-simulation', PerseusPhetSimulationWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type PlotterWidget = WidgetOptions<'plotter', PerseusPlotterWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type PythonProgramWidget = WidgetOptions<'python-program', PerseusPythonProgramWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type RadioWidget = WidgetOptions<'radio', PerseusRadioWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type SorterWidget = WidgetOptions<'sorter', PerseusSorterWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type TableWidget = WidgetOptions<'table', PerseusTableWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type InputNumberWidget = WidgetOptions<'input-number', PerseusInputNumberWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type MoleculeRendererWidget = WidgetOptions<'molecule-renderer', PerseusMoleculeRendererWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type RefTargetWidget = WidgetOptions<'passage-ref-target', PerseusPassageRefTargetWidgetOptions>; -// prettier-ignore +// biome-ignore format: keep these on the same line export type VideoWidget = WidgetOptions<'video', PerseusVideoWidgetOptions>; //prettier-ignore -export type AutoCorrectWidget = WidgetOptions<'deprecated-standin', PerseusWidgetOptions>; +export type AutoCorrectWidget = WidgetOptions< + "deprecated-standin", + PerseusWidgetOptions +>; export type PerseusWidget = | CategorizerWidget diff --git a/packages/perseus/src/widgets/grapher/util.tsx b/packages/perseus/src/widgets/grapher/util.tsx index c077e438bd..ba9f96394a 100644 --- a/packages/perseus/src/widgets/grapher/util.tsx +++ b/packages/perseus/src/widgets/grapher/util.tsx @@ -635,7 +635,7 @@ export const allTypes: any = _.keys(functionTypeMapping); type FunctionTypeMappingKeys = keyof typeof functionTypeMapping; type ConditionalGraderType = - // prettier-ignore + // biome-ignore format: keep these on the same line T extends "linear" ? LinearType : T extends "quadratic" ? QuadraticType : T extends "sinusoid" ? SinusoidType