eslint-plugin-smarthr 6.21.0 → 6.21.2
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [6.21.2](https://github.com/kufu/tamatebako/compare/eslint-plugin-smarthr-v6.21.1...eslint-plugin-smarthr-v6.21.2) (2026-06-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* require-i18n-translation-syncでsatisfies演算子に対応 ([#1415](https://github.com/kufu/tamatebako/issues/1415)) ([d0eb87a](https://github.com/kufu/tamatebako/commit/d0eb87a1616c63145499b8adc9fc20d5f6f8c5b9))
|
|
11
|
+
|
|
12
|
+
## [6.21.1](https://github.com/kufu/tamatebako/compare/eslint-plugin-smarthr-v6.21.0...eslint-plugin-smarthr-v6.21.1) (2026-06-22)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **eslint-plugin-smarthr:** use https repository metadata ([#1407](https://github.com/kufu/tamatebako/issues/1407)) ([e6d3d82](https://github.com/kufu/tamatebako/commit/e6d3d82d4d833a2716c67d91f82fe7bd6e2ab6cc))
|
|
18
|
+
|
|
5
19
|
## [6.21.0](https://github.com/kufu/tamatebako/compare/eslint-plugin-smarthr-v6.20.0...eslint-plugin-smarthr-v6.21.0) (2026-06-22)
|
|
6
20
|
|
|
7
21
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-smarthr",
|
|
3
|
-
"version": "6.21.
|
|
3
|
+
"version": "6.21.2",
|
|
4
4
|
"author": "SmartHR",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A sharable ESLint plugin for SmartHR",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "git+
|
|
10
|
+
"url": "git+https://github.com/kufu/tamatebako.git"
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr",
|
|
13
13
|
"publishConfig": {
|
|
@@ -200,6 +200,25 @@ export const translations = {
|
|
|
200
200
|
} as const
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
+
### satisfies演算子
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
// satisfies のみ
|
|
207
|
+
export const translations = {
|
|
208
|
+
'Common/Button/Submit': '送信'
|
|
209
|
+
} satisfies Record<string, string>
|
|
210
|
+
|
|
211
|
+
// as const と satisfies の併用
|
|
212
|
+
export const translations = {
|
|
213
|
+
'Common/Button/Submit': '送信'
|
|
214
|
+
} as const satisfies Record<string, string>
|
|
215
|
+
|
|
216
|
+
// satisfies と as const の併用(順序逆)
|
|
217
|
+
export const translations = {
|
|
218
|
+
'Common/Button/Submit': '送信'
|
|
219
|
+
} satisfies Record<string, string> as const
|
|
220
|
+
```
|
|
221
|
+
|
|
203
222
|
### 型注釈
|
|
204
223
|
|
|
205
224
|
```typescript
|
|
@@ -126,6 +126,18 @@ function findExportedObject(program) {
|
|
|
126
126
|
exportedObject = decl.init.expression
|
|
127
127
|
}
|
|
128
128
|
break
|
|
129
|
+
case 'TSSatisfiesExpression':
|
|
130
|
+
if (decl.init.expression.type === 'ObjectExpression') {
|
|
131
|
+
// satisfies Type
|
|
132
|
+
objectExportCount++
|
|
133
|
+
exportedObject = decl.init.expression
|
|
134
|
+
} else if (decl.init.expression.type === 'TSAsExpression' &&
|
|
135
|
+
decl.init.expression.expression.type === 'ObjectExpression') {
|
|
136
|
+
// as const satisfies Type のパターン
|
|
137
|
+
objectExportCount++
|
|
138
|
+
exportedObject = decl.init.expression.expression
|
|
139
|
+
}
|
|
140
|
+
break
|
|
129
141
|
}
|
|
130
142
|
}
|
|
131
143
|
}
|
|
@@ -144,6 +156,18 @@ function findExportedObject(program) {
|
|
|
144
156
|
exportedObject = node.declaration.expression
|
|
145
157
|
}
|
|
146
158
|
break
|
|
159
|
+
case 'TSSatisfiesExpression':
|
|
160
|
+
if (node.declaration.expression.type === 'ObjectExpression') {
|
|
161
|
+
// satisfies Type
|
|
162
|
+
objectExportCount++
|
|
163
|
+
exportedObject = node.declaration.expression
|
|
164
|
+
} else if (node.declaration.expression.type === 'TSAsExpression' &&
|
|
165
|
+
node.declaration.expression.expression.type === 'ObjectExpression') {
|
|
166
|
+
// as const satisfies Type のパターン
|
|
167
|
+
objectExportCount++
|
|
168
|
+
exportedObject = node.declaration.expression.expression
|
|
169
|
+
}
|
|
170
|
+
break
|
|
147
171
|
}
|
|
148
172
|
}
|
|
149
173
|
}
|
|
@@ -201,6 +201,41 @@ ruleTester.run('require-i18n-translation-sync', rule, {
|
|
|
201
201
|
filename: setupTestFile('valid-with-multiple-types.ts', { key1: 'value1' }),
|
|
202
202
|
options: defaultOptions,
|
|
203
203
|
},
|
|
204
|
+
|
|
205
|
+
// as const satisfies パターン
|
|
206
|
+
{
|
|
207
|
+
code: "export const translations = { key1: 'value1' } as const satisfies Record<string, string>",
|
|
208
|
+
filename: setupTestFile('valid-as-const-satisfies.ts', { key1: 'value1' }),
|
|
209
|
+
options: defaultOptions,
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
// satisfies as const パターン
|
|
213
|
+
{
|
|
214
|
+
code: "export const translations = { key1: 'value1' } satisfies Record<string, string> as const",
|
|
215
|
+
filename: setupTestFile('valid-satisfies-as-const.ts', { key1: 'value1' }),
|
|
216
|
+
options: defaultOptions,
|
|
217
|
+
},
|
|
218
|
+
|
|
219
|
+
// satisfies のみのパターン
|
|
220
|
+
{
|
|
221
|
+
code: "export const translations = { key1: 'value1' } satisfies Record<string, string>",
|
|
222
|
+
filename: setupTestFile('valid-satisfies-only.ts', { key1: 'value1' }),
|
|
223
|
+
options: defaultOptions,
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
// export default with satisfies
|
|
227
|
+
{
|
|
228
|
+
code: "export default { key1: 'value1' } satisfies Record<string, string>",
|
|
229
|
+
filename: setupTestFile('valid-default-satisfies.ts', { key1: 'value1' }),
|
|
230
|
+
options: defaultOptions,
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
// export default with as const satisfies
|
|
234
|
+
{
|
|
235
|
+
code: "export default { key1: 'value1' } as const satisfies Record<string, string>",
|
|
236
|
+
filename: setupTestFile('valid-default-as-const-satisfies.ts', { key1: 'value1' }),
|
|
237
|
+
options: defaultOptions,
|
|
238
|
+
},
|
|
204
239
|
],
|
|
205
240
|
|
|
206
241
|
invalid: [
|