Skip to content
Myr

chore: add editorconfig-checker (#4312)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* chore(deps): add editorconfig-checker to devDependencies * style: apply editorconfig-checker suggestions * chore: unset charset and newline settings in `.editorconfig` for `.lockb` and `.pxm` files * chore: add editorconfig-checker script to `package.json` * test: update static response assertions to match optional newline

authored by 3w36zj6 · committed by GitHub · parent f91ec14 · Browse files · 19 files+38 added−28 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

19 files+38 added−28 removed

  • tests:+8 added−8 removed
  • other:+30 added−20 removed

19 files+38 added−28 removed

modified:benchmarks/deno/.gitignore+1 added-1 removed
1*.sqlite1*.sqlite
modified:benchmarks/http-server/.gitignore+1 added-1 removed
1.benchmark-temp/2benchmark-results.md2benchmark-results.md
modified:benchmarks/utils/.gitignore+1 added-1 removed
1yarn.lock2bun.lockb2bun.lockb
modified:benchmarks/webapp/.gitignore+1 added-1 removed
1yarn.lock1yarn.lock
modified:docs/MIGRATION.md+4 added-4 removed
266 unmodified lines
267You do not have to use Body parse middleware to parse request body. Use `c.req.parseBody()` method instead.268269```ts270// Parse Request body271 app.post('', (c) => {272 const body = c.req.parseBody()273 ...274 })271app.post('', (c) => {272 const body = c.req.parseBody()273 ...274})275```276277### GraphQL Server middleware is obsolete278
17 unmodified lines
modified:runtime-tests/bun/.static/plain.txt+1 added-1 removed
1Bun!!1Bun!!
modified:runtime-tests/bun/static/download+1 added-1 removed
1download1download
modified:runtime-tests/bun/static/plain.txt+1 added-1 removed
1Bun!1Bun!
modified:runtime-tests/bun/static-absolute-root/plain.txt+1 added-1 removed
1Bun!1Bun!
modified:runtime-tests/bun/index.test.tsx+4 added-4 removed
130 unmodified lines
131132 it('Should return 200 response - /static/plain.txt', async () => {133 const res = await app.request(new Request('http://localhost/static/plain.txt'))134 expect(res.status).toBe(200)135 expect(await res.text()).toBe('Bun!')135 expect(await res.text()).toMatch(/^Bun!(\r?\n)?$/)136 expect(onNotFound).not.toHaveBeenCalled()137 })138139 it('Should return 200 response - /static/download', async () => {140 const res = await app.request(new Request('http://localhost/static/download'))141 expect(res.status).toBe(200)142 expect(await res.text()).toBe('download')142 expect(await res.text()).toMatch(/^download(\r?\n)?$/)143 expect(onNotFound).not.toHaveBeenCalled()144 })145146 it('Should return 200 response - /dot-static/plain.txt', async () => {147 const res = await app.request(new Request('http://localhost/dot-static/plain.txt'))148 expect(res.status).toBe(200)149 expect(await res.text()).toBe('Bun!!')149 expect(await res.text()).toMatch(/^Bun!!(\r?\n)?$/)150 })151152 it('Should return 200 response - /static/helloworld', async () => {153 const res = await app.request('http://localhost/static/helloworld')
9 unmodified lines
163164 it('Should return 200 response - /static-absolute-root/plain.txt', async () => {165 const res = await app.request('http://localhost/static-absolute-root/plain.txt')166 expect(res.status).toBe(200)167 expect(await res.text()).toBe('Bun!')167 expect(await res.text()).toMatch(/^Bun!(\r?\n)?$/)168 expect(onNotFound).not.toHaveBeenCalled()169 })170})171
281 unmodified lines
modified:runtime-tests/deno/.static/plain.txt+1 added-1 removed
1Deno!!1Deno!!
modified:runtime-tests/deno/static/download+1 added-1 removed
1download1download
modified:runtime-tests/deno/static/plain.txt+1 added-1 removed
1Deno!1Deno!
modified:runtime-tests/deno/static-absolute-root/plain.txt+1 added-1 removed
1Deno!1Deno!
modified:runtime-tests/deno/middleware.test.tsx+4 added-4 removed
108 unmodified lines
109 assertSpyCall(onNotFound, 0)110111 res = await app.request('http://localhost/static/plain.txt')112 assertEquals(res.status, 200)113 assertEquals(await res.text(), 'Deno!')113 assertMatch(await res.text(), /^Deno!(\r?\n)?$/)114115 res = await app.request('http://localhost/static/download')116 assertEquals(res.status, 200)117 assertEquals(await res.text(), 'download')117 assertMatch(await res.text(), /^download(\r?\n)?$/)118119 res = await app.request('http://localhost/dot-static/plain.txt')120 assertEquals(res.status, 200)121 assertEquals(await res.text(), 'Deno!!')121 assertMatch(await res.text(), /^Deno!!(\r?\n)?$/)122 assertSpyCalls(onNotFound, 1)123124 res = await app.fetch({125 method: 'GET',
11 unmodified lines
137 assertEquals(await res.text(), 'Hi\n')138139 res = await app.request('http://localhost/static-absolute-root/plain.txt')140 assertEquals(res.status, 200)141 assertEquals(await res.text(), 'Deno!')141 assertMatch(await res.text(), /^Deno!(\r?\n)?$/)142143 res = await app.request('http://localhost/static')144 assertEquals(res.status, 404)145 assertEquals(await res.text(), '404 Not Found')
41 unmodified lines
modified:src/utils/url.ts+3 added-3 removed
164 unmodified lines
165}166167export const checkOptionalParameter = (path: string): string[] | null => {168 /*169 If path is `/api/animals/:type?` it will return:170 [`/api/animals`, `/api/animals/:type`]171 in other cases it will return null169 If path is `/api/animals/:type?` it will return:170 [`/api/animals`, `/api/animals/:type`]171 in other cases it will return null172 */173174 if (path.charCodeAt(path.length - 1) !== 63 || !path.includes(':')) {175 return null
137 unmodified lines
modified:.editorconfig+5 added
12 unmodified lines
13[*.{md,yaml,yml}]14indent_style = space15indent_size = 216trim_trailing_whitespace = false1718[*.{lockb,pxm}]19charset = unset20insert_final_newline = unset21end_of_line = unset
modified:bun.lock+3 added
12 unmodified lines
13 "@typescript/native-preview": "7.0.0-dev.20250523.1",14 "@vitest/coverage-v8": "^3.0.5",15 "arg": "^5.0.2",16 "bun-types": "^1.1.39",17 "editorconfig-checker": "^6.1.0",18 "esbuild": "^0.15.18",19 "eslint": "^9.10.0",20 "glob": "^11.0.0",21 "jsdom": "^22.1.0",
638 unmodified lines
660 "dot-prop": ["dot-prop@9.0.0", "", { "dependencies": { "type-fest": "^4.18.2" } }, "sha512-1gxPBJpI/pcjQhKgIU91II6Wkay+dLcN3M6rf2uwP8hRur3HtQXjVrdAK3sjC0piaEuxzMwjXChcETiJl47lAQ=="],661662 "eastasianwidth": ["eastasianwidth@0.2.0", "", {}, "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="],663664 "editorconfig-checker": ["editorconfig-checker@6.1.0", "", { "bin": { "ec": "dist/index.js", "editorconfig-checker": "dist/index.js" } }, "sha512-i25NwXlcWhadiO62AFUauucFPi9LwasoMRqoM8KkG3rJp6bx09mL/fDQpNMz2f6Nx/7EPVIZHK5/tIdztWzflA=="],665666 "elegant-spinner": ["elegant-spinner@1.0.1", "", {}, "sha512-B+ZM+RXvRqQaAmkMlO/oSe5nMUOaUnyfGYCEHoR8wrXsZR2mA0XVibsxV1bvTwxdRWah1PkQqso2EzhILGHtEQ=="],667668 "emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],669
1519 unmodified lines
modified:package.json+3 added-1 removed
22 unmodified lines
23 "lint": "eslint src runtime-tests build perf-measures benchmarks",24 "lint:fix": "eslint src runtime-tests build perf-measures benchmarks --fix",25 "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}\"",26 "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}\"",27 "editorconfig-checker": "editorconfig-checker",28 "copy:package.cjs.json": "cp ./package.cjs.json ./dist/cjs/package.json && cp ./package.cjs.json ./dist/types/package.json",29 "build": "bun run --shell bun remove-dist && bun ./build/build.ts && bun run copy:package.cjs.json",30 "postbuild": "publint",31 "watch": "bun run --shell bun remove-dist && bun ./build/build.ts --watch && bun run copy:package.cjs.json",
633 unmodified lines
665 "@typescript/native-preview": "7.0.0-dev.20250523.1",666 "@vitest/coverage-v8": "^3.0.5",667 "arg": "^5.0.2",668 "bun-types": "^1.1.39",669 "editorconfig-checker": "^6.1.0",670 "esbuild": "^0.15.18",671 "eslint": "^9.10.0",672 "glob": "^11.0.0",673 "jsdom": "^22.1.0",
12 unmodified lines
686 },687 "engines": {688 "node": ">=16.9.0"689 }688}690}