Skip to content

Commit

Permalink
style: fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
viandwi24 committed Nov 1, 2023
1 parent ca565de commit dfefd40
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion app.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { RouteLocationRaw } from 'vue-router'
import { NuxtApp } from '#app'
import {
AwesomeLayoutPageNavbarMenu,
AwesomeLayoutPageNavbarMenuDropdownItem,
} from './types'
import { NuxtApp } from '#app'

export interface NuxtAwesomeAppConfig {
/** title name */
Expand Down
2 changes: 1 addition & 1 deletion app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AppConfigInput } from 'nuxt/schema'
import type { AppConfigInput } from 'nuxt/schema'

export default defineAppConfig({
awesome: {
Expand Down
4 changes: 2 additions & 2 deletions app/pages/setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ const validate = async () => {
// fetch username from github api
try {
const response = await fetch(
`https://api.github.com/users/${username.value}`
`https://api.github.com/users/${username.value}`,
)
if (response.status !== 200) {
throw new Error(
`error when fetching username : ${response.statusText} (${response.status})`
`error when fetching username : ${response.statusText} (${response.status})`,
)
}
const data = (await response.json()) as {
Expand Down
2 changes: 1 addition & 1 deletion components/awesome/Button/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const sizes = reactive<{
})
// state
const selectedStyle = computed(() =>
props.type in styles ? styles[props.type] : styles.primary
props.type in styles ? styles[props.type] : styles.primary,
)
const selectedSize = computed(() => sizes[props.size] || sizes.lg)
// methods
Expand Down
4 changes: 2 additions & 2 deletions components/awesome/Content/Renderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const props = defineProps({
})
const { data } = await useAsyncData(props.path, () =>
queryContent(props.path).findOne()
queryContent(props.path).findOne(),
)
if (!data) abortNavigation('404')
</script>
Expand All @@ -22,7 +22,7 @@ if (!data) abortNavigation('404')
<LayoutPageTitle :text="pageTitle" class="capitalize" />
</LayoutPageHeader>
<LayoutPageSection>
<ContentRenderer :value="(data as any)" />
<ContentRenderer :value="data as any" />
</LayoutPageSection>
</LayoutPageWrapper>
</template>
10 changes: 5 additions & 5 deletions components/awesome/Form/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ const modelValue = useSyncProps<string>(props, 'modelValue', emit)
const havePreEl = computed(
() =>
typeof slots.prefix !== 'undefined' ||
typeof slots['prefix-disabled'] !== 'undefined'
typeof slots['prefix-disabled'] !== 'undefined',
)
const haveSuEl = computed(() => typeof slots.suffix !== 'undefined')
const selectedBorderStyle = computed(
() => 'border-gray-900/10 dark:border-gray-50/[0.2]'
() => 'border-gray-900/10 dark:border-gray-50/[0.2]',
)
const selectedOnHoverBorderStyle = computed(
() => 'dark:focus:border-white focus:border-gray-900'
() => 'dark:focus:border-white focus:border-gray-900',
)
const selectedPaddingStyle = computed(
() => paddingStyles[props.size] || paddingStyles.md
() => paddingStyles[props.size] || paddingStyles.md,
)
const selectedFontSizeStyle = computed(
() => fontSizeStyles[props.size] || fontSizeStyles.md
() => fontSizeStyles[props.size] || fontSizeStyles.md,
)
</script>

Expand Down
2 changes: 1 addition & 1 deletion components/awesome/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const updateIndicator = () => {
const dom = tabHeaderIndicator.value
// get header tab item dom
const currentActiveIndex = tabItems.value.findIndex(
({ name }) => name === activeTab.value
({ name }) => name === activeTab.value,
)
const tabItem = tabs.value.querySelectorAll('.tabs-header-item')[
currentActiveIndex
Expand Down
15 changes: 8 additions & 7 deletions components/awesome/Welcome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const props = defineProps({
const showAlert = ref(
awesome?.layout?.welcome?.disableInfoReplaceIndexInWelcomePage
? !awesome?.layout?.welcome?.disableInfoReplaceIndexInWelcomePage
: props.withAlert
: props.withAlert,
)
const titlesText = computed<string[]>(() =>
Expand All @@ -21,7 +21,7 @@ const titlesText = computed<string[]>(() =>
)
.replaceAll('&nbsp;', '[space]')
.split(' ')
.map((item) => item.replaceAll('[space]', ' '))
.map((item) => item.replaceAll('[space]', ' ')),
)
const leadingsText = computed(() => [
{
Expand Down Expand Up @@ -80,13 +80,14 @@ const leadingsText = computed(() => [
size="lg"
:text="
parseMenuTitle(
awesome?.layout?.welcome?.primaryActionButton?.title || 'Nuxt 3'
awesome?.layout?.welcome?.primaryActionButton?.title ||
'Nuxt 3',
)
"
:to="
parseMenuRoute(
awesome?.layout?.welcome?.primaryActionButton?.to ||
'https://nuxt.com'
'https://nuxt.com',
)
"
class="font-extrabold"
Expand All @@ -95,19 +96,19 @@ const leadingsText = computed(() => [
v-if="
parseMenuRoute(
awesome?.layout?.welcome?.secondaryActionButton?.to ||
awesome?.project?.links?.github
awesome?.project?.links?.github,
)
"
:text="
parseMenuTitle(
awesome?.layout?.welcome?.secondaryActionButton?.title ||
'Github'
'Github',
)
"
:to="
parseMenuRoute(
awesome?.layout?.welcome?.secondaryActionButton?.to ||
awesome?.project?.links?.github
awesome?.project?.links?.github,
)
"
size="lg"
Expand Down
2 changes: 1 addition & 1 deletion components/layouts/Page/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const nuxtApp = useNuxtApp()
const menus = computed(
() =>
(awesome?.layout?.page?.navbar?.menus ||
[]) as AwesomeLayoutPageNavbarMenu[]
[]) as AwesomeLayoutPageNavbarMenu[],
)
// drawer
Expand Down
2 changes: 1 addition & 1 deletion composables/use-sync-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { WritableComputedRef } from 'vue'
export const useSyncProps = <T>(
props: any,
key: string,
emit: any
emit: any,
): WritableComputedRef<T> => {
return computed({
get() {
Expand Down
1 change: 1 addition & 0 deletions modules/awesome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default defineNuxtModule({
// example: another configs files

// stores autoimports
// * this is fixed for newest pinia
// : per -layers autoimports
for (const layer of nuxt.options._layers) {
const storesPath = resolver.resolve(layer.cwd, 'stores')
Expand Down
4 changes: 2 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default defineNuxtConfig({
// modules
modules: [
// chore
// '@nuxtjs/eslint-module',
'@nuxtjs/eslint-module',
// styling & ui
'@nuxtjs/tailwindcss',
'nuxt-headlessui',
Expand Down Expand Up @@ -65,7 +65,7 @@ export default defineNuxtConfig({

// module::pinia
pinia: {
autoImports: [['defineStore', 'definePiniaStore']],
storesDirs: ['~/stores/**', '#/stores/**', '@/stores/**'],
},

// module::headlessui
Expand Down
2 changes: 1 addition & 1 deletion utils/navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function parseMenuTitle(title?: string | ((nuxt: any) => string)) {
return typeof title === 'function' ? title(useNuxtApp()) : title || ''
}
export function parseMenuRoute(
to?: RouteLocationRaw | ((nuxt: any) => RouteLocationRaw)
to?: RouteLocationRaw | ((nuxt: any) => RouteLocationRaw),
) {
return typeof to === 'function' ? to(useNuxtApp()) : to
}

0 comments on commit dfefd40

Please sign in to comment.