Added eslint config

pull/20/head
Jef Roosens 2021-05-18 15:25:40 +02:00
parent 17a20052b7
commit b649e3a1a9
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
5 changed files with 3839 additions and 47 deletions

15
web/.eslintrc.yml 100644
View File

@ -0,0 +1,15 @@
env:
browser: true
es2021: true
extends:
- 'plugin:vue/essential'
- standard
parserOptions:
ecmaVersion: 12
parser: '@typescript-eslint/parser'
sourceType: module
plugins:
- vue
- '@typescript-eslint'
rules:
indent: ["error", 4]

View File

@ -4,14 +4,25 @@
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"serve": "vite preview"
"serve": "vite preview",
"lint": "eslint --ext .js,.vue src",
"format": "yarn run lint --fix"
},
"dependencies": {
"vue": "^3.0.5"
"vue": "^3.0.5",
"vue-router": "^4.0.6"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.24.0",
"@typescript-eslint/parser": "^4.24.0",
"@vitejs/plugin-vue": "^1.2.2",
"@vue/compiler-sfc": "^3.0.5",
"eslint": "^7.26.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.23.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-vue": "^7.9.0",
"typescript": "^4.1.3",
"vite": "^2.2.3",
"vue-tsc": "^0.1.0"

View File

@ -1,6 +1,8 @@
<template>
<img alt="Vue logo" src="./assets/logo.png" />
<HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
<div>
<img alt="Vue logo" src="./assets/logo.png" />
<HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
</div>
</template>
<script lang="ts">
@ -8,10 +10,10 @@ import { defineComponent } from 'vue'
import HelloWorld from './components/HelloWorld.vue'
export default defineComponent({
name: 'App',
components: {
HelloWorld
}
name: 'App',
components: {
HelloWorld
}
})
</script>

View File

@ -1,53 +1,55 @@
<template>
<h1>{{ msg }}</h1>
<div>
<h1>{{ msg }}</h1>
<p>
Recommended IDE setup:
<a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
+
<a
href="https://marketplace.visualstudio.com/items?itemName=octref.vetur"
target="_blank"
>
Vetur
</a>
or
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
(if using
<code>&lt;script setup&gt;</code>)
</p>
<p>
Recommended IDE setup:
<a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
+
<a
href="https://marketplace.visualstudio.com/items?itemName=octref.vetur"
target="_blank"
>
Vetur
</a>
or
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
(if using
<code>&lt;script setup&gt;</code>)
</p>
<p>See <code>README.md</code> for more information.</p>
<p>See <code>README.md</code> for more information.</p>
<p>
<a href="https://vitejs.dev/guide/features.html" target="_blank">
Vite Docs
</a>
|
<a href="https://v3.vuejs.org/" target="_blank">Vue 3 Docs</a>
</p>
<p>
<a href="https://vitejs.dev/guide/features.html" target="_blank">
Vite Docs
</a>
|
<a href="https://v3.vuejs.org/" target="_blank">Vue 3 Docs</a>
</p>
<button @click="count++">count is: {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test hot module replacement.
</p>
<button @click="count++">count is: {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test hot module replacement.
</p>
</div>
</template>
<script lang="ts">
import { ref, defineComponent } from 'vue'
export default defineComponent({
name: 'HelloWorld',
props: {
msg: {
type: String,
required: true
name: 'HelloWorld',
props: {
msg: {
type: String,
required: true
}
},
setup: () => {
const count = ref(0)
return { count }
}
},
setup: () => {
const count = ref(0)
return { count }
}
})
</script>

3762
web/yarn.lock 100644

File diff suppressed because it is too large Load Diff