Skip to content

Commit

Permalink
fix(ci/lint): resolve lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Socketlike committed Jul 17, 2024
1 parent ba93556 commit 13e09d7
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 38 deletions.
19 changes: 15 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,24 @@ require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
'extends': [
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
'@vue/eslint-config-prettier/skip-formatting',
],
parserOptions: {
ecmaVersion: 'latest'
}
ecmaVersion: 'latest',
},
rules: {
'vue/no-unused-vars': 'warn',
},
overrides: [
{
files: ['src/views/**/*.vue'],
rules: {
'vue/multi-word-component-names': 'off',
},
},
],
}
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { filter } from '@/router'
<div class="wrapper">
<div class="header">
evie's pages
<span class="breadcrumb">{{ window.location.pathname }} </span>
<span class="breadcrumb">{{ $route.name }}</span>
</div>
<div class="nav">
<router-link
Expand Down
9 changes: 9 additions & 0 deletions src/components/BreakLine.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script setup lang="ts">
defineProps<{
for?: number
}>()
</script>

<template>
<br v-for="_ in $props.for || 1" :key="_" />
</template>
17 changes: 15 additions & 2 deletions src/css/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@

justify-content: space-between;

&:not(.no-wrap) {
margin-top: 4px;
}

.no-wrap {
margin-bottom: 4px;
}

.header,
.footer {
background-color: var(--background-color);
Expand Down Expand Up @@ -49,10 +57,15 @@

font-weight: normal;

&:before {
color: darkgray;
max-width: 87.6em;

overflow: hidden;

text-overflow: ellipsis;

&:before {
content: '> ';
color: darkgray;
}
}
}
Expand Down
14 changes: 10 additions & 4 deletions src/css/floating-vue.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
.v-popper__popper .v-popper__inner {
background-color: var(--background-floating);
border: 4px solid var(--background-floating);
outline: 1px solid var(--note);
.v-popper__popper {
.v-popper__inner {
background-color: var(--background-floating);
outline: 2px solid var(--note);
border-radius: 0;
}

.v-popper__arrow-outer {
border-color: var(--note);
}
}
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ import FloatingVue from 'floating-vue'

import App from '@/App.vue'

import BreakLine from '@/components/BreakLine.vue'

import * as util from '@/util'
import router from '@/router'

import 'floating-vue/style.css'
import '@/css/index.less'

declare const window: CustomWindow

const app = vue.createApp(App)

app.use(router).use(FloatingVue)

app.config.globalProperties.window = window

window.__internals__ = {
App,
app,
Expand All @@ -26,4 +25,5 @@ window.__internals__ = {
vue,
}

app.mount('#app')
/* eslint-disable-next-line vue/multi-word-component-names */
app.component('brk', BreakLine).use(router).use(FloatingVue).mount('#app')
2 changes: 0 additions & 2 deletions src/util/createElement.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { HtmlHTMLAttributes } from 'vue'

export default (
type: string,
props?: Record<string, any>,
Expand Down
14 changes: 10 additions & 4 deletions src/views/404.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<script setup lang="ts">
import { computed } from 'vue'
const pathname = computed(() => window.location.pathname)
</script>

<template>
<div class="highlight">something is wrong.</div>
<br />
<brk />
<div>you tried to access a resource that does not exist.</div>
<br />
<brk />
<div>did you make a typo?</div>
<br />
<div style="color: gray">&gt; could not resolve "{{ window.location.pathname }}"</div>
<brk />
<div style="color: gray">&gt; could not resolve "{{ pathname }}"</div>
</template>

<style scoped lang="less">
Expand Down
16 changes: 8 additions & 8 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<template>
welcome to my github pages
<br v-for="_ in 3" />
<brk :for="3" />
sorry i don't have much to say;
<br v-for="_ in 3" />
<brk :for="3" />
even about myself or anything about this site in particular
<br v-for="_ in 2" />
<brk :for="2" />
because it is nothing interesting
<br v-for="_ in 6" />
<brk :for="6" />
this site has had 3 iterations so far;
<br v-for="_ in 2" />
<brk :for="2" />
you are currently looking at the third iteration of this site; which is written in
<a href="//v3.vuejs.org">[vue 3]</a>
<br v-for="_ in 3" />
<brk :for="3" />
as for the previous two iterations:
<ul>
<li>
Expand All @@ -33,8 +33,8 @@
>; which, probably, caused it to have a lot of janky wiring
</li>
</ul>
<br />
<brk />
feel free to look and poke around with anything you see on this site!
<br v-for="_ in 2" />
<brk :for="2" />
<div style="color: gray; font-size: 2px">window.__internals__</div>
</template>
14 changes: 7 additions & 7 deletions src/views/Projects/View.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, reactive } from 'vue'
import { reactive } from 'vue'
import list from './list'
Expand All @@ -21,12 +21,16 @@ const state = reactive([false])
{{ label.text }}
</span>

<template v-else-if="label.length > 0" v-for="({ text, style, tooltip }, index) of label">
<template
v-else-if="label.length > 0"
v-for="({ text, style, tooltip }, index) of label"
:key="index"
>
<span class="label" :style="style" v-tooltip="tooltip">{{ text }}</span
><template v-if="index !== label.length">{{ ' ' }}</template>
</template>
</template>
<br />
<brk />
<ul class="meta" :style="`display: ${state[index] ? 'block' : 'none'}`">
<li class="inner">
{{ description || 'no description' }}
Expand Down Expand Up @@ -62,8 +66,6 @@ const state = reactive([false])
margin-right: 8px;
user-select: none;
&:hover {
color: blanchedalmond;
Expand All @@ -76,8 +78,6 @@ const state = reactive([false])
font-size: 12px;
user-select: none;
&:before {
color: darkgray;
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from 'vite'

import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { plugin as markdown, Mode } from 'vite-plugin-markdown'
// import { plugin as markdown, Mode } from 'vite-plugin-markdown'

export default defineConfig({
plugins: [
Expand Down

0 comments on commit 13e09d7

Please sign in to comment.