fix lint
This commit is contained in:
1 parent
f225debe34
commit
d1f7b0fe5f
23 files changed
+1054
-362
No files matched your search
+14
-3
@@ -1,7 +1,18 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
extends: ['plugin:vue/vue3-essential', 'prettier'],
|
env: {
|
||||||
|
browser: true,
|
||||||
|
es2021: true,
|
||||||
|
node: true
|
||||||
|
},
|
||||||
|
extends: ['plugin:vue/vue3-recommended', 'prettier'],
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 'latest',
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
sourceType: 'module'
|
||||||
|
},
|
||||||
|
plugins: ['vue', 'html', 'prettier'],
|
||||||
rules: {
|
rules: {
|
||||||
'vue/no-unused-vars': 'error',
|
'prettier/prettier': 'error',
|
||||||
semi: 'off'
|
'vue/multi-word-component-names': 'off'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
. "$(dirname "$0")/common.sh"
|
. "$(dirname "$0")/common.sh"
|
||||||
|
|
||||||
|
yarn lint
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
+10
-1
@@ -3,5 +3,14 @@ module.exports = {
|
|||||||
tabWidth: 2,
|
tabWidth: 2,
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
printWidth: 120,
|
printWidth: 120,
|
||||||
endOfLine: 'auto'
|
endOfLine: 'auto',
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: '*.json',
|
||||||
|
options: {
|
||||||
|
printWidth: 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
arrowParens: 'always'
|
||||||
};
|
};
|
||||||
+23
-17
@@ -1,20 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "zhishuyun-auth",
|
"name": "zhishuyun-academy",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "vite",
|
"start": "vite --host",
|
||||||
"build": "vue-tsc --noEmit && vite build",
|
"build": "vue-tsc --noEmit --skipLibCheck && vite build",
|
||||||
"serve": "vite preview",
|
"serve": "vite preview",
|
||||||
"init:https": "yarn run init:ca && yarn run init:cert",
|
"lint": "npx eslint src --fix --ext .ts,.tsx,.vue,.js,.jsx",
|
||||||
"init:ca": "npx mkcert create-ca --validity 36500 --key certs/academy.local.zhishuyun.com.ca.key --cert certs/academy.local.zhishuyun.com.ca.crt",
|
"prettier": "npx prettier --write ."
|
||||||
"init:cert": "npx mkcert create-cert --ca-key certs/academy.local.zhishuyun.com.ca.key --ca-cert certs/academy.local.zhishuyun.com.ca.crt --validity 36500 --key certs/academy.local.zhishuyun.com.cert.key --cert certs/academy.local.zhishuyun.com.cert.crt --domains academy.local.zhishuyun.com"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "^0.2.7",
|
|
||||||
"@types/humps": "^2.0.1",
|
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"dayjs": "^1.10.7",
|
"dayjs": "^1.10.7",
|
||||||
"element-plus": "^2.0.2",
|
"element-plus": "^1.3.0-beta.10",
|
||||||
"hls.js": "^1.1.5",
|
"hls.js": "^1.1.5",
|
||||||
"humps": "^2.0.1",
|
"humps": "^2.0.1",
|
||||||
"qrcode.vue": "3.3.0",
|
"qrcode.vue": "3.3.0",
|
||||||
@@ -28,23 +25,32 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-replace": "^3.0.0",
|
"@rollup/plugin-replace": "^3.0.0",
|
||||||
|
"@types/hls.js": "^1.0.0",
|
||||||
|
"@types/humps": "^2.0.1",
|
||||||
"@types/lodash": "^4.14.172",
|
"@types/lodash": "^4.14.172",
|
||||||
"@types/node": "^16.7.4",
|
"@types/node": "^16.7.4",
|
||||||
"@vitejs/plugin-vue": "^1.6.0",
|
"@typescript-eslint/eslint-plugin": "^5.17.0",
|
||||||
|
"@typescript-eslint/parser": "^5.17.0",
|
||||||
|
"@vitejs/plugin-vue": "^2.3.0",
|
||||||
"@vue/compiler-sfc": "^3.0.5",
|
"@vue/compiler-sfc": "^3.0.5",
|
||||||
"autoprefixer": "^10.3.3",
|
"autoprefixer": "^10.3.3",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-vue": "^7.17.0",
|
"eslint-config-standard": "^16.0.3",
|
||||||
|
"eslint-plugin-html": "^6.2.0",
|
||||||
|
"eslint-plugin-import": "^2.25.4",
|
||||||
|
"eslint-plugin-node": "^11.1.0",
|
||||||
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
|
"eslint-plugin-promise": "^6.0.0",
|
||||||
|
"eslint-plugin-vue": "^8.5.0",
|
||||||
"husky": "^7.0.2",
|
"husky": "^7.0.2",
|
||||||
"mkcert": "^1.5.0",
|
|
||||||
"postcss": "^8.3.6",
|
"postcss": "^8.3.6",
|
||||||
"prettier": "^2.3.2",
|
"prettier": "^2.6.2",
|
||||||
"rollup-plugin-string": "^3.0.0",
|
"rollup-plugin-string": "^3.0.0",
|
||||||
"sass": "^1.38.1",
|
"sass": "^1.38.1",
|
||||||
"tailwindcss": "^2.2.8",
|
"tailwindcss": "^2.2.8",
|
||||||
"typescript": "^4.3.2",
|
"typescript": "^4.6.3",
|
||||||
"vite": "^2.5.1",
|
"vite": "^2.9.0",
|
||||||
"vue-tsc": "^0.2.2"
|
"vue-tsc": "^0.29.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-breadcrumb separator="/" class="breadcrumb">
|
<el-breadcrumb separator="/" class="breadcrumb">
|
||||||
<el-breadcrumb-item :to="{ path: '/' }">{{ $t('common.nav.home') }}</el-breadcrumb-item>
|
<el-breadcrumb-item :to="{ path: '/' }">{{ $t('common.nav.home') }}</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item v-for="item in items" :to="{ name: item.name }">{{ item.meta.title }}</el-breadcrumb-item>
|
<el-breadcrumb-item v-for="(item, itemIndex) in items" :key="itemIndex" :to="{ name: item.name }">{{
|
||||||
|
item.meta.title
|
||||||
|
}}</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
<el-pagination
|
<el-pagination
|
||||||
class="mt-3 mb-3"
|
class="mt-3 mb-3"
|
||||||
background
|
background
|
||||||
@currentChange="onPageChange"
|
|
||||||
layout="prev, pager, next"
|
layout="prev, pager, next"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page-size="pageSize"
|
:page-size="pageSize"
|
||||||
|
@currentChange="onPageChange"
|
||||||
>
|
>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-alert :title="content" v-if="show" type="success" center :closable="false" show-icon class="alert-succcess-info">
|
<el-alert v-if="show" :title="content" type="success" center :closable="false" show-icon class="alert-succcess-info">
|
||||||
</el-alert>
|
</el-alert>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -7,16 +7,16 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="20">
|
<el-col :span="20">
|
||||||
<el-menu :default-active="active" class="el-menu-demo" mode="horizontal" @select="onSelect">
|
<el-menu :default-active="active" class="el-menu-demo" mode="horizontal" @select="onSelect">
|
||||||
<el-menu-item index="/courses" v-t="'common.nav.course'"></el-menu-item>
|
<el-menu-item v-t="'common.nav.course'" index="/courses"></el-menu-item>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<div class="mt-4 pr-10" v-if="!$store.getters.authenticated">
|
<div v-if="!$store.getters.authenticated" class="mt-4 pr-10">
|
||||||
<el-button type="primary" class="float-right" size="small" round @click="onLogin">{{
|
<el-button type="primary" class="float-right" size="small" round @click="onLogin">{{
|
||||||
$t('common.button.login')
|
$t('common.button.login')
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-3 pr-10 float-right" v-else>
|
<div v-else class="mt-3 pr-10 float-right">
|
||||||
<el-dropdown trigger="click">
|
<el-dropdown trigger="click">
|
||||||
<img :src="$store.getters.user?.avatar" class="avatar" />
|
<img :src="$store.getters.user?.avatar" class="avatar" />
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<vue-plyr :options="options" ref="plyr">
|
<vue-plyr ref="plyr" :options="options">
|
||||||
<video controls playsinline :data-poster="preview" ref="video"></video>
|
<video ref="video" controls playsinline :data-poster="preview"></video>
|
||||||
</vue-plyr>
|
</vue-plyr>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -27,16 +27,16 @@ export default defineComponent({
|
|||||||
type: String
|
type: String
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data(): IData {
|
||||||
|
return {
|
||||||
|
options: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const video = this.$refs.video as HTMLMediaElement;
|
const video = this.$refs.video as HTMLMediaElement;
|
||||||
const hls = new Hls();
|
const hls = new Hls();
|
||||||
hls.loadSource(this.resource);
|
hls.loadSource(this.resource);
|
||||||
hls.attachMedia(video);
|
hls.attachMedia(video);
|
||||||
},
|
|
||||||
data(): IData {
|
|
||||||
return {
|
|
||||||
options: {}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -2,8 +2,9 @@
|
|||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<el-row
|
<el-row
|
||||||
v-for="(episode, episodeIndex) in episodes"
|
v-for="(episode, episodeIndex) in episodes"
|
||||||
@click="onClick(episode)"
|
:key="episodeIndex"
|
||||||
:class="{ item: true, active: episode.id === active }"
|
:class="{ item: true, active: episode.id === active }"
|
||||||
|
@click="onClick(episode)"
|
||||||
>
|
>
|
||||||
<el-col :span="6" class="left">
|
<el-col :span="6" class="left">
|
||||||
<span class="index">
|
<span class="index">
|
||||||
|
|||||||
Vendored
+1
-2
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
declare module '*.vue' {
|
declare module '*.vue' {
|
||||||
import { DefineComponent } from 'vue';
|
import { DefineComponent } from 'vue';
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
const component: DefineComponent<{}, {}, {}>;
|
||||||
const component: DefineComponent<{}, {}, any>;
|
|
||||||
export default component;
|
export default component;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,18 +5,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { TopHeader } from '@/components/common/index';
|
|
||||||
|
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
name: 'LayoutAuth',
|
||||||
TopHeader
|
components: {},
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
name: 'LayoutAuth',
|
|
||||||
computed: {},
|
computed: {},
|
||||||
methods: {}
|
methods: {}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,11 +14,11 @@
|
|||||||
import { TopHeader } from '@/components/common/index';
|
import { TopHeader } from '@/components/common/index';
|
||||||
import BottomFooter from '@/components/common/BottomFooter.vue';
|
import BottomFooter from '@/components/common/BottomFooter.vue';
|
||||||
export default {
|
export default {
|
||||||
|
name: 'LayoutCourse',
|
||||||
components: {
|
components: {
|
||||||
TopHeader,
|
TopHeader,
|
||||||
BottomFooter
|
BottomFooter
|
||||||
},
|
}
|
||||||
name: 'LayoutCourse'
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { TopHeader } from '@/components/common/index';
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
name: 'LayoutEpisode',
|
||||||
TopHeader
|
components: {}
|
||||||
},
|
|
||||||
name: 'LayoutEpisode'
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -30,8 +30,9 @@
|
|||||||
<el-row class="episodes">
|
<el-row class="episodes">
|
||||||
<el-col :span="14" :offset="5">
|
<el-col :span="14" :offset="5">
|
||||||
<el-card
|
<el-card
|
||||||
shadow="hover"
|
|
||||||
v-for="(episode, episodeIndex) in episodes"
|
v-for="(episode, episodeIndex) in episodes"
|
||||||
|
:key="episodeIndex"
|
||||||
|
shadow="hover"
|
||||||
class="episode"
|
class="episode"
|
||||||
@click="
|
@click="
|
||||||
$router.push({
|
$router.push({
|
||||||
@@ -87,6 +88,9 @@ interface IData {
|
|||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'CourseDetail',
|
name: 'CourseDetail',
|
||||||
|
components: {
|
||||||
|
Clock
|
||||||
|
},
|
||||||
data(): IData {
|
data(): IData {
|
||||||
return {
|
return {
|
||||||
course: undefined,
|
course: undefined,
|
||||||
@@ -94,9 +98,6 @@ export default defineComponent({
|
|||||||
loading: false
|
loading: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
|
||||||
Clock
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
id() {
|
id() {
|
||||||
return parseInt(this.$route.params.id.toString());
|
return parseInt(this.$route.params.id.toString());
|
||||||
|
|||||||
@@ -2,10 +2,17 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="20" :offset="2">
|
<el-col :span="20" :offset="2">
|
||||||
<div class="courses">
|
<div class="courses">
|
||||||
<el-card shadow="hover" class="course" v-for="course in courses">
|
<el-card v-for="(course, courseIndex) in courses" :key="courseIndex" shadow="hover" class="course">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="tags mb-5">
|
<div class="tags mb-5">
|
||||||
<el-button size="small" type="danger" class="tag" v-for="tag in course.tags">{{ tag }}</el-button>
|
<el-button
|
||||||
|
v-for="(tag, tagIndex) in course.tags"
|
||||||
|
:key="tagIndex"
|
||||||
|
size="small"
|
||||||
|
type="danger"
|
||||||
|
class="tag"
|
||||||
|
>{{ tag }}</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="title mb-5">
|
<div class="title mb-5">
|
||||||
<p>{{ course.title }}</p>
|
<p>{{ course.title }}</p>
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
<el-col :span="6" class="side">
|
<el-col :span="6" class="side">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<course-preview-card :course="course" v-if="course" />
|
<course-preview-card v-if="course" :course="course" />
|
||||||
<episode-side-list :episodes="episodes" :active="id" @choose="onChoose($event)" />
|
<episode-side-list :episodes="episodes" :active="id" @choose="onChoose($event)" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="18" class="main">
|
<el-col :span="18" class="main">
|
||||||
<episode-player :resource="episode?.resourceUrl" v-if="episode?.resourceUrl" :preview="episode?.thumbnail" />
|
<episode-player v-if="episode?.resourceUrl" :resource="episode?.resourceUrl" :preview="episode?.thumbnail" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
+5
-2
@@ -1,6 +1,9 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
purge: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
|
purge: {
|
||||||
darkMode: false, // or 'media' or 'class'
|
enabled: process.env.NODE_ENV !== 'development',
|
||||||
|
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}']
|
||||||
|
},
|
||||||
|
darkMode: false,
|
||||||
theme: {
|
theme: {
|
||||||
extend: {}
|
extend: {}
|
||||||
},
|
},
|
||||||
|
|||||||
+5
-3
@@ -1,19 +1,21 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
|
"useDefineForClassFields": true,
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
|
"isolatedModules": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"lib": ["esnext", "dom"],
|
"lib": ["esnext", "dom"],
|
||||||
"types": ["node", "element-plus/global"],
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"]
|
"@/*": ["./src/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
||||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
|
"references": [{ "path": "./tsconfig.node.json" }]
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": true,
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "node"
|
||||||
|
},
|
||||||
|
"include": ["vite.config.ts"]
|
||||||
|
}
|
||||||
+2
-2
@@ -7,7 +7,7 @@ import fs from 'fs';
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
server: {
|
server: {
|
||||||
open: true,
|
// open: true,
|
||||||
host: 'academy.local.zhishuyun.com',
|
host: 'academy.local.zhishuyun.com',
|
||||||
port: 443,
|
port: 443,
|
||||||
https: {
|
https: {
|
||||||
@@ -45,6 +45,6 @@ export default defineConfig({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
sourcemap: true
|
sourcemap: process.env.NODE_ENV !== 'production'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user