eslint-plugin-smarthr 6.12.0 → 6.12.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.
@@ -0,0 +1,124 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(npm test:*)",
5
+ "Bash(git checkout:*)",
6
+ "Bash(git pull:*)",
7
+ "Bash(git add:*)",
8
+ "Bash(git commit:*)",
9
+ "Bash(git push:*)",
10
+ "Bash(gh pr:*)",
11
+ "Bash(brew upgrade:*)",
12
+ "Bash(git fetch:*)",
13
+ "Bash(git merge:*)",
14
+ "Bash(git restore:*)",
15
+ "Bash(git reset:*)",
16
+ "Bash(grep -l \"node\\) =>\" rules/*/index.js)",
17
+ "Bash(git branch:*)",
18
+ "Bash(git revert:*)",
19
+ "Bash(column -t -s '|')",
20
+ "Bash(gh api:*)",
21
+ "Bash(grep -r \"=\\\\{[''''\"\"\\\\`][a-zA-Z0-9]*[''''\"\"\\\\`]\\\\}\" test/*.js)",
22
+ "Bash(grep -E \"=\\\\{[''''\"\"\\\\`]\" test/*.js)",
23
+ "Bash(grep \"name={\\\\`ABC\\\\`}\")",
24
+ "Bash(grep -nE \"=\\\\{\\\\`[^$\\\\`]*\\\\`\\\\}\" test/*.js)",
25
+ "Read(//Users/atsushi.mizoue/works/tamatebako/**)",
26
+ "Bash(pnpm install:*)",
27
+ "Bash(pnpm test:*)",
28
+ "Bash(grep -v '^master$')",
29
+ "Bash(grep -E \"FieldSet|BaseColumn|Message$|Fieldsets|FormControls|RadioButtons|RadioButtonPanels|Checkboxes\" test/component-name.js)",
30
+ "Bash(git stash:*)",
31
+ "Bash(grep -n \"new RegExp\" rules/*/index.js)",
32
+ "Bash(grep -nE \"\\\\.replace\\\\\\(\\\\/|\\\\.test\\\\\\(\\\\/|\\\\.match\\\\\\(\\\\/|\\\\.exec\\\\\\(\\\\/|\\\\.search\\\\\\(\\\\/\" rules/*/index.js)",
33
+ "Bash(grep -nE \"const .* = /\" rules/*/index.js)",
34
+ "Bash(grep -n \"Object.keys\\(\" rules/*/index.js)",
35
+ "Bash(grep -n \"const.*=.*Object\\\\.keys\\(\" rules/*/index.js)",
36
+ "Bash(grep:*)",
37
+ "Bash(grep -n \"\\\\.forEach\\(\" rules/*/index.js)",
38
+ "Bash(sort -k1,1 -k3,3)",
39
+ "Bash(for branch:*)",
40
+ "Bash(do)",
41
+ "Bash(echo \"=== $branch ===\")",
42
+ "Bash(git log:*)",
43
+ "Bash(done)",
44
+ "WebSearch",
45
+ "Bash(git mv:*)",
46
+ "Bash(node:*)",
47
+ "Bash(do echo:*)",
48
+ "Bash(echo \"Checking files...\" git ls-tree -r --name-only $branch packages/eslint-plugin-smarthr/rules/)",
49
+ "Bash(git ls-tree:*)",
50
+ "Bash(git config:*)",
51
+ "Bash(npm run:*)",
52
+ "Bash(ls rules/*/README.md)",
53
+ "Bash(find rules:*)",
54
+ "Bash(cp:*)",
55
+ "Bash(cd:*)",
56
+ "Bash(/Users/atsushi.mizoue/works/hanica/client/eslint/rules/best-practice-for-response-message.cjs:*)",
57
+ "Bash(/Users/atsushi.mizoue/works/hanica/client/eslint/rules/a11y-prohibit-overflow-hidden.cjs:*)",
58
+ "Bash(/Users/atsushi.mizoue/works/hanica/client/eslint/rules/a11y-scroller-has-tabindex.cjs:*)",
59
+ "Bash(__NEW_LINE_aaf112b90809b36f__ cat:*)",
60
+ "Bash(/Users/atsushi.mizoue/works/hanica/client/eslint/rules/best-practice-for-text-component.cjs:*)",
61
+ "Bash(/Users/atsushi.mizoue/works/hanica/client/eslint/rules/design-system-guideline-prohibit-dialog-button-icon.cjs:*)",
62
+ "Bash(__NEW_LINE_220f471abdeba11e__ cat:*)",
63
+ "Bash(for dir:*)",
64
+ "Bash(do if:*)",
65
+ "Read(//Users/atsushi.mizoue/works/tamatebako/packages/eslint-plugin-smarthr/$dir/**)",
66
+ "Bash(then echo:*)",
67
+ "Bash(fi)",
68
+ "Bash(pnpm eslint:*)",
69
+ "Bash(git cherry-pick:*)",
70
+ "Bash(git rebase:*)",
71
+ "Bash(GIT_SEQUENCE_EDITOR=\"sed -i '/fix: best-practice-for-text-component/d'\" git rebase -i HEAD~34)",
72
+ "Bash(gh search:*)",
73
+ "Bash(gh repo:*)",
74
+ "Bash(jq)",
75
+ "Bash(find . -name \"package.json\" -not -path \"*/node_modules/*\" -exec grep -l \"smarthr-ui\" {})",
76
+ "Bash(mkdir -p /Users/atsushi.mizoue/works/workflow/michi/frontend/eslint/rules/autofixer-smarthr-ui-migration)",
77
+ "Bash(cp -r /Users/atsushi.mizoue/works/tamatebako/packages/eslint-plugin-smarthr/rules/autofixer-smarthr-ui-migration/* /Users/atsushi.mizoue/works/workflow/michi/frontend/eslint/rules/autofixer-smarthr-ui-migration/)",
78
+ "Bash(pnpm link:*)",
79
+ "Bash(pnpm add:*)",
80
+ "Bash(pnpm run:*)",
81
+ "Bash(pnpm view:*)",
82
+ "Bash(pnpm exec:*)",
83
+ "Bash(pnpm list:*)",
84
+ "Bash(find /Users/atsushi.mizoue/works/workflow/michi/frontend/node_modules/.pnpm -name eslint-plugin-smarthr* -type d)",
85
+ "Bash(ls -la /Users/atsushi.mizoue/works/workflow/michi/frontend/node_modules/.pnpm/eslint-config-smarthr@13.10.0_*/node_modules/)",
86
+ "Read(//Users/atsushi.mizoue/works/workflow/**)",
87
+ "Bash(rm -rf pnpm-lock.yaml node_modules/.pnpm)",
88
+ "Bash(ls:*)",
89
+ "Bash(xargs curl:*)",
90
+ "Bash(xargs -I {} gh api repos/kufu/smarthr-ui/contents/packages/smarthr-ui/src/components/Dialog/ActionDialog/ActionDialogContentInner.tsx?ref={} --jq '.content')",
91
+ "Bash(npm view:*)",
92
+ "Bash(gh run:*)",
93
+ "Bash(xargs -I {} gh api repos/kufu/tamatebako/contents/packages/eslint-plugin-smarthr/CHANGELOG.md?ref={} --jq '.content')",
94
+ "Bash(/tmp/new-return-body.js:*)",
95
+ "Bash(git rm:*)",
96
+ "Bash(gh release:*)",
97
+ "Bash(ls -la /Users/atsushi.mizoue/works/workflow/kago/frontend/src/app/\\\\\\(private\\\\\\)/settings/user_roles/_components/UserRolesPage/UserRoleTable/)",
98
+ "Bash(ls -la \"/Users/atsushi.mizoue/works/workflow/kago/frontend/src/app/\\(private\\)/settings/user_roles/_components/UserRolesPage/UserRoleTable/DeleteUserRoleDialog/\")",
99
+ "Bash(tee /tmp/eslint-test-output.txt)",
100
+ "Bash(find /Users/atsushi.mizoue/works/workflow/kago/frontend/src -type d -name \"*\\(*\")",
101
+ "Bash(test -d \"/Users/atsushi.mizoue/works/workflow/kago/frontend/src/app/\\(private\\)/settings/user_roles/_components/AddUserRoleDialog/hooks/useUsers\")",
102
+ "Bash(pkill -f eslint)",
103
+ "Bash(npx eslint:*)",
104
+ "Bash(/tmp/pr-body.md:*)",
105
+ "Bash(pkill -9 -f eslint)",
106
+ "Bash(rm -rf .eslintcache node_modules/.cache)",
107
+ "Bash(pnpm remove:*)",
108
+ "Bash(find test:*)",
109
+ "Bash(git clean:*)",
110
+ "Bash(open \"https://github.com/kufu/tamatebako/pull/1244\")",
111
+ "Bash(test-multiple-barrels.tsx:*)",
112
+ "Bash(src/test-multiple-barrels.tsx:*)",
113
+ "Bash(src/components/test-multiple-barrels.tsx:*)",
114
+ "Bash(src/components/pages/routes/route/edit/_components/test-multiple-barrels.tsx:*)",
115
+ "Bash(src/app/test-both-barrels.tsx:*)",
116
+ "Bash(pnpm release:*)",
117
+ "Bash(npm whoami:*)",
118
+ "Bash(for pr:*)",
119
+ "Bash(npx lerna:*)",
120
+ "Bash(npm login:*)",
121
+ "Bash(curl -s https://raw.githubusercontent.com/kufu/smarthr-ui/main/CHANGELOG.md)"
122
+ ]
123
+ }
124
+ }
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
+ ## [6.12.1](https://github.com/kufu/tamatebako/compare/eslint-plugin-smarthr-v6.12.0...eslint-plugin-smarthr-v6.12.1) (2026-04-19)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **v91-to-v92:** button/anchorButton系変種コンポーネントのsize属性変換に対応 ([#1251](https://github.com/kufu/tamatebako/issues/1251)) ([14335be](https://github.com/kufu/tamatebako/commit/14335bef82fa38ebe04b0b16fda5e5cd06165cae))
11
+
5
12
  ## [6.12.0](https://github.com/kufu/tamatebako/compare/eslint-plugin-smarthr-v6.11.0...eslint-plugin-smarthr-v6.12.0) (2026-04-15)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-smarthr",
3
- "version": "6.12.0",
3
+ "version": "6.12.1",
4
4
  "author": "SmartHR",
5
5
  "license": "MIT",
6
6
  "description": "A sharable ESLint plugin for SmartHR",
@@ -34,5 +34,5 @@
34
34
  "eslintplugin",
35
35
  "smarthr"
36
36
  ],
37
- "gitHead": "ae65de908cf0b81ad201a18e376bb500a9bd7842"
37
+ "gitHead": "3b8ac2fc343826a86b14d05ffc9400c417ce3814"
38
38
  }
@@ -39,18 +39,18 @@ const SIZE_VALUE_MAP = {
39
39
  m: 'M',
40
40
  }
41
41
 
42
- // サイズ指定を持つコンポーネント
43
- const SIZE_COMPONENTS = [
44
- 'Button',
45
- 'AnchorButton',
46
- 'Select',
47
- 'SegmentedControl',
48
- 'SideNav',
49
- 'SideNavItemButton',
50
- 'SideNavItemAnchor',
51
- 'InputFile',
52
- 'Loader',
53
- 'LoaderSpinner',
42
+ // サイズ指定を持つコンポーネント(正規表現パターン)
43
+ const SIZE_COMPONENT_PATTERNS = [
44
+ /Button$/, // XxxxButton (例: Button, PrimaryButton, DangerButton)
45
+ /AnchorButton$/, // XxxxAnchorButton (例: AnchorButton, PrimaryAnchorButton, DangerAnchorButton)
46
+ /^Select$/,
47
+ /^SegmentedControl$/,
48
+ /^SideNav$/,
49
+ /^SideNavItemButton$/,
50
+ /^SideNavItemAnchor$/,
51
+ /^InputFile$/,
52
+ /^Loader$/,
53
+ /^LoaderSpinner$/,
54
54
  ]
55
55
 
56
56
  // 3. decorators属性を持つコンポーネント
@@ -285,8 +285,9 @@ module.exports = {
285
285
  'JSXAttribute[name.name="size"][value.type="Literal"]'(node) {
286
286
  const componentName = node.parent.name.name
287
287
 
288
- // 対象コンポーネントかチェック
289
- if (!SIZE_COMPONENTS.includes(componentName)) return
288
+ // 対象コンポーネントかチェック(正規表現パターンマッチング)
289
+ const isTargetComponent = SIZE_COMPONENT_PATTERNS.some(pattern => pattern.test(componentName))
290
+ if (!isTargetComponent) return
290
291
 
291
292
  const sizeValue = node.value.value
292
293
  const newValue = SIZE_VALUE_MAP[sizeValue]
@@ -59,8 +59,7 @@ module.exports = {
59
59
  { code: `<Button />`, options: v91ToV92Options },
60
60
  { code: `<Button size={dynamicSize} />`, options: v91ToV92Options },
61
61
 
62
- // 対象外のコンポーネント
63
- { code: `<CustomButton size="default" />`, options: v91ToV92Options },
62
+ // 対象外のコンポーネント(Buttonサフィックスを持たないもの)
64
63
  { code: `<Text size="s" />`, options: v91ToV92Options },
65
64
 
66
65
  // smarthrUiAliasオプション: aliasファイル外では置換しない
@@ -176,6 +175,20 @@ const handleAction: ComponentPropsWithoutRef<typeof FormDialog>['onClickClose']
176
175
  createSizeConversionTest('Button', 's', 'S'),
177
176
  createSizeConversionTest('AnchorButton', 'default', 'M'),
178
177
 
178
+ // Button variants
179
+ createSizeConversionTest('PrimaryButton', 's', 'S'),
180
+ createSizeConversionTest('PrimaryButton', 'default', 'M'),
181
+ createSizeConversionTest('DangerButton', 's', 'S'),
182
+ createSizeConversionTest('SkeletonButton', 's', 'S'),
183
+ createSizeConversionTest('TextButton', 's', 'S'),
184
+
185
+ // AnchorButton variants
186
+ createSizeConversionTest('PrimaryAnchorButton', 's', 'S'),
187
+ createSizeConversionTest('PrimaryAnchorButton', 'default', 'M'),
188
+ createSizeConversionTest('DangerAnchorButton', 's', 'S'),
189
+ createSizeConversionTest('SkeletonAnchorButton', 's', 'S'),
190
+ createSizeConversionTest('TextAnchorButton', 's', 'S'),
191
+
179
192
  // Select
180
193
  createSizeConversionTest('Select', 's', 'S'),
181
194
  createSizeConversionTest('Select', 'm', 'M'),