Skip to content

Commit 243a23a

Browse files
authored
chore: added enforcing of name components reference (#69)
1 parent b33b21f commit 243a23a

13 files changed

+25
-22
lines changed

.eslintrc.cjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ require('@rushstack/eslint-patch/modern-module-resolution')
44
module.exports = {
55
root: true,
66
extends: [
7-
'plugin:vue/vue3-essential',
87
'plugin:vue/vue3-recommended',
98
'eslint:recommended',
109
'@vue/eslint-config-typescript',
1110
'@vue/eslint-config-prettier/skip-formatting',
1211
'plugin:storybook/recommended'
1312
],
13+
rules: {
14+
"vue/component-name-in-template-casing": ["error"],
15+
},
1416
parserOptions: {
1517
ecmaVersion: 'latest'
1618
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"build": "run-p build-types \"build-only {@}\" --",
4444
"build-only": "vite build",
4545
"build-types": "vue-tsc --declaration --declarationMap --emitDeclarationOnly -p tsconfig.app.json --composite false",
46-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
46+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore",
47+
"lint-fix": "npm run lint -- --fix",
4748
"format": "prettier --write src/",
4849
"storybook": "storybook dev -p 6006",
4950
"build-storybook": "storybook build"

src/components/NeCombobox.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ onClickOutside(comboboxRef, () => onClickOutsideCombobox())
349349
{ 'cursor-not-allowed opacity-50': disabled }
350350
]"
351351
>
352-
<font-awesome-icon :icon="fasChevronDown" class="h-3 w-3 shrink-0" aria-hidden="true" />
352+
<FontAwesomeIcon :icon="fasChevronDown" class="h-3 w-3 shrink-0" aria-hidden="true" />
353353
</ComboboxButton>
354354
<div v-show="open || showOptions">
355355
<ComboboxOptions
@@ -378,7 +378,7 @@ onClickOutside(comboboxRef, () => onClickOutsideCombobox())
378378
>
379379
<div class="flex items-center truncate">
380380
<!-- option icon -->
381-
<font-awesome-icon
381+
<FontAwesomeIcon
382382
v-if="option.icon"
383383
:icon="option.icon"
384384
class="mr-2.5 h-4 w-4 shrink-0"
@@ -403,7 +403,7 @@ onClickOutside(comboboxRef, () => onClickOutsideCombobox())
403403
'absolute inset-y-0 right-0 flex items-center pr-4 text-primary-700 dark:text-primary-500'
404404
]"
405405
>
406-
<font-awesome-icon :icon="fasCheck" class="h-4 w-4 shrink-0" aria-hidden="true" />
406+
<FontAwesomeIcon :icon="fasCheck" class="h-4 w-4 shrink-0" aria-hidden="true" />
407407
</span>
408408
</li>
409409
</ComboboxOption>

src/components/NeDropdown.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ watch(
8282
<slot name="button">
8383
<!-- default kebab button -->
8484
<NeButton class="py-2" kind="tertiary">
85-
<font-awesome-icon
85+
<FontAwesomeIcon
8686
:icon="['fas', 'ellipsis-vertical']"
8787
aria-hidden="true"
8888
class="h-5 w-5 shrink-0"
@@ -125,7 +125,7 @@ watch(
125125
]"
126126
@click="onItemClick(item)"
127127
>
128-
<font-awesome-icon
128+
<FontAwesomeIcon
129129
v-if="item.icon"
130130
:icon="[item.iconStyle || 'fas', item.icon]"
131131
aria-hidden="true"

src/components/NeExpandable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function toggleExpanded() {
5555
<template v-if="!fullWidth">
5656
<NeButton kind="tertiary" size="sm" class="-ml-2">
5757
<template #suffix>
58-
<font-awesome-icon
58+
<FontAwesomeIcon
5959
:icon="internalIsExpanded ? faChevronUp : faChevronDown"
6060
class="h-3 w-3"
6161
aria-hidden="true"
@@ -70,7 +70,7 @@ function toggleExpanded() {
7070
class="flex w-full items-center justify-between rounded border-b border-gray-300 px-2 py-1 text-sm font-medium text-gray-900 hover:bg-gray-200 dark:border-gray-500 dark:text-gray-50 dark:hover:bg-gray-700"
7171
>
7272
<span>{{ label }}</span>
73-
<font-awesome-icon
73+
<FontAwesomeIcon
7474
:icon="internalIsExpanded ? faChevronUp : faChevronDown"
7575
class="h-3 w-3"
7676
aria-hidden="true"

src/components/NeInlineNotification.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const closeIconKindStyle: { [index: string]: string } = {
115115
<div :class="`rounded-md border-l-4 p-4 text-sm ${containerKindStyle[props.kind as string]}`">
116116
<div class="flex">
117117
<div class="flex-shrink-0">
118-
<font-awesome-icon
118+
<FontAwesomeIcon
119119
:class="`h-4 w-4 ${iconKindStyle[props.kind as string]}`"
120120
:icon="iconName[props.kind as string]"
121121
aria-hidden="true"
@@ -149,7 +149,7 @@ const closeIconKindStyle: { [index: string]: string } = {
149149
@click="isExpandedDetails = !isExpandedDetails"
150150
>
151151
<span>{{ showDetailsLabel }}</span>
152-
<font-awesome-icon
152+
<FontAwesomeIcon
153153
:icon="isExpandedDetails ? faChevronUp : faChevronDown"
154154
aria-hidden="true"
155155
class="ml-2 h-3 w-3"
@@ -204,7 +204,7 @@ const closeIconKindStyle: { [index: string]: string } = {
204204
@click="emit('close')"
205205
>
206206
<span class="sr-only">{{ props.closeAriaLabel }}</span>
207-
<font-awesome-icon :icon="faXmark" class="h-4 w-4" aria-hidden="true" />
207+
<FontAwesomeIcon :icon="faXmark" class="h-4 w-4" aria-hidden="true" />
208208
</button>
209209
</div>
210210
</div>

src/components/NeListbox.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ onClickOutside(listboxRef, () => onClickOutsideListbox())
236236
{ 'cursor-not-allowed opacity-50': disabled }
237237
]"
238238
>
239-
<font-awesome-icon :icon="fasChevronDown" class="h-3 w-3 shrink-0" aria-hidden="true" />
239+
<FontAwesomeIcon :icon="fasChevronDown" class="h-3 w-3 shrink-0" aria-hidden="true" />
240240
</div>
241241
</ListboxButton>
242242
<Teleport to="body">
@@ -283,7 +283,7 @@ onClickOutside(listboxRef, () => onClickOutsideListbox())
283283
'absolute inset-y-0 right-0 flex items-center pr-4 text-primary-700 dark:text-primary-500'
284284
]"
285285
>
286-
<font-awesome-icon
286+
<FontAwesomeIcon
287287
:icon="fasCheck"
288288
class="h-4 w-4 shrink-0"
289289
aria-hidden="true"

src/components/NeModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function onSecondaryClick() {
141141
@click="onClose"
142142
>
143143
<span class="sr-only">{{ closeAriaLabel }}</span>
144-
<font-awesome-icon
144+
<FontAwesomeIcon
145145
:icon="['fas', 'xmark']"
146146
class="h-5 w-5"
147147
aria-hidden="true"

src/components/NePaginator.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function navigateToPage(page: number) {
150150
@click="navigateToPage(currentPage - 1)"
151151
>
152152
<span class="sr-only">{{ previousLabel }}</span>
153-
<font-awesome-icon :icon="fasChevronLeft" class="h-3 w-3 shrink-0" aria-hidden="true" />
153+
<FontAwesomeIcon :icon="fasChevronLeft" class="h-3 w-3 shrink-0" aria-hidden="true" />
154154
</button>
155155
</li>
156156
<!-- show all page numbers if there are no more than 8 pages in total -->
@@ -231,7 +231,7 @@ function navigateToPage(page: number) {
231231
@click="navigateToPage(currentPage + 1)"
232232
>
233233
<span class="sr-only">{{ nextLabel }}</span>
234-
<font-awesome-icon
234+
<FontAwesomeIcon
235235
:icon="fasChevronRight"
236236
class="h-3 w-3 shrink-0"
237237
aria-hidden="true"

src/components/NeTextArea.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function emitModelValue(ev: any) {
106106
/>
107107
<!-- invalid icon -->
108108
<div v-if="invalidMessage" class="pointer-events-none absolute inset-y-0 right-0 pr-3 pt-2">
109-
<font-awesome-icon
109+
<FontAwesomeIcon
110110
:icon="['fas', 'circle-exclamation']"
111111
class="h-4 w-4 text-rose-700 dark:text-rose-400"
112112
aria-hidden="true"

src/components/NeTextInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function focus() {
171171
<span class="sr-only">{{
172172
isPasswordVisible ? hidePasswordLabel : showPasswordLabel
173173
}}</span>
174-
<font-awesome-icon
174+
<FontAwesomeIcon
175175
:icon="['fas', isPasswordVisible ? 'eye-slash' : 'eye']"
176176
class="h-4 w-4 text-gray-500 dark:text-gray-400"
177177
aria-hidden="true"
@@ -183,7 +183,7 @@ function focus() {
183183
v-else-if="invalidMessage"
184184
class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3"
185185
>
186-
<font-awesome-icon
186+
<FontAwesomeIcon
187187
:icon="['fas', 'circle-exclamation']"
188188
class="h-4 w-4 text-rose-700 dark:text-rose-400"
189189
aria-hidden="true"

src/components/NeToastNotification.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ library.add(fasXmark)
8080
@click="$emit('close')"
8181
>
8282
<span class="sr-only">{{ srCloseLabel }}</span>
83-
<font-awesome-icon :icon="['fas', 'xmark']" class="h-5 w-5" aria-hidden="true" />
83+
<FontAwesomeIcon :icon="['fas', 'xmark']" class="h-5 w-5" aria-hidden="true" />
8484
</button>
8585
<!-- timestamp -->
8686
<NeTooltip

stories/NeDropdown.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const withSlotTemplate =
9797
<template #button>\
9898
<NeButton>\
9999
<template #suffix>\
100-
<font-awesome-icon :icon="[\'fas\', \'chevron-down\']" class="h-4 w-4" aria-hidden="true" />\
100+
<FontAwesomeIcon :icon="[\'fas\', \'chevron-down\']" class="h-4 w-4" aria-hidden="true" />\
101101
</template>\
102102
Menu\
103103
</NeButton>\

0 commit comments

Comments
 (0)