Skip to content

Commit caba313

Browse files
committed
chore: introduce prettier and eslint
1 parent 7a91b6f commit caba313

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+8238
-2659
lines changed

.eslintcache

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

.github/labels.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,87 @@
11
- name: feature
22
description: Includes new features
3-
color: 'ffff00'
3+
color: ffff00
44
- name: bug
55
description: Includes new features
6-
color: 'ee0701'
6+
color: ee0701
77
- name: improvement
88
description: Includes backwards-compatible fixes
9-
color: '1d76db'
9+
color: 1d76db
1010
- name: breaking
1111
description: Includes backwards-incompatible fixes
12-
color: 'b60205'
12+
color: b60205
1313
- name: refactoring
1414
description: A code change that neither fixes a bug nor adds a feature
15-
color: 'fbca04'
15+
color: fbca04
1616
- name: security
1717
description: Security fixes
18-
color: 'b60205'
18+
color: b60205
1919
- name: documentation
2020
description: Includes documetation fixes
2121
color: '5319e7'
2222
- name: example
2323
description: Includes example and demo code fixes
24-
color: 'db0875'
24+
color: db0875
2525
- name: deprecated
2626
description: Includes deprecate fixes
27-
color: 'f7ffa8'
27+
color: f7ffa8
2828
- name: performance
2929
description: Includes performance fixes
30-
color: 'cc317c'
30+
color: cc317c
3131
- name: i18n
3232
description: Includes internationalization fixes
33-
color: 'ffd412'
33+
color: ffd412
3434
- name: a11y
3535
description: Inlucdes accessibility fixes
36-
color: '0000ff'
36+
color: 0000ff
3737
- name: dependency
3838
description: Includes dependency fixes
39-
color: 'ffbce7'
39+
color: ffbce7
4040
- name: todo
4141
description: todo tasks
42-
color: 'c2e0c6'
42+
color: c2e0c6
4343
- name: duplicate
4444
description: This issue or Pull Request already exists
45-
color: 'ededed'
45+
color: ededed
4646
- name: help wanted
4747
description: Extra attention is needed
48-
color: 'e99695'
48+
color: e99695
4949
- name: good first issue
5050
description: Good for newcomers
51-
color: '7057ff'
51+
color: 7057ff
5252
- name: 'status: abandoned'
5353
description: The issue or Pull Request is wontfix
5454
color: '000000'
5555
- name: 'status: blocked'
5656
description: Progress on the issue is Blocked
57-
color: 'ee0701'
57+
color: ee0701
5858
- name: 'status: in progress'
5959
description: Work in Progress
60-
color: 'cccccc'
60+
color: cccccc
6161
- name: 'status: proposal'
6262
description: Request for comments
63-
color: 'd4c5f9'
63+
color: d4c5f9
6464
- name: 'status: pull request welcome'
6565
description: Welcome to Pull Request
6666
color: '2E7733'
6767
- name: 'status: review needed'
6868
description: Request for review
69-
color: 'fbca04'
69+
color: fbca04
7070
- name: 'status: need more repro codes or info'
7171
description: Lacks enough info to make progress
72-
color: 'F9C90A'
73-
- name: '🧹 p1-chore'
72+
color: F9C90A
73+
- name: 🧹 p1-chore
7474
description: 'Priority 1: no change in change code behavior'
7575
color: '#FDDFD7'
76-
- name: '🍰 p2-nice-to-have'
76+
- name: 🍰 p2-nice-to-have
7777
description: "Priority 2: nothing is broken but it's worth addressing"
7878
color: '#0e8a16'
79-
- name: '🔨 p3-minor-bug'
79+
- name: 🔨 p3-minor-bug
8080
description: 'Priority 3: a bug in an edge case that only affects very specific usage'
8181
color: '#fbca04'
82-
- name: '❗ p4-important'
82+
- name: ❗ p4-important
8383
description: 'Priority 4: bugs that violate documented behavior, or significantly impact perf'
8484
color: '#d93f0b'
85-
- name: '🔥 p5-urgent'
85+
- name: 🔥 p5-urgent
8686
description: 'Priority 5: build-breaking bugs that affect most users and should be fixed ASAP'
8787
color: '#ee0701'

.github/workflows/github-label-sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
paths:
88
- .github/labels.yml
99
- .github/workflows/github-label-sync.yml
10-
workflow_dispatch:
10+
workflow_dispatch: # eslint-disable-line yml/no-empty-mapping-value -- NOTE(kazupon): mamulally dispatch workflow
1111

1212
jobs:
1313
sync:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
id: split
4545
with:
4646
msg: ${{ github.ref }}
47-
separator: '/'
47+
separator: /
4848

4949
- name: Create Github Release
5050
run: gh release create ${{ steps.split.outputs._2 }} --generate-notes

.vscode/settings.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
{
22
"deno.enable": false,
3-
"deno.lint": true,
3+
"deno.lint": false,
4+
"editor.defaultFormatter": "esbenp.prettier-vscode",
45
"editor.formatOnSave": true,
5-
"editor.defaultFormatter": "denoland.vscode-deno"
6+
"editor.formatOnType": true,
7+
"editor.codeActionsOnSave": {
8+
"source.organizeImports": "always",
9+
"source.fixAll.eslint": "explicit"
10+
},
11+
"eslint.useFlatConfig": true,
12+
"eslint.validate": ["javascript", "typescript"],
13+
"files.associations": {
14+
"*.json": "jsonc"
15+
},
16+
"typescript.referencesCodeLens.enabled": true,
17+
"typescript.tsdk": "node_modules/typescript/lib",
18+
"typescript.experimental.useTsgo": false
619
}

CONTRIBUTING.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@
3939
- It's OK to have multiple small commits as you work on the PR - we will let
4040
GitHub automatically squash it before merging.
4141

42-
- Make sure `npm test` passes. (see [development setup](#development-setup))
42+
- Make sure `pnpm test` passes. (see [development setup](#development-setup))
4343

4444
- If adding new feature:
45-
4645
- Add accompanying test case.
4746
- Provide convincing reason to add this feature. Ideally you should open a
4847
suggestion issue first and have it greenlighted before working on it.
@@ -65,13 +64,13 @@
6564
You will need to install the below JavaScript runtime:
6665

6766
- [Node.js](http://nodejs.org) **version 18+**
68-
- [Bun](https://bun.sh/) **version 1.0+**
67+
- [Bun](https://bun.sh/) **version 2.0+**
6968
- [Deno](https://deno.com/) **version 1.36+**
7069

7170
After cloning the repo, run:
7271

73-
```bash
74-
$ bun install # install the dependencies of the project
72+
```sh
73+
$ pnpm install # install the dependencies of the project
7574
```
7675

7776
A high level overview of tools used:
@@ -81,14 +80,16 @@ A high level overview of tools used:
8180

8281
### Commonly used NPM scripts
8382

84-
# lint source codes
85-
$ npm run lint
83+
```sh
84+
# lint source codes
85+
$ pnpm lint
8686

87-
# format source codes
88-
$ npm run format
87+
# fix source codes
88+
$ pnpm format
8989

90-
# run the full test suite
91-
$ npm run test
90+
# run the full test suite
91+
$ pnpm test
92+
```
9293

9394
There are some other scripts available in the `scripts` section of the
9495
`package.json` file.

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ You can install via `import`.
5555

5656
in your code:
5757

58+
<!-- eslint-skip -->
59+
5860
```ts
5961
/**
6062
* you can install via other CDN URL such as skypack,
@@ -79,20 +81,22 @@ in your HTML:
7981

8082
```html
8183
<script type="module">
82-
/**
83-
* you can install via other CDN URL such as skypack,
84-
* or, you can also use import maps
85-
*/
86-
import { isLocale } from 'https://esm.sh/@intlify/utils'
87-
88-
// something todo
89-
// ...
84+
/**
85+
* you can install via other CDN URL such as skypack,
86+
* or, you can also use import maps
87+
*/
88+
import { isLocale } from 'https://esm.sh/@intlify/utils'
89+
90+
// something todo
91+
// ...
9092
</script>
9193
```
9294

9395
<details>
9496
<summary>Using Edge Releases</summary>
9597

98+
<!-- eslint-skip -->
99+
96100
```ts
97101
import { isLocale } from 'https://esm.sh/@intlify/utils-edge'
98102

@@ -134,9 +138,13 @@ You can do `import { ... } from '@intlify/utils'` the above utilities
134138

135139
You can do `import { ... } from '@intlify/utils'` the above utilities
136140

141+
<!-- eslint-disable markdown/no-missing-label-refs -->
142+
137143
> [!NOTE]
138144
> for Node.js You need to do `import { ... } from '@intlify/utils/node'`
139145
146+
<!-- eslint-enable markdown/no-missing-label-refs -->
147+
140148
### HTTP
141149

142150
- `getHeaderLanguages`

build.config.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ import { defineBuildConfig } from 'unbuild'
33
export default defineBuildConfig({
44
declaration: true,
55
replace: {
6-
'import.meta.vitest': 'false',
6+
'import.meta.vitest': 'false'
77
},
88
rollup: {
99
emitCJS: true,
10-
inlineDependencies: true,
10+
inlineDependencies: true
1111
},
1212
entries: [
1313
{
14-
input: './src/index.ts',
14+
input: './src/index.ts'
1515
},
1616
{
17-
input: './src/h3.ts',
17+
input: './src/h3.ts'
1818
},
1919
{
20-
input: './src/hono.ts',
20+
input: './src/hono.ts'
2121
},
2222
{
23-
input: './src/node.ts',
24-
},
23+
input: './src/node.ts'
24+
}
2525
],
26-
externals: ['h3', 'hono'],
26+
externals: ['h3', 'hono']
2727
})

deno.jsonc

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)