Skip to content

Commit

Permalink
add new rules
Browse files Browse the repository at this point in the history
  • Loading branch information
the-illarionov committed Aug 11, 2024
1 parent 2c4d3d0 commit 0301702
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 26 deletions.
16 changes: 16 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ export default antfu({
multiline: 'below',
}],

'vue/padding-line-between-tags': ['error', [
{ blankLine: 'always', prev: '*', next: '*' },
]],

'vue/html-closing-bracket-newline': [
'error',
{
singleline: 'never',
multiline: 'never',
selfClosingTag: {
singleline: 'never',
multiline: 'never',
},
},
],

'no-console': 'off',
'node/prefer-global/process': 'off',
'ts/consistent-type-definitions': 'off',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import TheInitializationWrapper from './components/TheInitializationWrapper/TheI
<template>
<Suspense>
<TheInitializationWrapper />

<template #fallback>
<div
class="flex
justify-center
items-center
h-full
w-full"
>
w-full">
Loading...
</div>
</template>
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/BaseButton/BaseButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const props = defineProps<{
{
[$style.loading]: props.activatorLoading,
},
]"
>
]">
<slot />
</button>
</template>
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/components/BaseInput/BaseInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ const model = defineModel()
{
[$style.loading]: props.activatorLoading,
},
]"
>
]">

<div
v-if="props.errorMessage"
:class="$style['error-message']"
data-test="error-message"
>
data-test="error-message">
{{ props.errorMessage }}
</div>
</div>
Expand Down
12 changes: 4 additions & 8 deletions frontend/src/components/FormLogin/FormLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ machineIndex.actorRef.subscribe({
&& machineIndex.snapshot.value.context.isDirty"
:error-message="machineIndex.snapshot.value.context.validationErrors.username"
:activator-loading="machineIndex.snapshot.value.hasTag('fetching')"
data-test="username"
/>
data-test="username" />
</div>

<div class="mb-8">
Expand All @@ -68,22 +67,19 @@ machineIndex.actorRef.subscribe({
&& machineIndex.snapshot.value.context.isDirty"
:error-message="machineIndex.snapshot.value.context.validationErrors.password"
:activator-loading="machineIndex.snapshot.value.hasTag('fetching')"
data-test="password"
/>
data-test="password" />
</div>

<BaseButton
data-test="submit"
:activator-loading="machineIndex.snapshot.value.hasTag('fetching')"
>
:activator-loading="machineIndex.snapshot.value.hasTag('fetching')">
Login
</BaseButton>

<div
v-if="machineIndex.snapshot.value.hasTag('fetching')"
class="pt-8
text-center"
>
text-center">
Loading...
</div>
</form>
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/layouts/LayoutBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
<nav
class="flex
justify-between
mb-8"
>
mb-8">
<span>logo</span>

<span>navigation</span>
</nav>

<slot />
</template>
14 changes: 6 additions & 8 deletions frontend/src/pages/PageIndex/PageIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,27 @@ function sendUserInfoToMachineApp({ userInfo }: { userInfo: UserInfo }) {
{{ machineApp.snapshot.value.value }}
</span>
</p>

<p class="mb-16">
machineApp context:
{{ machineApp.snapshot.value.context }}
</p>

<div
class="mx-auto
w-1/2"
>
w-1/2">
<Transition
name="fade"
mode="out-in"
>
mode="out-in">
<FormLogin
v-if="machineApp.snapshot.value.hasTag('unauthorized')"
data-test="form-login"
@logged="sendUserInfoToMachineApp"
/>
@logged="sendUserInfoToMachineApp" />

<div
v-else
class="text-center"
data-test="user-logged"
>
data-test="user-logged">
You are logged in
</div>
</Transition>
Expand Down

0 comments on commit 0301702

Please sign in to comment.