@yoshinani/style-guide 0.14.2 → 0.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  - [ESLint](#eslint)
13
13
  - [TypeScript](#typescript)
14
14
  - [commitlint](#commitlint)
15
- - [cspell](#cspell)
15
+ - [CSpell](#CSpell)
16
16
 
17
17
  ## コントリビュートについて
18
18
 
@@ -69,7 +69,7 @@ VSCodeでフォーマッターとしてBiomeを利用する場合は、まず[Bi
69
69
 
70
70
  次に、`.vscode/settings.json` に以下の設定を追加します。
71
71
 
72
- ```json
72
+ ```jsonc
73
73
  {
74
74
  "biome.enabled": true,
75
75
  "editor.defaultFormatter": "biomejs.biome",
@@ -79,7 +79,7 @@ VSCodeでフォーマッターとしてBiomeを利用する場合は、まず[Bi
79
79
 
80
80
  プロジェクトの推奨拡張機能として設定するために、`.vscode/extensions.json`を作成し、以下の内容を追加することをお勧めします。
81
81
 
82
- ```json
82
+ ```jsonc
83
83
  {
84
84
  "recommendations": [
85
85
  "biomejs.biome"
@@ -106,6 +106,16 @@ const eslintConfig = [...next]
106
106
  export default eslintConfig
107
107
  ```
108
108
 
109
+ プロジェクトの推奨拡張機能として設定するために、`.vscode/extensions.json`を作成し、以下の内容を追加することをお勧めします。
110
+
111
+ ```json
112
+ {
113
+ "recommendations": [
114
+ "dbaeumer.vscode-eslint"
115
+ ]
116
+ }
117
+ ```
118
+
109
119
  ## TypeScript
110
120
 
111
121
  このスタイルガイドは複数の TypeScript 設定を提供しています。利用可能な設定は以下の通りです。
@@ -128,7 +138,7 @@ export default eslintConfig
128
138
 
129
139
  1. commitlintのインストール
130
140
 
131
- ```bash
141
+ ```sh
132
142
  pnpm add -D @commitlint/cli
133
143
  ```
134
144
 
@@ -140,13 +150,13 @@ export { default } from "@yoshinani/style-guide/commitlint"
140
150
 
141
151
  3. コミット時のリントをする場合、huskyの設定をしてください。
142
152
 
143
- ```bash
153
+ ```sh
144
154
  pnpm add -D husky
145
155
  ```
146
156
 
147
157
  `package.json`へスクリプトの追加。
148
158
 
149
- ```json:package.json
159
+ ```json
150
160
  "scripts": {
151
161
  "prepare": "husky",
152
162
  }
@@ -154,16 +164,16 @@ pnpm add -D husky
154
164
 
155
165
  `.husky/commit-msg`を作成。
156
166
 
157
- ```bash:.husky/commit-msg
167
+ ```bash
158
168
  #!/usr/bin/env sh
159
169
  . "$(dirname -- "$0")/_/husky.sh"
160
170
 
161
171
  pnpm commitlint --edit "$1"
162
172
  ```
163
173
 
164
- ## cspell
174
+ ## CSpell
165
175
 
166
- `.vscode/cspell.json`を作成し以下のように記載します。
176
+ `.vscode/cspell.json`を作成し以下のように記載します。こうすることでVSCodeからCSpellの設定が読み込まれます。
167
177
 
168
178
  ```json
169
179
  {
@@ -178,3 +188,58 @@ pnpm commitlint --edit "$1"
178
188
  ]
179
189
  }
180
190
  ```
191
+
192
+ プロジェクトの推奨拡張機能として設定するために、`.vscode/extensions.json`を作成し、以下の内容を追加することをお勧めします。
193
+
194
+ ```jsonc
195
+ {
196
+ "recommendations": [
197
+ "biomejs.biome",
198
+ "streetsidesoftware.code-spell-checker"
199
+ ]
200
+ }
201
+ ```
202
+
203
+ ## 例外的なスペルチェックの無効化方法
204
+
205
+ 固有名詞やランダムな文字列を書き込む際に、例外的にスペルチェックを無効化できます。
206
+
207
+ ```js
208
+ // 指定した行のチェックを無効化
209
+ const EXAMPLE_ID = "klfhasdflhadfasfa" // cspell: disable-line
210
+
211
+ // 直下の行のチェックを無効化
212
+ // cspell: disable-next-line
213
+ const LONG_ID = "klajdsjffadsfafkdafjajlmmxrklermanwafwncocmoc4ezdxcasf"
214
+
215
+ // 指定範囲のチェックを無効化
216
+ // cspell: disable
217
+ const MULTI_LINE_TXT = `
218
+ a;kfjas;dklfjads
219
+ aklfdj;adsjf;lka
220
+ ;kajkls;dfjal;f
221
+ `
222
+ // cspell: enable
223
+ ```
224
+
225
+ [詳細なドキュメント](https://cspell.org/docs/Configuration/document-settings)
226
+
227
+ ## CI上の設定
228
+
229
+ CSpellをCI上で実行する際は、GitHub Actionsに以下のような設定を追加します。
230
+
231
+ ```yaml
232
+ name: 'Check spelling'
233
+ on:
234
+ pull_request:
235
+ push:
236
+
237
+ jobs:
238
+ spellcheck:
239
+ runs-on: ubuntu-latest
240
+ steps:
241
+ - uses: actions/checkout@v4
242
+ - uses: streetsidesoftware/cspell-action@v7
243
+ ```
244
+
245
+ このときの設定は`.vscode/cspell.json`から暗黙的に読み込まれます。
package/cspell/words.txt CHANGED
@@ -5,6 +5,8 @@ esbuild
5
5
  firestore
6
6
  injecfn
7
7
  liff
8
+ mjsx
9
+ mtsx
8
10
  mypage
9
11
  nakanoaas
10
12
  neverthrow
@@ -15,6 +17,7 @@ postback
15
17
  remeda
16
18
  replyable
17
19
  sendgrid
20
+ serviceworker
18
21
  shadcn
19
22
  signin
20
23
  signins
package/eslint/base.mjs CHANGED
@@ -198,7 +198,7 @@ export default tseslint.config(
198
198
  message: "zustandまたはjotaiを使用してください。",
199
199
  },
200
200
  {
201
- name: "superstruct",
201
+ name: "superstruct", // cspell: disable-line
202
202
  message: "valibotを使用してください。",
203
203
  },
204
204
  {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@yoshinani/style-guide",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
4
4
  "description": "YOSHINANI's Style Guide",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "engines": {
8
- "node": "22",
8
+ "node": ">=22",
9
9
  "pnpm": "10"
10
10
  },
11
11
  "publishConfig": {