eslint-plugin-smarthr 4.0.0 → 4.0.1

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,13 @@
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
+ ## [4.0.1](https://github.com/kufu/tamatebako/compare/eslint-plugin-smarthr-v4.0.0...eslint-plugin-smarthr-v4.0.1) (2026-01-04)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **best-practice-for-spread-syntax:** 関数に対してspread syntaxで引数を渡すパターンが誤検知される問題を修正 ([#999](https://github.com/kufu/tamatebako/issues/999)) ([3f4a163](https://github.com/kufu/tamatebako/commit/3f4a163b183305922651612d7945434dcb5fa991))
11
+
5
12
  ## [4.0.0](https://github.com/kufu/tamatebako/compare/eslint-plugin-smarthr-v3.5.1...eslint-plugin-smarthr-v4.0.0) (2026-01-04)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-smarthr",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "author": "SmartHR",
5
5
  "license": "MIT",
6
6
  "description": "A sharable ESLint plugin for SmartHR",
@@ -26,7 +26,7 @@
26
26
  "json5": "^2.2.3"
27
27
  },
28
28
  "devDependencies": {
29
- "typescript-eslint": "^8.50.1"
29
+ "typescript-eslint": "^8.51.0"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "eslint": "^9"
@@ -37,5 +37,5 @@
37
37
  "eslintplugin",
38
38
  "smarthr"
39
39
  ],
40
- "gitHead": "f08245ba8257aa3587aa30b0024cb617638df74c"
40
+ "gitHead": "8dd34c6f8ed86887e4287f55b2b511e340291b32"
41
41
  }
@@ -16,13 +16,16 @@ const CHECK_OBJ_REGEX = /^(always|only-object)$/
16
16
  const getInsertIndex = (node, type, attributesKey) => {
17
17
  const attributes = node.parent[attributesKey]
18
18
 
19
- for (let i = 0; i < attributes.length; i++) {
20
- const a = attributes[i]
19
+ // HINT: 関数のspread elementの場合などは除外したいので属性がない場合に対応
20
+ if (attributes) {
21
+ for (let i = 0; i < attributes.length; i++) {
22
+ const a = attributes[i]
21
23
 
22
- if (a === node) {
23
- return -1
24
- } else if (a.type !== type) {
25
- return i
24
+ if (a === node) {
25
+ return -1
26
+ } else if (a.type !== type) {
27
+ return i
28
+ }
26
29
  }
27
30
  }
28
31
 
@@ -20,6 +20,7 @@ ruleTester.run('best-practice-for-spread-syntax', rule, {
20
20
  { code: `<Fuga {...props1} {...props2} id="ABC" />` },
21
21
  { code: `const hoge = { ...props, id: props.id || 'ABC' }` },
22
22
  { code: `const hoge = { ...props1, ...props2, id: 'ABC' }` },
23
+ { code: `dig(target, ...keys.slice(1))` },
23
24
  ],
24
25
  invalid: [
25
26
  {