eslint-plugin-smarthr 0.5.4 → 0.5.6
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 +14 -0
- package/package.json +1 -1
- package/rules/a11y-heading-in-sectioning-content/index.js +2 -2
- package/rules/best-practice-for-layouts/index.js +1 -0
- package/test/a11y-anchor-has-href-attribute.js +1 -1
- package/test/a11y-clickable-element-has-text.js +1 -1
- package/test/a11y-delegate-element-has-role-presantation.js +1 -1
- package/test/a11y-form-control-in-form.js +1 -1
- package/test/a11y-heading-in-sectioning-content.js +1 -1
- package/test/a11y-image-has-alt-attribute.js +1 -1
- package/test/a11y-input-has-name-attribute.js +1 -1
- package/test/a11y-input-in-form-control.js +1 -1
- package/test/a11y-numbered-text-within-ol.js +1 -1
- package/test/a11y-prohhibit-input-placeholder.js +1 -1
- package/test/a11y-prohibit-useless-sectioning-fragment.js +1 -1
- package/test/a11y-trigger-has-button.js +1 -1
- package/test/best-practice-for-button-element.js +1 -1
- package/test/best-practice-for-date.js +1 -1
- package/test/best-practice-for-layouts.js +4 -1
- package/test/best-practice-for-remote-trigger-dialog.js +1 -1
- package/test/format-translate-component.js +1 -1
- package/test/prohibit-file-name.js +1 -1
- package/test/prohibit-import.js +1 -1
- package/test/prohibit-path-within-template-literal.js +1 -1
- package/test/require-declaration.js +1 -1
- package/test/require-export.js +1 -1
- package/test/require-import.js +1 -1
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
|
+
### [0.5.6](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.5.5...v0.5.6) (2024-03-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* best-practice-for-layoutsで "a?.map(function)" のようにchainを使っている場合正しく検知できなかった問題を修正 ([#131](https://github.com/kufu/eslint-plugin-smarthr/issues/131)) ([80da1ca](https://github.com/kufu/eslint-plugin-smarthr/commit/80da1caa3d9b8cf9e3fc9d9cfd3f1b0e28be9e29))
|
|
11
|
+
|
|
12
|
+
### [0.5.5](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.5.4...v0.5.5) (2024-03-29)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* a11y-heading-in-sectioning-contentでHeadingコンポーネントにtag属性を変数で設定した場合、jsエラーが起きるバグを修正 ([#130](https://github.com/kufu/eslint-plugin-smarthr/issues/130)) ([f927ecd](https://github.com/kufu/eslint-plugin-smarthr/commit/f927ecd80245f6976de9b561c07229cf3038f121))
|
|
18
|
+
|
|
5
19
|
### [0.5.4](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.5.3...v0.5.4) (2024-03-29)
|
|
6
20
|
|
|
7
21
|
|
package/package.json
CHANGED
|
@@ -193,7 +193,7 @@ const searchChildren = (n) => {
|
|
|
193
193
|
} else if (
|
|
194
194
|
(
|
|
195
195
|
headingRegex.test(name) &&
|
|
196
|
-
!n.openingElement.attributes.find(findTagAttr)?.value.value
|
|
196
|
+
!n.openingElement.attributes.find(findTagAttr)?.value.value?.match(noHeadingTagNamesRegex)
|
|
197
197
|
) ||
|
|
198
198
|
forInSearchChildren(n.openingElement.attributes)
|
|
199
199
|
) {
|
|
@@ -253,7 +253,7 @@ module.exports = {
|
|
|
253
253
|
} else if (headingRegex.test(elementName)) {
|
|
254
254
|
const tagAttr = node.attributes.find(findTagAttr)
|
|
255
255
|
|
|
256
|
-
if (!tagAttr?.value.value
|
|
256
|
+
if (!tagAttr?.value.value?.match(noHeadingTagNamesRegex)) {
|
|
257
257
|
const result = searchBubbleUp(node.parent)
|
|
258
258
|
let hit = false
|
|
259
259
|
|
|
@@ -3,7 +3,7 @@ const RuleTester = require('eslint').RuleTester
|
|
|
3
3
|
|
|
4
4
|
const ruleTester = new RuleTester({
|
|
5
5
|
parserOptions: {
|
|
6
|
-
ecmaVersion:
|
|
6
|
+
ecmaVersion: 12,
|
|
7
7
|
ecmaFeatures: {
|
|
8
8
|
experimentalObjectRestSpread: true,
|
|
9
9
|
jsx: true,
|
|
@@ -29,6 +29,9 @@ ruleTester.run('best-practice-for-button-element', rule, {
|
|
|
29
29
|
{ code: `<Stack><Hoge /><Hoge /></Stack>` },
|
|
30
30
|
{ code: `<Stack>{a}<Hoge /></Stack>` },
|
|
31
31
|
{ code: `<AnyStack>{a.map(action)}</AnyStack>` },
|
|
32
|
+
{ code: `<AnyStack>{a?.map(action)}</AnyStack>` },
|
|
33
|
+
{ code: `<AnyStack>{a.b?.map(action)}</AnyStack>` },
|
|
34
|
+
{ code: `<AnyStack>{a?.b?.map(action)}</AnyStack>` },
|
|
32
35
|
{ code: `<AnyStack>{a && <><Hoge /><Hoge /></>}</AnyStack>` },
|
|
33
36
|
{ code: `<AnyStack>{a && a.map(action)}</AnyStack>` },
|
|
34
37
|
{ code: `<AnyStack>{a && a.b.map(action)}</AnyStack>` },
|
package/test/prohibit-import.js
CHANGED
package/test/require-export.js
CHANGED