eslint-plugin-smarthr 2.4.0 → 3.0.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 +23 -0
- package/README.md +0 -1
- package/package.json +2 -2
- package/rules/a11y-anchor-has-href-attribute/index.js +1 -0
- package/rules/a11y-clickable-element-has-text/index.js +1 -0
- package/rules/a11y-delegate-element-has-role-presentation/index.js +2 -0
- package/rules/a11y-form-control-in-form/index.js +1 -0
- package/rules/a11y-heading-in-sectioning-content/README.md +16 -1
- package/rules/a11y-heading-in-sectioning-content/index.js +7 -2
- package/rules/a11y-help-link-with-support-href/index.js +2 -1
- package/rules/a11y-image-has-alt-attribute/index.js +2 -0
- package/rules/a11y-input-has-name-attribute/index.js +6 -3
- package/rules/a11y-input-in-form-control/index.js +11 -4
- package/rules/a11y-numbered-text-within-ol/index.js +5 -0
- package/rules/a11y-prohibit-checkbox-or-radio-in-table-cell/index.js +2 -1
- package/rules/a11y-prohibit-input-maxlength-attribute/index.js +5 -4
- package/rules/a11y-prohibit-input-placeholder/index.js +7 -3
- package/rules/a11y-prohibit-sectioning-content-in-form/index.js +2 -0
- package/rules/a11y-prohibit-useless-sectioning-fragment/index.js +2 -1
- package/rules/a11y-trigger-has-button/index.js +4 -2
- package/rules/best-practice-for-async-current-target/index.js +2 -2
- package/rules/best-practice-for-button-element/index.js +1 -0
- package/rules/best-practice-for-data-test-attribute/index.js +1 -0
- package/rules/best-practice-for-date/index.js +2 -0
- package/rules/best-practice-for-layouts/index.js +22 -10
- package/rules/best-practice-for-nested-attributes-array-index/index.js +1 -0
- package/rules/best-practice-for-remote-trigger-dialog/index.js +2 -1
- package/rules/best-practice-for-tailwind-prohibit-root-margin/index.js +2 -1
- package/rules/best-practice-for-tailwind-variants/index.js +6 -3
- package/rules/component-name/README.md +11 -3
- package/rules/component-name/index.js +7 -2
- package/rules/design-system-guideline-prohibit-double-icons/index.js +1 -0
- package/rules/format-import-path/index.js +2 -1
- package/rules/jsx-start-with-spread-attributes/index.js +2 -1
- package/rules/no-import-other-domain/index.js +2 -1
- package/rules/prohibit-export-array-type/index.js +1 -0
- package/rules/prohibit-file-name/index.js +2 -1
- package/rules/prohibit-import/index.js +4 -2
- package/rules/prohibit-path-within-template-literal/index.js +2 -1
- package/rules/require-barrel-import/index.js +2 -1
- package/rules/require-declaration/index.js +4 -2
- package/rules/require-export/index.js +2 -1
- package/rules/require-i18n-text/index.js +28 -20
- package/rules/require-import/index.js +2 -1
- package/rules/trim-props/index.js +2 -1
- package/test/a11y-anchor-has-href-attribute.js +1 -0
- package/test/a11y-clickable-element-has-text.js +1 -0
- package/test/a11y-delegate-element-has-role-presentation.js +2 -0
- package/test/a11y-form-control-in-form.js +1 -0
- package/test/a11y-heading-in-sectioning-content.js +7 -2
- package/test/a11y-help-link-with-support-href.js +2 -1
- package/test/a11y-image-has-alt-attribute.js +2 -0
- package/test/a11y-input-has-name-attribute.js +30 -15
- package/test/a11y-input-in-form-control.js +15 -1
- package/test/a11y-numbered-text-within-ol.js +29 -0
- package/test/a11y-prohhibit-input-placeholder.js +19 -9
- package/test/a11y-prohibit-checkbox-or-radio-in-table-cell.js +21 -11
- package/test/a11y-prohibit-input-maxlength-attribute.js +5 -4
- package/test/a11y-prohibit-useless-sectioning-fragment.js +2 -1
- package/test/a11y-trigger-has-button.js +12 -6
- package/test/best-practice-for-async-current-target.js +2 -2
- package/test/best-practice-for-button-element.js +2 -0
- package/test/best-practice-for-data-test-attribute.js +1 -0
- package/test/best-practice-for-date.js +2 -0
- package/test/best-practice-for-layouts.js +26 -12
- package/test/best-practice-for-nested-attributes-array-index.js +1 -0
- package/test/best-practice-for-remote-trigger-dialog.js +6 -3
- package/test/best-practice-for-tailwind-prohibit-root-margin.js +2 -2
- package/test/best-practice-for-tailwind-variants.js +8 -4
- package/test/component-name.js +7 -2
- package/test/design-system-guideline-prohibit-double-icons.js +1 -0
- package/test/prohibit-file-name.js +4 -2
- package/test/prohibit-import.js +14 -7
- package/test/prohibit-path-within-template-literal.js +4 -2
- package/test/require-declaration.js +11 -5
- package/test/require-export.js +6 -3
- package/test/require-i18n-text.js +20 -3
- package/test/require-import.js +13 -7
- package/test/trim-props.js +18 -15
- package/rules/a11y-required-layout-as-attribute/README.md +0 -54
- package/rules/a11y-required-layout-as-attribute/index.js +0 -65
- package/test/a11y-required-layout-as-attribute.js +0 -34
|
@@ -11,6 +11,7 @@ const ruleTester = new RuleTester({
|
|
|
11
11
|
},
|
|
12
12
|
})
|
|
13
13
|
const errorMessage = (type, name) => `${name}には子要素が一つしか無いため、${type}でマークアップする意味がありません。
|
|
14
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts
|
|
14
15
|
- styleを確認し、div・spanなど、別要素でマークアップし直すか、${name}を削除してください
|
|
15
16
|
- as, forwardedAsなどでSectioningContent系要素に変更している場合、対応するsmarthr-ui/Section, Aside, Nav, Article のいずれかに差し替えてください`
|
|
16
17
|
|
|
@@ -89,6 +90,7 @@ ruleTester.run('best-practice-for-button-element', rule, {
|
|
|
89
90
|
{ code: `<AnyCluster>{a ? <Hoge /> : a.b.hoge(action)}</AnyCluster>`, errors: [ { message: errorMessage('Cluster', 'AnyCluster') } ] },
|
|
90
91
|
{ code: `<AnyCluster>{a ? <Hoge /> : a ? <Hoge /> : a.b.hoge(action)}</AnyCluster>`, errors: [ { message: errorMessage('Cluster', 'AnyCluster') } ] },
|
|
91
92
|
{ code: `<HogeStack gap={0}>{a}{b}</HogeStack>`, errors: [ { message: `HogeStack に "gap={0}" が指定されており、smarthr-ui/Stack の利用方法として誤っている可能性があります。以下の修正方法を検討してください。
|
|
93
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts
|
|
92
94
|
- 方法1: 子要素を一つにまとめられないか検討してください
|
|
93
95
|
- 例: "<Stack gap={0}><p>hoge</p><p>fuga</p></Stack>" を "<p>hoge<br />fuga</p>" にするなど
|
|
94
96
|
- 方法2: 子要素のstyleを確認しgap属性を0以外にできないか検討してください
|
|
@@ -96,18 +98,30 @@ ruleTester.run('best-practice-for-button-element', rule, {
|
|
|
96
98
|
- 方法3: 別要素でマークアップし直すか、HogeStackを削除してください
|
|
97
99
|
- 親要素に smarthr-ui/Cluster, smarthr-ui/Stack などが存在している場合、div・spanなどで1要素にまとめる必要がある場合があります
|
|
98
100
|
- as, forwardedAsなどでSectioningContent系要素に変更している場合、対応するsmarthr-ui/Section, Aside, Nav, Article のいずれかに差し替えてください` } ] },
|
|
99
|
-
{ code: `<Heading><Cluster><Hoge /><Fuga /></Cluster></Heading>`, errors: [ { message: `Headingの子孫にClusterを置くことはできません。Headingの外でCluster
|
|
100
|
-
|
|
101
|
-
{ code: `<
|
|
102
|
-
|
|
103
|
-
{ code: `<
|
|
104
|
-
|
|
105
|
-
{ code: `<
|
|
106
|
-
|
|
107
|
-
{ code: `<
|
|
108
|
-
|
|
109
|
-
{ code: `<
|
|
110
|
-
|
|
101
|
+
{ code: `<Heading><Cluster><Hoge /><Fuga /></Cluster></Heading>`, errors: [ { message: `Headingの子孫にClusterを置くことはできません。Headingの外でClusterを使用するようにマークアップを修正してください。
|
|
102
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
103
|
+
{ code: `<AnyHeading><AnyStack><Hoge /><Fuga /></AnyStack></AnyHeading>`, errors: [ { message: `Headingの子孫にStackを置く場合、as属性、もしくはforwardedAs属性に \`span\` を指定してください
|
|
104
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
105
|
+
{ code: `<Heading><AnyIcon text="hoge" /></Heading>`, errors: [ { message: `HeadingにIconを設定する場合 <Heading icon={<XxxIcon />}></Heading> のようにicon属性を利用してください
|
|
106
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
107
|
+
{ code: `<AnyHeading><Text prefixIcon={<SomeIcon />}>hoge</Text></AnyHeading>`, errors: [ { message: `HeadingにIconを設定する場合 <Heading icon={<XxxIcon />}></Heading> のようにicon属性を利用してください
|
|
108
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
109
|
+
{ code: `<AnyFormControl label={{ text: <Cluster><Hoge /><Fuga /></Cluster> }} />`, errors: [ { message: `FormControlのlabel属性にClusterを置くことはできません。ラベル用テキスト以外をstatusLabels、subActionArea、もしくはlabel属性のObjectとして '{ text: テキスト, icon: <XxxIcon /> }'に置き換えてください。
|
|
110
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
111
|
+
{ code: `<FormControl label={<AnyStack><Hoge /><Fuga /></AnyStack>} />`, errors: [ { message: `FormControlのlabel属性にStackを置く場合、as属性、もしくはforwardedAs属性に \`span\` を指定してください
|
|
112
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
113
|
+
{ code: `<AnyFormControl label={{ text: <AnyIcon text="hoge" /> }} />`, errors: [ { message: `FormControlのlabel属性にアイコンを設定する場合 <FormControl label={{ text: 'テキスト', icon: <XxxIcon /> }} /> のようにlabel.icon属性を利用してください
|
|
114
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
115
|
+
{ code: `<FormControl label={{ text: <Text prefixIcon={<SomeIcon /> }>hoge</Text>}} />`, errors: [ { message: `FormControlのlabel属性にアイコンを設定する場合 <FormControl label={{ text: 'テキスト', icon: <XxxIcon /> }} /> のようにlabel.icon属性を利用してください
|
|
116
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
117
|
+
{ code: `<Fieldset legend={<Cluster><Hoge /><Fuga /></Cluster>} />`, errors: [ { message: `Fieldsetのlegend属性にClusterを置くことはできません。ラベル用テキスト以外をstatusLabels、subActionArea、もしくはlabel属性のObjectとして '{ text: テキスト, icon: <XxxIcon /> }'に置き換えてください。
|
|
118
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
119
|
+
{ code: `<AnyFieldset legend={{ text: <AnyStack><Hoge /><Fuga /></AnyStack> }} />`, errors: [ { message: `Fieldsetのlegend属性にStackを置く場合、as属性、もしくはforwardedAs属性に \`span\` を指定してください
|
|
120
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
121
|
+
{ code: `<Fieldset legend={<AnyIcon text="hoge" />} />`, errors: [ { message: `Fieldsetのlegend属性にアイコンを設定する場合 <Fieldset legend={{ text: 'テキスト', icon: <XxxIcon /> }} /> のようにlegend.icon属性を利用してください
|
|
122
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
123
|
+
{ code: `<AnyFieldset legend={{ text: <Text prefixIcon={<SomeIcon />}>hoge</Text>}} />`, errors: [ { message: `Fieldsetのlegend属性にアイコンを設定する場合 <Fieldset legend={{ text: 'テキスト', icon: <XxxIcon /> }} /> のようにlegend.icon属性を利用してください
|
|
124
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-layouts` } ] },
|
|
111
125
|
]
|
|
112
126
|
})
|
|
113
127
|
|
|
@@ -12,6 +12,7 @@ const ruleTester = new RuleTester({
|
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
const ERROR_MESSAGE = `入力要素のname属性に対して、配列に当たる部分の連番を指定しない場合(例: a[xxx][][yyy] )、配列内アイテムの属性が意図せず入れ替わってしまう場合がありえるため、常にindexを設定してください。
|
|
15
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-nested-attributes-array-index
|
|
15
16
|
- 例のyyyに当たる値が配列内の別アイテムに紐づいてしまう場合があります。
|
|
16
17
|
- 詳しくは https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-nested-attributes-array-index を参照してください`
|
|
17
18
|
|
|
@@ -19,10 +19,13 @@ ruleTester.run('best-practice-for-remote-trigger-dialog', rule, {
|
|
|
19
19
|
],
|
|
20
20
|
invalid: [
|
|
21
21
|
{ code: '<RemoteDialogTrigger targetId={hoge}>open.</RemoteDialogTrigger>', errors: [ { message: `RemoteDialogTriggerのtargetId属性には直接文字列を指定してください。
|
|
22
|
-
|
|
22
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-remote-trigger-dialog
|
|
23
|
+
- 変数などは利用できません(これは関連するTriggerとDialogを検索しやすくするためです)` } ] },
|
|
23
24
|
{ code: '<StyledRemoteDialogTrigger targetId={"fuga"}>open.</StyledRemoteDialogTrigger>', errors: [ { message: `StyledRemoteDialogTriggerのtargetId属性には直接文字列を指定してください。
|
|
24
|
-
|
|
25
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-remote-trigger-dialog
|
|
26
|
+
- 変数などは利用できません(これは関連するTriggerとDialogを検索しやすくするためです)` } ] },
|
|
25
27
|
{ code: '<StyldRemoteTriggerActionDialog {...args} id={"fuga"}>content.</StyldRemoteTriggerActionDialog>', errors: [ { message: `StyldRemoteTriggerActionDialogのid属性には直接文字列を指定してください。
|
|
26
|
-
|
|
28
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-remote-trigger-dialog
|
|
29
|
+
- 変数などは利用できません(これは関連するTriggerとDialogを検索しやすくするためです)` } ] },
|
|
27
30
|
]
|
|
28
31
|
})
|
|
@@ -11,8 +11,8 @@ const ruleTester = new RuleTester({
|
|
|
11
11
|
},
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
const errorMessage =
|
|
15
|
-
|
|
14
|
+
const errorMessage = `コンポーネントのルート要素に外側への余白(margin)を設定しないでください。外側の余白は使用する側で制御するべきです。
|
|
15
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-tailwind-prohibit-root-margin`
|
|
16
16
|
|
|
17
17
|
ruleTester.run('best-practice-for-tailwind-prohibit-root-margin', rule, {
|
|
18
18
|
valid: [
|
|
@@ -21,9 +21,13 @@ ruleTester.run('best-practice-for-button-element', rule, {
|
|
|
21
21
|
{ code: `const xxx = useMemo(() => hogeClassNameGenerator(), [])` },
|
|
22
22
|
],
|
|
23
23
|
invalid: [
|
|
24
|
-
{ code: `import { tv as hoge } from 'tailwind-variants'`, errors: [ { message: `tailwind-variants をimportする際は、名称が"tv" となるようにしてください。例: "import { tv } from 'tailwind-variants'"
|
|
25
|
-
|
|
26
|
-
{ code: `const hoge =
|
|
27
|
-
|
|
24
|
+
{ code: `import { tv as hoge } from 'tailwind-variants'`, errors: [ { message: `tailwind-variants をimportする際は、名称が"tv" となるようにしてください。例: "import { tv } from 'tailwind-variants'"
|
|
25
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-tailwind-variants` } ] },
|
|
26
|
+
{ code: `const hoge = tv()`, errors: [ { message: `tvの実行結果を格納する変数名は "hoge" ではなく "/(C|c)lassNameGenerator$/"にmatchする名称に統一してください。
|
|
27
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-tailwind-variants` } ] },
|
|
28
|
+
{ code: `const hoge = classNameGenerator()`, errors: [ { message: `"classNameGenerator" を実行する際、useMemoでラップし、メモ化してください
|
|
29
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-tailwind-variants` } ] },
|
|
30
|
+
{ code: `const hoge = hogeClassNameGenerator()`, errors: [ { message: `"hogeClassNameGenerator" を実行する際、useMemoでラップし、メモ化してください
|
|
31
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/best-practice-for-tailwind-variants` } ] },
|
|
28
32
|
]
|
|
29
33
|
})
|
package/test/component-name.js
CHANGED
|
@@ -17,16 +17,19 @@ const messageProperName = ({ extended, matcher, sampleMatcher, suffix, base }) =
|
|
|
17
17
|
const actualPrefix = sampleMatcher ? extended.replace(sampleMatcher, '') : (base[0] === base[0].toUpperCase() ? base.replace(matcher, '') : 'Hoge')
|
|
18
18
|
|
|
19
19
|
return `${extended} は ${matcher} にmatchする名前のコンポーネントを拡張することを期待している名称になっています
|
|
20
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/component-name
|
|
20
21
|
- ${extended} の名称の末尾が"${suffix}" という文字列ではない状態にしつつ、"${base}"を継承していることをわかる名称に変更してください
|
|
21
22
|
- もしくは"${base}"を"${extended}"の継承元であることがわかるような${isComponent ? '名称に変更するか、適切な別コンポーネントに差し替えてください' : '適切なタグや別コンポーネントに差し替えてください'}
|
|
22
23
|
- 修正例1: const ${actualPrefix}Xxxx = ${sampleSuffix}
|
|
23
24
|
- 修正例2: const ${actualPrefix}${suffix}Xxxx = ${sampleSuffix}
|
|
24
25
|
- 修正例3: const ${actualPrefix}${suffix} = styled(Xxxx${suffix})`
|
|
25
26
|
}
|
|
26
|
-
const messageInheritance = ({ extended, matcher }) => `${extended}を正規表現 "${matcher}" がmatch
|
|
27
|
+
const messageInheritance = ({ extended, matcher }) => `${extended}を正規表現 "${matcher}" がmatchする名称に変更してください。
|
|
28
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/component-name`
|
|
27
29
|
const messageImportAs = ({ extended, matcher, base }) => `${messageInheritance({ extended, matcher })}
|
|
28
30
|
- ${base}が型の場合、'import type { ${base} as ${extended} }' もしくは 'import { type ${base} as ${extended} }' のように明示的に型であることを宣言してください。名称変更が不要になります`
|
|
29
31
|
const messageExtendSectioningContent = ({ extended, expected }) => `${extended} は smarthr-ui/${expected} をextendすることを期待する名称になっています
|
|
32
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/component-name
|
|
30
33
|
- childrenにHeadingを含まない場合、コンポーネントの名称から"${expected}"を取り除いてください
|
|
31
34
|
- childrenにHeadingを含み、アウトラインの範囲を指定するためのコンポーネントならば、smarthr-ui/${expected}をexendしてください
|
|
32
35
|
- "styled(Xxxx)" 形式の場合、拡張元であるXxxxコンポーネントの名称の末尾に"${expected}"を設定し、そのコンポーネント内でsmarthr-ui/${expected}を利用してください`
|
|
@@ -139,7 +142,8 @@ ruleTester.run('component-name', rule, {
|
|
|
139
142
|
{ code: 'const RemoteTriggerHogeDialog = styled(RemoteTriggerActionDialog)``' },
|
|
140
143
|
],
|
|
141
144
|
invalid: [
|
|
142
|
-
{ code: `import hoge from 'styled-components'`, errors: [ { message: `styled-components をimportする際は、名称が"styled" となるようにしてください。例: "import styled from 'styled-components'"
|
|
145
|
+
{ code: `import hoge from 'styled-components'`, errors: [ { message: `styled-components をimportする際は、名称が"styled" となるようにしてください。例: "import styled from 'styled-components'"
|
|
146
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/component-name` } ] },
|
|
143
147
|
|
|
144
148
|
{ code: `const HogeOrderedFugaList = styled.ul`, errors: [ { message: messageProperName({ extended: 'HogeOrderedFugaList', matcher: /(Ordered(.*)List|^ol)$/, suffix: 'OrderedFugaList', base: 'ul' }) } ] },
|
|
145
149
|
{ code: `const HogeOrderedFugaList = styled(Hoge)`, errors: [ { message: messageProperName({ extended: 'HogeOrderedFugaList', matcher: /(Ordered(.*)List|^ol)$/, suffix: 'OrderedFugaList', base: 'Hoge' }) } ] },
|
|
@@ -244,6 +248,7 @@ ruleTester.run('component-name', rule, {
|
|
|
244
248
|
{ code: 'const Hoge = styled(RemoteDialogTrigger)``', errors: [ { message: messageInheritance({ extended: 'Hoge', matcher: /DialogTrigger$/ }) }, { message: messageInheritance({ extended: 'Hoge', matcher: /RemoteDialogTrigger$/ }) } ] },
|
|
245
249
|
{ code: 'const Fuga = styled(RemoteTriggerActionDialog)``', errors: [ { message: messageInheritance({ extended: 'Fuga', matcher: /RemoteTrigger(.+)Dialog$/ }) } ] },
|
|
246
250
|
{ code: 'const HogeModalFuga = any', errors: [ { message: `コンポーネント名や変数名に"Modal"という名称は使わず、"Dialog"に統一してください
|
|
251
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/component-name
|
|
247
252
|
- Modalとは形容詞であり、かつ"現在の操作から切り離して専用の操作を行わせる" という意味合いを持ちます
|
|
248
253
|
- そのためDialogでなければ正しくない場合がありえます(smarthr-ui/ModelessDialogのように元々の操作も行えるDialogなどが該当)
|
|
249
254
|
- DialogはModalなダイアログ、Modelessなダイアログすべてを含有した名称のため、統一することを推奨しています` } ] },
|
|
@@ -11,6 +11,7 @@ const ruleTester = new RuleTester({
|
|
|
11
11
|
},
|
|
12
12
|
})
|
|
13
13
|
const generateErrorText = (name) => `${name} には prefix と suffix は同時に設定できません。
|
|
14
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/design-system-guideline-prohibit-double-icons
|
|
14
15
|
- どちらにもアイコンをつけられそうな場合は、prefixを優先してください。`
|
|
15
16
|
|
|
16
17
|
ruleTester.run('design-system-guideline-prohibit-double-icons', rule, {
|
|
@@ -32,7 +32,8 @@ ruleTester.run('prohibit-file-name', rule, {
|
|
|
32
32
|
'hoge\.js': 'any message.',
|
|
33
33
|
}
|
|
34
34
|
],
|
|
35
|
-
errors: [{ message:
|
|
35
|
+
errors: [{ message: `any message.
|
|
36
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/prohibit-file-name` }]
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
code: 'const any = "code"',
|
|
@@ -42,7 +43,8 @@ ruleTester.run('prohibit-file-name', rule, {
|
|
|
42
43
|
'(hoge|fuga)\.js': '$1.jsは作成しないで!',
|
|
43
44
|
}
|
|
44
45
|
],
|
|
45
|
-
errors: [{ message:
|
|
46
|
+
errors: [{ message: `hoge.jsは作成しないで!
|
|
47
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/prohibit-file-name` }]
|
|
46
48
|
},
|
|
47
49
|
]
|
|
48
50
|
})
|
package/test/prohibit-import.js
CHANGED
|
@@ -105,7 +105,8 @@ ruleTester.run('prohibit-import', rule, {
|
|
|
105
105
|
},
|
|
106
106
|
}
|
|
107
107
|
],
|
|
108
|
-
errors: [{ message:
|
|
108
|
+
errors: [{ message: `lodash は利用しないでください
|
|
109
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/prohibit-import` }]
|
|
109
110
|
},
|
|
110
111
|
{
|
|
111
112
|
code: `import { isEqual } from 'lodash'`,
|
|
@@ -119,7 +120,8 @@ ruleTester.run('prohibit-import', rule, {
|
|
|
119
120
|
},
|
|
120
121
|
}
|
|
121
122
|
],
|
|
122
|
-
errors: [{ message:
|
|
123
|
+
errors: [{ message: `lodash は利用しないでください
|
|
124
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/prohibit-import` }]
|
|
123
125
|
},
|
|
124
126
|
{
|
|
125
127
|
code: `import { isEqual } from 'lodash'`,
|
|
@@ -133,7 +135,8 @@ ruleTester.run('prohibit-import', rule, {
|
|
|
133
135
|
},
|
|
134
136
|
}
|
|
135
137
|
],
|
|
136
|
-
errors: [{message:
|
|
138
|
+
errors: [{message: `lodash/isEqual は利用しないでください
|
|
139
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/prohibit-import` }]
|
|
137
140
|
},
|
|
138
141
|
{
|
|
139
142
|
code: `import { isEqual } from 'lodash'`,
|
|
@@ -148,7 +151,8 @@ ruleTester.run('prohibit-import', rule, {
|
|
|
148
151
|
},
|
|
149
152
|
}
|
|
150
153
|
],
|
|
151
|
-
errors: [{message:
|
|
154
|
+
errors: [{message: `must not use lodash/isEqual
|
|
155
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/prohibit-import` }]
|
|
152
156
|
},
|
|
153
157
|
{
|
|
154
158
|
code: `import { isEqual } from 'lodash'`,
|
|
@@ -166,7 +170,8 @@ ruleTester.run('prohibit-import', rule, {
|
|
|
166
170
|
},
|
|
167
171
|
}
|
|
168
172
|
],
|
|
169
|
-
errors: [{message:
|
|
173
|
+
errors: [{message: `must not use lodash/isEqual
|
|
174
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/prohibit-import` }]
|
|
170
175
|
},
|
|
171
176
|
{
|
|
172
177
|
code: `import { isEqual } from 'lodash'`,
|
|
@@ -184,7 +189,8 @@ ruleTester.run('prohibit-import', rule, {
|
|
|
184
189
|
},
|
|
185
190
|
}
|
|
186
191
|
],
|
|
187
|
-
errors: [{message:
|
|
192
|
+
errors: [{message: `must not use lodash/isEqual
|
|
193
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/prohibit-import` }]
|
|
188
194
|
},
|
|
189
195
|
{
|
|
190
196
|
code: `import { isEqual } from './module/validator'`,
|
|
@@ -198,7 +204,8 @@ ruleTester.run('prohibit-import', rule, {
|
|
|
198
204
|
},
|
|
199
205
|
}
|
|
200
206
|
],
|
|
201
|
-
errors: [{ message:
|
|
207
|
+
errors: [{ message: `./module/validator/isEqual は利用しないでください
|
|
208
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/prohibit-import` }]
|
|
202
209
|
},
|
|
203
210
|
]
|
|
204
211
|
})
|
|
@@ -22,12 +22,14 @@ ruleTester.run('prohibit-path-within-template-literal', rule, {
|
|
|
22
22
|
invalid: [
|
|
23
23
|
{
|
|
24
24
|
code: '`${path.hoge}`',
|
|
25
|
-
errors: [{ message:
|
|
25
|
+
errors: [{ message: `path.hogeは \`\` で囲まないでください。queryStringを結合するなどのURL生成は path.hoge 内で行います。 (例: path.hoge({ query: { hoge: 'abc' } })
|
|
26
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/prohibit-path-within-template-literal` }]
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
29
|
code: '`${ABC.hoge()}${hogehoge}`',
|
|
29
30
|
options: [{ pathRegex: '^ABC$' }],
|
|
30
|
-
errors: [{ message:
|
|
31
|
+
errors: [{ message: `ABC.hogeは \`\` で囲まないでください。queryStringを結合するなどのURL生成は ABC.hoge 内で行います。 (例: ABC.hoge({ query: { hoge: 'abc' } })
|
|
32
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/prohibit-path-within-template-literal` }]
|
|
31
33
|
},
|
|
32
34
|
]
|
|
33
35
|
})
|
|
@@ -90,7 +90,8 @@ ruleTester.run('format-translate-component', rule, {
|
|
|
90
90
|
},
|
|
91
91
|
}
|
|
92
92
|
],
|
|
93
|
-
errors: [{ message:
|
|
93
|
+
errors: [{ message: `const fugaが宣言されていません
|
|
94
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-declaration` }],
|
|
94
95
|
},
|
|
95
96
|
{
|
|
96
97
|
code: 'const hoge = any',
|
|
@@ -105,7 +106,8 @@ ruleTester.run('format-translate-component', rule, {
|
|
|
105
106
|
},
|
|
106
107
|
}
|
|
107
108
|
],
|
|
108
|
-
errors: [{ message:
|
|
109
|
+
errors: [{ message: `fugaを定義しろ!
|
|
110
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-declaration` }],
|
|
109
111
|
},
|
|
110
112
|
{
|
|
111
113
|
code: 'const hoge = abc',
|
|
@@ -120,7 +122,8 @@ ruleTester.run('format-translate-component', rule, {
|
|
|
120
122
|
},
|
|
121
123
|
}
|
|
122
124
|
],
|
|
123
|
-
errors: [{ message:
|
|
125
|
+
errors: [{ message: `const hoge では fuga を利用してください
|
|
126
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-declaration` }],
|
|
124
127
|
},
|
|
125
128
|
{
|
|
126
129
|
code: 'let hoge = () => undefined',
|
|
@@ -135,7 +138,9 @@ ruleTester.run('format-translate-component', rule, {
|
|
|
135
138
|
},
|
|
136
139
|
}
|
|
137
140
|
],
|
|
138
|
-
errors: [{ message:
|
|
141
|
+
errors: [{ message: `arrow-function hoge では num を利用してください
|
|
142
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-declaration` }, { message: `arrow-function hoge では parseInt(num, 10) を利用してください
|
|
143
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-declaration` }],
|
|
139
144
|
},
|
|
140
145
|
{
|
|
141
146
|
code: 'let hoge = () => undefined',
|
|
@@ -151,7 +156,8 @@ ruleTester.run('format-translate-component', rule, {
|
|
|
151
156
|
},
|
|
152
157
|
}
|
|
153
158
|
],
|
|
154
|
-
errors: [{ message:
|
|
159
|
+
errors: [{ message: `hoge関数は \`const hoge = (num) => { const temp = parseInt(num, 10); /* any code. */ }\` のように定義してください
|
|
160
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-declaration` }],
|
|
155
161
|
},
|
|
156
162
|
]
|
|
157
163
|
})
|
package/test/require-export.js
CHANGED
|
@@ -62,7 +62,8 @@ ruleTester.run('require-export', rule, {
|
|
|
62
62
|
'^.+$': ['fuga'],
|
|
63
63
|
}
|
|
64
64
|
],
|
|
65
|
-
errors: [{ message:
|
|
65
|
+
errors: [{ message: `fuga をexportしてください
|
|
66
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-export` }],
|
|
66
67
|
},
|
|
67
68
|
{
|
|
68
69
|
code: `export const hoge = {}`,
|
|
@@ -71,7 +72,8 @@ ruleTester.run('require-export', rule, {
|
|
|
71
72
|
'^.+$': ['fuga'],
|
|
72
73
|
}
|
|
73
74
|
],
|
|
74
|
-
errors: [{ message:
|
|
75
|
+
errors: [{ message: `fuga をexportしてください
|
|
76
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-export` }],
|
|
75
77
|
},
|
|
76
78
|
{
|
|
77
79
|
code: `const hoge = {}; export { hoge }`,
|
|
@@ -80,7 +82,8 @@ ruleTester.run('require-export', rule, {
|
|
|
80
82
|
'^.+$': ['default'],
|
|
81
83
|
}
|
|
82
84
|
],
|
|
83
|
-
errors: [{ message:
|
|
85
|
+
errors: [{ message: `default をexportしてください
|
|
86
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-export` }],
|
|
84
87
|
},
|
|
85
88
|
]
|
|
86
89
|
})
|
|
@@ -11,9 +11,10 @@ const ruleTester = new RuleTester({
|
|
|
11
11
|
},
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
const attributeError = (element, attr) =>
|
|
15
|
-
|
|
16
|
-
const childTextError =
|
|
14
|
+
const attributeError = (element, attr) => `${element}の${attr}属性に文字列リテラルが指定されています。多言語化対応のため、翻訳関数を使用してください
|
|
15
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-i18n-text`
|
|
16
|
+
const childTextError = `子要素に文字列リテラルが指定されています。多言語化対応のため、翻訳関数を使用してください
|
|
17
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-i18n-text`
|
|
17
18
|
|
|
18
19
|
const options = [
|
|
19
20
|
{
|
|
@@ -53,6 +54,14 @@ ruleTester.run('require-i18n-text', rule, {
|
|
|
53
54
|
{ code: `<img src="image.png" />` },
|
|
54
55
|
{ code: `<div data-testid="test" />` },
|
|
55
56
|
|
|
57
|
+
// 数値のみ、.と演算記号のみの場合は許容
|
|
58
|
+
{ code: `<Any aria-label="1234" />` },
|
|
59
|
+
{ code: `<div>.</div>` },
|
|
60
|
+
{ code: `<a> +</a>` },
|
|
61
|
+
{ code: `<img alt="-" />` },
|
|
62
|
+
{ code: `<i>*</i>` },
|
|
63
|
+
{ code: `<i>/</i>` },
|
|
64
|
+
|
|
56
65
|
// ワイルドカード - 空配列で除外
|
|
57
66
|
{
|
|
58
67
|
code: `<Icon label="Icon text" />`,
|
|
@@ -97,6 +106,14 @@ ruleTester.run('require-i18n-text', rule, {
|
|
|
97
106
|
errors: [{ message: attributeError('button', 'title') }],
|
|
98
107
|
},
|
|
99
108
|
|
|
109
|
+
// 数値、.と演算記号の場合でも他の文字列が含まれていればエラー
|
|
110
|
+
{ code: `<Any aria-label="1234 あ" />`, errors: [{ message: attributeError('Any', 'aria-label') }] },
|
|
111
|
+
{ code: `<div>a.</div>`, errors: [{ message: childTextError }] },
|
|
112
|
+
{ code: `<a> + b</a>`, errors: [{ message: childTextError }] },
|
|
113
|
+
{ code: `<img alt="-zod" />`, errors: [{ message: attributeError('img', 'alt') }] },
|
|
114
|
+
{ code: `<i>*1</i>`, errors: [{ message: childTextError }] },
|
|
115
|
+
{ code: `<i>a/</i>`, errors: [{ message: childTextError }] },
|
|
116
|
+
|
|
100
117
|
// 属性エラー: カスタムオプション
|
|
101
118
|
{
|
|
102
119
|
code: `<img alt="Profile picture" />`,
|
package/test/require-import.js
CHANGED
|
@@ -66,7 +66,8 @@ ruleTester.run('require-import', rule, {
|
|
|
66
66
|
},
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
|
-
errors: [{ message:
|
|
69
|
+
errors: [{ message: `lodash/isEqual を絶対使ってください
|
|
70
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-import` }],
|
|
70
71
|
},
|
|
71
72
|
{
|
|
72
73
|
code: `import { chunk } from 'lodash'`,
|
|
@@ -108,7 +109,8 @@ ruleTester.run('require-import', rule, {
|
|
|
108
109
|
},
|
|
109
110
|
}
|
|
110
111
|
],
|
|
111
|
-
errors: [{ message:
|
|
112
|
+
errors: [{ message: `lodash をimportしてください
|
|
113
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-import` }],
|
|
112
114
|
},
|
|
113
115
|
{
|
|
114
116
|
code: ``,
|
|
@@ -122,7 +124,8 @@ ruleTester.run('require-import', rule, {
|
|
|
122
124
|
},
|
|
123
125
|
}
|
|
124
126
|
],
|
|
125
|
-
errors: [{ message:
|
|
127
|
+
errors: [{ message: `lodash をimportしてください
|
|
128
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-import` }],
|
|
126
129
|
},
|
|
127
130
|
{
|
|
128
131
|
code: ``,
|
|
@@ -137,7 +140,8 @@ ruleTester.run('require-import', rule, {
|
|
|
137
140
|
},
|
|
138
141
|
}
|
|
139
142
|
],
|
|
140
|
-
errors: [{ message:
|
|
143
|
+
errors: [{ message: `lodash を絶対使ってください
|
|
144
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-import` }],
|
|
141
145
|
},
|
|
142
146
|
{
|
|
143
147
|
code: ``,
|
|
@@ -152,7 +156,8 @@ ruleTester.run('require-import', rule, {
|
|
|
152
156
|
},
|
|
153
157
|
}
|
|
154
158
|
],
|
|
155
|
-
errors: [{ message:
|
|
159
|
+
errors: [{ message: `lodash/isEqual を絶対使ってください
|
|
160
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-import` }],
|
|
156
161
|
},
|
|
157
162
|
{
|
|
158
163
|
code: `import { chunk } from 'lodash'`,
|
|
@@ -167,7 +172,8 @@ ruleTester.run('require-import', rule, {
|
|
|
167
172
|
},
|
|
168
173
|
}
|
|
169
174
|
],
|
|
170
|
-
errors: [{ message:
|
|
175
|
+
errors: [{ message: `lodash/isEqual を絶対使ってください
|
|
176
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/require-import` }],
|
|
171
177
|
},
|
|
172
178
|
{
|
|
173
179
|
code: `import { isEqual } from './module/validator'`,
|
|
@@ -181,7 +187,7 @@ ruleTester.run('require-import', rule, {
|
|
|
181
187
|
},
|
|
182
188
|
}
|
|
183
189
|
],
|
|
184
|
-
errors: [{ message: /module\/validator\/isEqual をimport
|
|
190
|
+
errors: [{ message: /module\/validator\/isEqual をimportしてください/ }],
|
|
185
191
|
},
|
|
186
192
|
]
|
|
187
193
|
})
|
package/test/trim-props.js
CHANGED
|
@@ -11,6 +11,9 @@ const ruleTester = new RuleTester({
|
|
|
11
11
|
},
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
+
const ERROR_MESSAGE = `属性に設定している文字列から先頭、末尾の空白文字を削除してください
|
|
15
|
+
- 詳細: https://github.com/kufu/tamatebako/tree/master/packages/eslint-plugin-smarthr/rules/trim-props`
|
|
16
|
+
|
|
14
17
|
ruleTester.run('trim-props', rule, {
|
|
15
18
|
valid: [
|
|
16
19
|
{ code: '<a href="https://www.google.com">google</a>' },
|
|
@@ -25,73 +28,73 @@ ruleTester.run('trim-props', rule, {
|
|
|
25
28
|
{
|
|
26
29
|
code: '<a href=" https://www.google.com">google</a>',
|
|
27
30
|
output: '<a href="https://www.google.com">google</a>',
|
|
28
|
-
errors: [{ message:
|
|
31
|
+
errors: [{ message: ERROR_MESSAGE }],
|
|
29
32
|
},
|
|
30
33
|
{
|
|
31
34
|
code: '<a href="https://www.google.com ">google</a>',
|
|
32
35
|
output: '<a href="https://www.google.com">google</a>',
|
|
33
|
-
errors: [{ message:
|
|
36
|
+
errors: [{ message: ERROR_MESSAGE }],
|
|
34
37
|
},
|
|
35
38
|
{
|
|
36
39
|
code: '<a href=" https://www.google.com ">google</a>',
|
|
37
40
|
output: '<a href="https://www.google.com">google</a>',
|
|
38
|
-
errors: [{ message:
|
|
41
|
+
errors: [{ message: ERROR_MESSAGE }],
|
|
39
42
|
},
|
|
40
43
|
{
|
|
41
44
|
code: '<a href={" https://www.google.com"}>google</a>',
|
|
42
45
|
output: '<a href={"https://www.google.com"}>google</a>',
|
|
43
|
-
errors: [{ message:
|
|
46
|
+
errors: [{ message: ERROR_MESSAGE }],
|
|
44
47
|
},
|
|
45
48
|
{
|
|
46
49
|
code: '<a href={"https://www.google.com "}>google</a>',
|
|
47
50
|
output: '<a href={"https://www.google.com"}>google</a>',
|
|
48
|
-
errors: [{ message:
|
|
51
|
+
errors: [{ message: ERROR_MESSAGE }],
|
|
49
52
|
},
|
|
50
53
|
{
|
|
51
54
|
code: '<a href={" https://www.google.com "}>google</a>',
|
|
52
55
|
output: '<a href={"https://www.google.com"}>google</a>',
|
|
53
|
-
errors: [{ message:
|
|
56
|
+
errors: [{ message: ERROR_MESSAGE }],
|
|
54
57
|
},
|
|
55
58
|
{
|
|
56
59
|
code: '<img src=" /sample.jpg" alt="sample " />',
|
|
57
60
|
output: '<img src="/sample.jpg" alt="sample" />',
|
|
58
61
|
errors: [
|
|
59
|
-
{ message:
|
|
60
|
-
{ message:
|
|
62
|
+
{ message: ERROR_MESSAGE },
|
|
63
|
+
{ message: ERROR_MESSAGE },
|
|
61
64
|
],
|
|
62
65
|
},
|
|
63
66
|
{
|
|
64
67
|
code: `<img src={' /sample.jpg'} alt={'sample '} />`,
|
|
65
68
|
output: `<img src={'/sample.jpg'} alt={'sample'} />`,
|
|
66
69
|
errors: [
|
|
67
|
-
{ message:
|
|
68
|
-
{ message:
|
|
70
|
+
{ message: ERROR_MESSAGE },
|
|
71
|
+
{ message: ERROR_MESSAGE },
|
|
69
72
|
],
|
|
70
73
|
},
|
|
71
74
|
{
|
|
72
75
|
code: '<div data-spec=" info-area ">....</div>',
|
|
73
76
|
output: '<div data-spec="info-area">....</div>',
|
|
74
|
-
errors: [{ message:
|
|
77
|
+
errors: [{ message: ERROR_MESSAGE }],
|
|
75
78
|
},
|
|
76
79
|
{
|
|
77
80
|
code: '<div data-spec={" info-area "}>....</div>',
|
|
78
81
|
output: '<div data-spec={"info-area"}>....</div>',
|
|
79
|
-
errors: [{ message:
|
|
82
|
+
errors: [{ message: ERROR_MESSAGE }],
|
|
80
83
|
},
|
|
81
84
|
{
|
|
82
85
|
code: '<div data-spec={` ab c `}>....</div>',
|
|
83
86
|
output: '<div data-spec={`ab c`}>....</div>',
|
|
84
|
-
errors: [{ message:
|
|
87
|
+
errors: [{ message: ERROR_MESSAGE }],
|
|
85
88
|
},
|
|
86
89
|
{
|
|
87
90
|
code: '<div data-spec={` a${b} c `}>....</div>',
|
|
88
91
|
output: '<div data-spec={`a${b} c`}>....</div>',
|
|
89
|
-
errors: [{ message:
|
|
92
|
+
errors: [{ message: ERROR_MESSAGE }],
|
|
90
93
|
},
|
|
91
94
|
{
|
|
92
95
|
code: '<div data-spec={` a${b ? ` ${c} ` : " "} d `}>....</div>',
|
|
93
96
|
output: '<div data-spec={`a${b ? ` ${c} ` : " "} d`}>....</div>',
|
|
94
|
-
errors: [{ message:
|
|
97
|
+
errors: [{ message: ERROR_MESSAGE }],
|
|
95
98
|
},
|
|
96
99
|
],
|
|
97
100
|
})
|