eslint-plugin-smarthr 0.3.13 → 0.3.14
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
|
+
### [0.3.14](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.3.13...v0.3.14) (2023-11-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* styled-components/attrsメソッドを利用している場合、継承時の名称チェック対象外になっていたため修正 ([#89](https://github.com/kufu/eslint-plugin-smarthr/issues/89)) ([93b72f2](https://github.com/kufu/eslint-plugin-smarthr/commit/93b72f23f0bcc507976793c63955cff13313e79f))
|
|
11
|
+
|
|
5
12
|
### [0.3.13](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.3.12...v0.3.13) (2023-10-16)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -54,6 +54,10 @@ const generateTagFormatter = ({ context, EXPECTED_NAMES, UNEXPECTED_NAMES }) =>
|
|
|
54
54
|
case callee.object?.name:
|
|
55
55
|
base = callee.property.name
|
|
56
56
|
break
|
|
57
|
+
case callee.object?.callee?.name:
|
|
58
|
+
const arg = callee.object.arguments[0]
|
|
59
|
+
base = arg.name || arg.value
|
|
60
|
+
break
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
63
|
|
package/package.json
CHANGED
|
@@ -38,6 +38,7 @@ ruleTester.run('a11y-heading-in-sectioning-content', rule, {
|
|
|
38
38
|
{ code: 'const FugaAside = styled(HogeAside)``' },
|
|
39
39
|
{ code: 'const FugaNav = styled(HogeNav)``' },
|
|
40
40
|
{ code: 'const FugaSection = styled(HogeSection)``' },
|
|
41
|
+
{ code: "const FugaHeading = styled(Heading).attrs(() => ({ type: 'blockTitle' }))``" },
|
|
41
42
|
{ code: '<PageHeading>hoge</PageHeading>' },
|
|
42
43
|
{ code: '<Section><Heading>hoge</Heading></Section>' },
|
|
43
44
|
{ code: '<><Section><Heading>hoge</Heading></Section><Section><Heading>fuga</Heading></Section></>' },
|
|
@@ -54,6 +55,7 @@ ruleTester.run('a11y-heading-in-sectioning-content', rule, {
|
|
|
54
55
|
{ code: 'const Hoge = styled.h6``', errors: [ { message: `Hogeを正規表現 "/Heading$/" がmatchする名称に変更してください` } ] },
|
|
55
56
|
{ code: 'const Fuga = styled(Heading)``', errors: [ { message: `Fugaを正規表現 "/Heading$/" がmatchする名称に変更してください` } ] },
|
|
56
57
|
{ code: 'const Fuga = styled(HogeHeading)``', errors: [ { message: `Fugaを正規表現 "/Heading$/" がmatchする名称に変更してください` } ] },
|
|
58
|
+
{ code: 'const Fuga = styled(HogeHeading).attrs(() => ({ type: "blockTitle" }))``', errors: [ { message: `Fugaを正規表現 "/Heading$/" がmatchする名称に変更してください` } ] },
|
|
57
59
|
{ code: 'const Fuga = styled(HogeArticle)``', errors: [ { message: `Fugaを正規表現 "/Article$/" がmatchする名称に変更してください` } ] },
|
|
58
60
|
{ code: 'const Fuga = styled(HogeAside)``', errors: [ { message: `Fugaを正規表現 "/Aside$/" がmatchする名称に変更してください` } ] },
|
|
59
61
|
{ code: 'const Fuga = styled(HogeNav)``', errors: [ { message: `Fugaを正規表現 "/Nav$/" がmatchする名称に変更してください` } ] },
|