eslint-plugin-smarthr 1.10.0 → 1.11.0
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
|
+
## [1.11.0](https://github.com/kufu/tamatebako/compare/eslint-plugin-smarthr-v1.10.0...eslint-plugin-smarthr-v1.11.0) (2025-10-01)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* a11y-input-in-form-controlのaria-label,aria-labelledbyが設定されている場合、FormControlでラップしなくてもよしとする ([#795](https://github.com/kufu/tamatebako/issues/795)) ([443892f](https://github.com/kufu/tamatebako/commit/443892ffb39732157d77a179484da3f529e43885))
|
|
11
|
+
|
|
5
12
|
## [1.10.0](https://github.com/kufu/tamatebako/compare/eslint-plugin-smarthr-v1.9.0...eslint-plugin-smarthr-v1.10.0) (2025-10-01)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-smarthr",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"author": "SmartHR",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A sharable ESLint plugin for SmartHR",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"eslintplugin",
|
|
38
38
|
"smarthr"
|
|
39
39
|
],
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "5877e7cf1fee3324112f56f65c5aa2f753dd2aca"
|
|
41
41
|
}
|
|
@@ -77,8 +77,11 @@ module.exports = {
|
|
|
77
77
|
for (const i of node.attributes) {
|
|
78
78
|
if (i.name) {
|
|
79
79
|
// HINT: idが設定されている場合、htmlForでlabelと紐づく可能性が高いため無視する
|
|
80
|
+
// aria-label, aria-labelledbyが設定されている場合は疑似ラベルが設定されているため許容する
|
|
80
81
|
switch (i.name.name) {
|
|
81
82
|
case 'id':
|
|
83
|
+
case 'aria-label':
|
|
84
|
+
case 'aria-labelledby':
|
|
82
85
|
isPseudoLabel = true
|
|
83
86
|
break
|
|
84
87
|
case 'type':
|
|
@@ -111,6 +111,8 @@ ruleTester.run('a11y-input-in-form-control', rule, {
|
|
|
111
111
|
{ code: '<Fieldset><HogeCheckBoxs /></Fieldset>' },
|
|
112
112
|
{ code: '<Fieldset><HogeCheckBoxes /></Fieldset>' },
|
|
113
113
|
{ code: '<HogeFormControl>{ dateInput ? <DateInput /> : <Input /> }</HogeFormControl>'},
|
|
114
|
+
{ code: '<Input aria-label="hoge" />' },
|
|
115
|
+
{ code: '<Select aria-labelledby="hoge" />' },
|
|
114
116
|
],
|
|
115
117
|
invalid: [
|
|
116
118
|
{ code: `<input />`, errors: [ { message: noLabeledInput('input') } ] },
|