Skip to content

Commit d02366f

Browse files
authored
chore: add editorconfig-checker (#4312)
* 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
1 parent f91ec14 commit d02366f

File tree

19 files changed

+38
-28
lines changed

19 files changed

+38
-28
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ trim_trailing_whitespace = true
1414
indent_style = space
1515
indent_size = 2
1616
trim_trailing_whitespace = false
17+
18+
[*.{lockb,pxm}]
19+
charset = unset
20+
insert_final_newline = unset
21+
end_of_line = unset

benchmarks/deno/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
*.sqlite
1+
*.sqlite

benchmarks/http-server/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
.benchmark-temp/
2-
benchmark-results.md
2+
benchmark-results.md

benchmarks/utils/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
yarn.lock
2-
bun.lockb
2+
bun.lockb

benchmarks/webapp/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
yarn.lock
1+
yarn.lock

bun.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@vitest/coverage-v8": "^3.0.5",
1515
"arg": "^5.0.2",
1616
"bun-types": "^1.1.39",
17+
"editorconfig-checker": "^6.1.0",
1718
"esbuild": "^0.15.18",
1819
"eslint": "^9.10.0",
1920
"glob": "^11.0.0",
@@ -660,6 +661,8 @@
660661

661662
"eastasianwidth": ["[email protected]", "", {}, "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="],
662663

664+
"editorconfig-checker": ["[email protected]", "", { "bin": { "ec": "dist/index.js", "editorconfig-checker": "dist/index.js" } }, "sha512-i25NwXlcWhadiO62AFUauucFPi9LwasoMRqoM8KkG3rJp6bx09mL/fDQpNMz2f6Nx/7EPVIZHK5/tIdztWzflA=="],
665+
663666
"elegant-spinner": ["[email protected]", "", {}, "sha512-B+ZM+RXvRqQaAmkMlO/oSe5nMUOaUnyfGYCEHoR8wrXsZR2mA0XVibsxV1bvTwxdRWah1PkQqso2EzhILGHtEQ=="],
664667

665668
"emoji-regex": ["[email protected]", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],

docs/MIGRATION.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ You do not have to use Body parse middleware to parse request body. Use `c.req.p
268268
269269
```ts
270270
// Parse Request body
271-
app.post('', (c) => {
272-
const body = c.req.parseBody()
273-
...
274-
})
271+
app.post('', (c) => {
272+
const body = c.req.parseBody()
273+
...
274+
})
275275
```
276276
277277
### GraphQL Server middleware is obsolete

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"lint:fix": "eslint src runtime-tests build perf-measures benchmarks --fix",
2525
"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}\"",
2626
"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",
2728
"copy:package.cjs.json": "cp ./package.cjs.json ./dist/cjs/package.json && cp ./package.cjs.json ./dist/types/package.json",
2829
"build": "bun run --shell bun remove-dist && bun ./build/build.ts && bun run copy:package.cjs.json",
2930
"postbuild": "publint",
@@ -665,6 +666,7 @@
665666
"@vitest/coverage-v8": "^3.0.5",
666667
"arg": "^5.0.2",
667668
"bun-types": "^1.1.39",
669+
"editorconfig-checker": "^6.1.0",
668670
"esbuild": "^0.15.18",
669671
"eslint": "^9.10.0",
670672
"glob": "^11.0.0",
@@ -685,4 +687,4 @@
685687
"engines": {
686688
"node": ">=16.9.0"
687689
}
688-
}
690+
}

runtime-tests/bun/.static/plain.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Bun!!
1+
Bun!!

runtime-tests/bun/index.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,21 +132,21 @@ describe('Serve Static Middleware', () => {
132132
it('Should return 200 response - /static/plain.txt', async () => {
133133
const res = await app.request(new Request('http://localhost/static/plain.txt'))
134134
expect(res.status).toBe(200)
135-
expect(await res.text()).toBe('Bun!')
135+
expect(await res.text()).toMatch(/^Bun!(\r?\n)?$/)
136136
expect(onNotFound).not.toHaveBeenCalled()
137137
})
138138

139139
it('Should return 200 response - /static/download', async () => {
140140
const res = await app.request(new Request('http://localhost/static/download'))
141141
expect(res.status).toBe(200)
142-
expect(await res.text()).toBe('download')
142+
expect(await res.text()).toMatch(/^download(\r?\n)?$/)
143143
expect(onNotFound).not.toHaveBeenCalled()
144144
})
145145

146146
it('Should return 200 response - /dot-static/plain.txt', async () => {
147147
const res = await app.request(new Request('http://localhost/dot-static/plain.txt'))
148148
expect(res.status).toBe(200)
149-
expect(await res.text()).toBe('Bun!!')
149+
expect(await res.text()).toMatch(/^Bun!!(\r?\n)?$/)
150150
})
151151

152152
it('Should return 200 response - /static/helloworld', async () => {
@@ -164,7 +164,7 @@ describe('Serve Static Middleware', () => {
164164
it('Should return 200 response - /static-absolute-root/plain.txt', async () => {
165165
const res = await app.request('http://localhost/static-absolute-root/plain.txt')
166166
expect(res.status).toBe(200)
167-
expect(await res.text()).toBe('Bun!')
167+
expect(await res.text()).toMatch(/^Bun!(\r?\n)?$/)
168168
expect(onNotFound).not.toHaveBeenCalled()
169169
})
170170
})

0 commit comments

Comments
 (0)