chore: replace prettier with oxfmt (#5435)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Yusuke Wada · committed by GitHub · parent a79a804 · Browse files · 7 files·+258 added−32 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
7 files+258 added−32 removed
- other:+258 added−32 removed
Provenance
- Commit
8dcd52b- Tree
fd3ac0d- Author
Yusuke Wada <yusuke@kamawada.com>- Committer
GitHub <noreply@github.com>- Parent
a79a804
7 files changed+258 added−32 removed
modified:src/router/reg-exp-router/trie.ts+1 added-1 removed
20 unmodified lines2122232425252627282955 unmodified lines20 unmodified lines const paramAssoc: ParamAssocArray = []
const groups: [string, string][] = [] // [mark, original string] let markedPath = path for (let i = 0; ; ) { for (let i = 0; ;) { let replaced = false markedPath = markedPath.replace(/\{[^}]+\}/g, (m) => { const mark = `@\\${i}` groups[i] = [mark, m]55 unmodified linesmodified:src/utils/types.ts+3 added-3 removed
72 unmodified lines73 : T extends object74 ? T[keyof T] extends TError75 ? never76 : {77- [K in keyof OmitSymbolKeys<T> as IsInvalid<T[K]> extends true78- ? never79- : K]: boolean extends IsInvalid<T[K]>77+ [78+ K in keyof OmitSymbolKeys<T> as IsInvalid<T[K]> extends true ? never : K79+ ]: boolean extends IsInvalid<T[K]>80 ? JSONParsed<T[K], TError> | undefined81 : JSONParsed<T[K], TError>82 }83 : T extends unknown37 unmodified linesmodified:src/types.ts+10 added-6 removed
2575 unmodified lines2576 : FlattenIfIntersect<2577 T['input'] & {2578 param: {2579 // Maps extracted keys, stripping braces, to a string-typed record.2580+ [2580- [K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}`2581- ? Prefix2582- : K]: string2581+ K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}`2582+ ? Prefix2583+ : K2584+ ]: string2585 }2586 }2587 >2588 : RemoveBlankRecord<ExtractParams<SubPath>> extends never2589 ? T['input']2590 : T['input'] & {2591 // Maps extracted keys, stripping braces, to a string-typed record.2592 param: {2593+ [2591- [K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}`2592- ? Prefix2593- : K]: string2594+ K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}`2595+ ? Prefix2596+ : K2597+ ]: string2598 }2599 }2600 output: T['output']2601 outputFormat: T['outputFormat']181 unmodified linesadded:.oxfmtrc.json+16 added
12345678910111213141516{ "printWidth": 100, "trailingComma": "es5", "tabWidth": 2, "semi": false, "singleQuote": true, "jsxSingleQuote": true, "endOfLine": "lf", "sortPackageJson": false, "ignorePatterns": [ "dist/", "coverage/", ".wrangler/", "pnpm-lock.yaml" ]}deleted:.prettierrc-9 removed
1-{2- "printWidth": 100,3- "trailingComma": "es5",4- "tabWidth": 2,5- "semi": false,6- "singleQuote": true,7- "jsxSingleQuote": true,8- "endOfLine": "lf"9-}modified:package.json+3 added-3 removed
21 unmodified lines22 "test:lambda-edge": "vitest --run --project lambda-edge",23 "test:all": "pnpm run test && pnpm run test:deno && pnpm run test:bun",24 "lint": "eslint src runtime-tests build perf-measures benchmarks",25 "lint:fix": "eslint src runtime-tests build perf-measures benchmarks --fix",26- "format": "prettier --check --cache \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\" \"benchmarks/**/*.{js,ts,tsx}\"",27- "format:fix": "prettier --write --cache --cache-strategy metadata \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\" \"benchmarks/**/*.{js,ts,tsx}\"",26+ "format": "oxfmt --check \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\" \"benchmarks/**/*.{js,ts,tsx}\"",27+ "format:fix": "oxfmt \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\" \"benchmarks/**/*.{js,ts,tsx}\"",28 "editorconfig-checker": "editorconfig-checker",29 "copy:package.cjs.json": "cp ./package.cjs.json ./dist/cjs/package.json && cp ./package.cjs.json ./dist/types/package.json",30 "build": "pnpm run remove-dist && bun ./build/build.ts && pnpm run copy:package.cjs.json",31 "postbuild": "publint",656 unmodified lines688 "jsdom": "22.1.0",689 "msw": "^2.6.0",690 "np": "11.2.1",691 "oxc-parser": "^0.96.0",692+ "oxfmt": "^0.70.0",693 "pkg-pr-new": "^0.0.53",693- "prettier": "3.7.4",694 "publint": "0.3.15",695 "typescript": "^6.0.3",696 "vite-plugin-fastly-js-compute": "^0.4.2",697 "vitest": "^4.1.9",9 unmodified linesmodified:pnpm-lock.yaml+225 added-10 removed
209 unmodified lines210 version: 11.2.1(@types/node@24.13.6)(typescript@6.0.3)211 oxc-parser:212 specifier: ^0.96.0213 version: 0.96.0(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)214+ oxfmt:215+ specifier: ^0.70.0216+ version: 0.70.0217 pkg-pr-new:218 specifier: ^0.0.53219 version: 0.0.53217- prettier:218- specifier: 3.7.4219- version: 3.7.4220 publint:221 specifier: 0.3.15222 version: 0.3.15223 typescript:1884 unmodified lines2108 2109 '@oxc-project/types@0.96.0':2110 resolution: {integrity: sha512-r/xkmoXA0xEpU6UGtn18CNVjXH6erU3KCpCDbpLmbVxBFor1U9MqN5Z2uMmCHJuXjJzlnDR+hWY+yPoLo8oHDw==}2111 2112+ '@oxfmt/binding-android-arm-eabi@0.70.0':2113+ resolution: {integrity: sha512-Xd7YO4/T2axEj6FTLcj4Why3mTBqFMg+x24xtorT4Lb2+1g82090GH0a/4U1m0pABGYiix2bq1pqkYrmV3f0Sw==}2114+ engines: {node: ^20.19.0 || >=22.12.0}2115+ cpu: [arm]2116+ os: [android]2117+2118+ '@oxfmt/binding-android-arm64@0.70.0':2119+ resolution: {integrity: sha512-x9rlMYyKXdgKdYyUJzGsK1ZV8P4di/J32ipzcS6Jet6p9r9UAh28neXIMtdlSaJJycdi61Z4YkcLKLpk8ueFjg==}2120+ engines: {node: ^20.19.0 || >=22.12.0}2121+ cpu: [arm64]2122+ os: [android]2123+2124+ '@oxfmt/binding-darwin-arm64@0.70.0':2125+ resolution: {integrity: sha512-IUTUPvrBVYy7POh4stXzRdz4IVC/1QSaviCWoyenSlOhGu0X9j5K07vCTM9biLjAA2Zs31l0Rj5vvRpj9n95wA==}2126+ engines: {node: ^20.19.0 || >=22.12.0}2127+ cpu: [arm64]2128+ os: [darwin]2129+2130+ '@oxfmt/binding-darwin-x64@0.70.0':2131+ resolution: {integrity: sha512-vw745q870oTd6J517O24asoX4/E+eK0nxYIFoedSLqgJ+nI5En7+ZS82iZSHZ69zevQrnOXiyHP01dA+t8xD8w==}2132+ engines: {node: ^20.19.0 || >=22.12.0}2133+ cpu: [x64]2134+ os: [darwin]2135+2136+ '@oxfmt/binding-freebsd-x64@0.70.0':2137+ resolution: {integrity: sha512-NO14EgSM9dFkcg+MfGPxvsKqXYs9LKaxPrOKXpv1R0rLokGGFDcCq6dBMq18dE4wlpFOovX0UZY2uh1P30O7QA==}2138+ engines: {node: ^20.19.0 || >=22.12.0}2139+ cpu: [x64]2140+ os: [freebsd]2141+2142+ '@oxfmt/binding-linux-arm-gnueabihf@0.70.0':2143+ resolution: {integrity: sha512-139OEhHarj9CYoJ/i9gXlPv4KLBGtLj2toseOWYFf09QwlhklaZk+wW3aOvlqoeZtuayvkoSNVWra7WJ21s3VQ==}2144+ engines: {node: ^20.19.0 || >=22.12.0}2145+ cpu: [arm]2146+ os: [linux]2147+2148+ '@oxfmt/binding-linux-arm-musleabihf@0.70.0':2149+ resolution: {integrity: sha512-GEh2PY3IWTE0M24eNhTduountANSbWyDmMnzFSQE/nGg/bjPugbUgiGuFu+xdqcQSd/HKSwH80/F2yVVD48yhA==}2150+ engines: {node: ^20.19.0 || >=22.12.0}2151+ cpu: [arm]2152+ os: [linux]2153+2154+ '@oxfmt/binding-linux-arm64-gnu@0.70.0':2155+ resolution: {integrity: sha512-En5i+UJmZSPxuSf47F2Hl5YOzKB0bicQLnGQkeTCMQ35cWLtbrSwACJKfiLqRZrk05DwSnsJkhBRaM3OURtIaA==}2156+ engines: {node: ^20.19.0 || >=22.12.0}2157+ cpu: [arm64]2158+ os: [linux]2159+ libc: [glibc]2160+2161+ '@oxfmt/binding-linux-arm64-musl@0.70.0':2162+ resolution: {integrity: sha512-WWOoV5W9Im3flVwOVrWn/2DUlOF8v5vcCip+kcNuaMpulRCh6nzzt1Su2vcL2F908YJIXNV3HvegbBHuyLwKHg==}2163+ engines: {node: ^20.19.0 || >=22.12.0}2164+ cpu: [arm64]2165+ os: [linux]2166+ libc: [musl]2167+2168+ '@oxfmt/binding-linux-ppc64-gnu@0.70.0':2169+ resolution: {integrity: sha512-YUouneIqW+5n7aE8xx/zeZ6/utr/KH7oykcGoFyd8Uz8uh591T1oKlnoWA3BsRq/ZR42oY1w4MUYvS/0e/MQOA==}2170+ engines: {node: ^20.19.0 || >=22.12.0}2171+ cpu: [ppc64]2172+ os: [linux]2173+ libc: [glibc]2174+2175+ '@oxfmt/binding-linux-riscv64-gnu@0.70.0':2176+ resolution: {integrity: sha512-iEnMf21S5aGVa4hViDGY8sAQ/AHyCu2JPyrQF8P06wtHhSkD1YJBeT4m/KiGewgf7+a5XCYSCRIPcRQa1xwEoQ==}2177+ engines: {node: ^20.19.0 || >=22.12.0}2178+ cpu: [riscv64]2179+ os: [linux]2180+ libc: [glibc]2181+2182+ '@oxfmt/binding-linux-riscv64-musl@0.70.0':2183+ resolution: {integrity: sha512-91Sdniaj20fQzyMeCxMDzTP4c9s4RB8dGQ308xHhDR0n6U7+1Xq7N9klE7mfXq8iV3lRmIGSXi5X23Hn/0XX/g==}2184+ engines: {node: ^20.19.0 || >=22.12.0}2185+ cpu: [riscv64]2186+ os: [linux]2187+ libc: [musl]2188+2189+ '@oxfmt/binding-linux-s390x-gnu@0.70.0':2190+ resolution: {integrity: sha512-uUV30M6E+2TKKGMaKiwfeL4RZrviHXlUxsrYJ/jFBb+1EZy+pnFT+hF73eeWdzh5NqPOAnw0iiMAIqjqiLZPFg==}2191+ engines: {node: ^20.19.0 || >=22.12.0}2192+ cpu: [s390x]2193+ os: [linux]2194+ libc: [glibc]2195+2196+ '@oxfmt/binding-linux-x64-gnu@0.70.0':2197+ resolution: {integrity: sha512-ivMcX6kNDPhqtbOaBt/ItFlLlTlXNHLgRuNmxP6Na6UuYXRT10llpJcAPbGeRgjjb3Qzv4jwPp3fB0hui50WNQ==}2198+ engines: {node: ^20.19.0 || >=22.12.0}2199+ cpu: [x64]2200+ os: [linux]2201+ libc: [glibc]2202+2203+ '@oxfmt/binding-linux-x64-musl@0.70.0':2204+ resolution: {integrity: sha512-w+S+fERxYmlZSyZlJK/U292FjyBoH8cCEj21/tYJX6atX5kNSn+HDkhlFQKT2zcMwUW0uAtUL/bOrlwJZwqRdA==}2205+ engines: {node: ^20.19.0 || >=22.12.0}2206+ cpu: [x64]2207+ os: [linux]2208+ libc: [musl]2209+2210+ '@oxfmt/binding-openharmony-arm64@0.70.0':2211+ resolution: {integrity: sha512-Zlom1Xkx257R8bk4ZI4zJsrGno2opknz1+5v5baka3nn4FPyvNSdh8JUL4CdN1S1OWRMvJ9UJQ+RfIqGGCUEfA==}2212+ engines: {node: ^20.19.0 || >=22.12.0}2213+ cpu: [arm64]2214+ os: [openharmony]2215+2216+ '@oxfmt/binding-win32-arm64-msvc@0.70.0':2217+ resolution: {integrity: sha512-FQgPW5R17vzt7cgrJ8eG/dqX00o2xHsqFeLfw4xzA9FRHpN/DjFo9YDonvIIXGxiEuS9F/jZPnGO+KHNKuCo4Q==}2218+ engines: {node: ^20.19.0 || >=22.12.0}2219+ cpu: [arm64]2220+ os: [win32]2221+2222+ '@oxfmt/binding-win32-ia32-msvc@0.70.0':2223+ resolution: {integrity: sha512-ZfZublNhZ+XBndMiXhkiLlPE+XyGRDa0CweeTL6t1fZypfCh1LTg7e5CvnOeTBunq15MskOcRempumSPGAaCQA==}2224+ engines: {node: ^20.19.0 || >=22.12.0}2225+ cpu: [ia32]2226+ os: [win32]2227+2228+ '@oxfmt/binding-win32-x64-msvc@0.70.0':2229+ resolution: {integrity: sha512-HlIZEn+WzLQL0DszNzldiRl/DPRCX5R0Vkt6qeUPR1YHwy52hZZo4x6HoTOVmKRP2wUiwPGtKsihNY/f8KRaBg==}2230+ engines: {node: ^20.19.0 || >=22.12.0}2231+ cpu: [x64]2232+ os: [win32]2233+2234 '@pnpm/config.env-replace@1.1.0':2235 resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==}2236 engines: {node: '>=12.22.0'}2237 2299 unmodified lines4537 oxc-parser@0.96.0:4538 resolution: {integrity: sha512-ucs6niJ5mZlYP3oTl4AK2eD2m7WLoSaljswnSFVYWrXzme5PtM97S7Ve1Tjx+/TKjanmEZuSt1f1qYi6SZvntw==}4539 engines: {node: ^20.19.0 || >=22.12.0}4540 4541+ oxfmt@0.70.0:4542+ resolution: {integrity: sha512-IsHxZ4y0wQLLMhnrJblBJgZsLDzfULrJnAw5j/QqsTlMa/m3AqsbToi+W71uhBGaqlqq/PbbjvHc09TJwdv3Tw==}4543+ engines: {node: ^20.19.0 || >=22.12.0}4544+ hasBin: true4545+ peerDependencies:4546+ svelte: ^5.0.04547+ vite-plus: '*'4548+ peerDependenciesMeta:4549+ svelte:4550+ optional: true4551+ vite-plus:4552+ optional: true4553+4554 p-limit@2.3.0:4555 resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}4556 engines: {node: '>=6'}4557 149 unmodified lines4707 presentable-error@0.0.1:4708 resolution: {integrity: sha512-E6rsNU1QNJgB3sjj7OANinGncFKuK+164sLXw1/CqBjj/EkXSoSdHCtWQGBNlREIGLnL7IEUEGa08YFVUbrhVg==}4709 engines: {node: '>=16'}4710 4576- prettier@3.7.4:4577- resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==}4578- engines: {node: '>=14'}4579- hasBin: true4580-4711 pretty-ms@9.3.1:4712 resolution: {integrity: sha512-HzMy3Geq23nVALD/M2LliU+F+M+gVNsvkQWWqeBZ8HDiCgzo6YPJ/Omrmtq24EFrIsk0a3EkQGEd7bDOo+IhGA==}4713 engines: {node: '>=18'}4714 405 unmodified lines5120 tinyglobby@0.2.17:5121 resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}5122 engines: {node: '>=12.0.0'}5123 5124+ tinypool@2.1.2:5125+ resolution: {integrity: sha512-9YodfrxS9g9IbFr/KOjE5bAeJ0p61n3bW6mqvy0jtoeKd1kTW1Cxm0oulm6KX2lyM9Gl6WIe8nEbY7LWv5ZJww==}5126+ engines: {node: ^20.0.0 || >=22.0.0}5127+5128 tinyrainbow@3.1.1:5129 resolution: {integrity: sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==}5130 engines: {node: '>=14.0.0'}5131 1807 unmodified lines6939 '@oxc-project/types@0.76.0': {}6940 6941 '@oxc-project/types@0.96.0': {}6942 6943+ '@oxfmt/binding-android-arm-eabi@0.70.0':6944+ optional: true6945+6946+ '@oxfmt/binding-android-arm64@0.70.0':6947+ optional: true6948+6949+ '@oxfmt/binding-darwin-arm64@0.70.0':6950+ optional: true6951+6952+ '@oxfmt/binding-darwin-x64@0.70.0':6953+ optional: true6954+6955+ '@oxfmt/binding-freebsd-x64@0.70.0':6956+ optional: true6957+6958+ '@oxfmt/binding-linux-arm-gnueabihf@0.70.0':6959+ optional: true6960+6961+ '@oxfmt/binding-linux-arm-musleabihf@0.70.0':6962+ optional: true6963+6964+ '@oxfmt/binding-linux-arm64-gnu@0.70.0':6965+ optional: true6966+6967+ '@oxfmt/binding-linux-arm64-musl@0.70.0':6968+ optional: true6969+6970+ '@oxfmt/binding-linux-ppc64-gnu@0.70.0':6971+ optional: true6972+6973+ '@oxfmt/binding-linux-riscv64-gnu@0.70.0':6974+ optional: true6975+6976+ '@oxfmt/binding-linux-riscv64-musl@0.70.0':6977+ optional: true6978+6979+ '@oxfmt/binding-linux-s390x-gnu@0.70.0':6980+ optional: true6981+6982+ '@oxfmt/binding-linux-x64-gnu@0.70.0':6983+ optional: true6984+6985+ '@oxfmt/binding-linux-x64-musl@0.70.0':6986+ optional: true6987+6988+ '@oxfmt/binding-openharmony-arm64@0.70.0':6989+ optional: true6990+6991+ '@oxfmt/binding-win32-arm64-msvc@0.70.0':6992+ optional: true6993+6994+ '@oxfmt/binding-win32-ia32-msvc@0.70.0':6995+ optional: true6996+6997+ '@oxfmt/binding-win32-x64-msvc@0.70.0':6998+ optional: true6999+7000 '@pnpm/config.env-replace@1.1.0': {}7001 7002 '@pnpm/network.ca-file@1.0.2':7003 dependencies:2273 unmodified lines9277 transitivePeerDependencies:9278 - '@emnapi/core'9279 - '@emnapi/runtime'9280 9281+ oxfmt@0.70.0:9282+ dependencies:9283+ tinypool: 2.1.29284+ optionalDependencies:9285+ '@oxfmt/binding-android-arm-eabi': 0.70.09286+ '@oxfmt/binding-android-arm64': 0.70.09287+ '@oxfmt/binding-darwin-arm64': 0.70.09288+ '@oxfmt/binding-darwin-x64': 0.70.09289+ '@oxfmt/binding-freebsd-x64': 0.70.09290+ '@oxfmt/binding-linux-arm-gnueabihf': 0.70.09291+ '@oxfmt/binding-linux-arm-musleabihf': 0.70.09292+ '@oxfmt/binding-linux-arm64-gnu': 0.70.09293+ '@oxfmt/binding-linux-arm64-musl': 0.70.09294+ '@oxfmt/binding-linux-ppc64-gnu': 0.70.09295+ '@oxfmt/binding-linux-riscv64-gnu': 0.70.09296+ '@oxfmt/binding-linux-riscv64-musl': 0.70.09297+ '@oxfmt/binding-linux-s390x-gnu': 0.70.09298+ '@oxfmt/binding-linux-x64-gnu': 0.70.09299+ '@oxfmt/binding-linux-x64-musl': 0.70.09300+ '@oxfmt/binding-openharmony-arm64': 0.70.09301+ '@oxfmt/binding-win32-arm64-msvc': 0.70.09302+ '@oxfmt/binding-win32-ia32-msvc': 0.70.09303+ '@oxfmt/binding-win32-x64-msvc': 0.70.09304+9305 p-limit@2.3.0:9306 dependencies:9307 p-try: 2.2.09308 127 unmodified lines9436 prelude-ls@1.2.1: {}9437 9438 presentable-error@0.0.1: {}9439 9225- prettier@3.7.4: {}9226-9440 pretty-ms@9.3.1:9441 dependencies:9442 parse-ms: 4.0.09443 455 unmodified lines9899 dependencies:9900 fdir: 6.5.0(picomatch@4.0.7)9901 picomatch: 4.0.79902 9903+ tinypool@2.1.2: {}9904+9905 tinyrainbow@3.1.1: {}9906 9907 tldts-core@7.4.14: {}9908 435 unmodified lines