Added eslint config
parent
93a8313efd
commit
81266f427b
|
@ -0,0 +1,7 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = false
|
||||
indent_style = space
|
||||
indent_size = 2
|
|
@ -0,0 +1,15 @@
|
|||
env:
|
||||
browser: true
|
||||
es2021: true
|
||||
vue/setup-compiler-macros: true
|
||||
extends:
|
||||
- 'plugin:vue/vue3-recommended'
|
||||
- standard
|
||||
parserOptions:
|
||||
ecmaVersion: 13
|
||||
parser: '@typescript-eslint/parser'
|
||||
sourceType: module
|
||||
plugins:
|
||||
- vue
|
||||
- '@typescript-eslint'
|
||||
rules: {}
|
12
package.json
12
package.json
|
@ -5,13 +5,23 @@
|
|||
"dev": "vite",
|
||||
"build": "vue-tsc --noEmit && vite build",
|
||||
"preview": "vite preview",
|
||||
"image": "docker build -t chewingbever/rb-blog ."
|
||||
"image": "docker build -t chewingbever/rb-blog .",
|
||||
"lint": "eslint --ext .js,.vue,.ts src",
|
||||
"format": "yarn run lint --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.2.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
||||
"@typescript-eslint/parser": "^5.8.1",
|
||||
"@vitejs/plugin-vue": "^2.0.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-standard": "^16.0.3",
|
||||
"eslint-plugin-import": "^2.25.3",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^5.2.0",
|
||||
"eslint-plugin-vue": "^8.2.0",
|
||||
"miragejs": "^0.1.43",
|
||||
"null-loader": "^4.0.1",
|
||||
"typescript": "^4.4.4",
|
||||
|
|
|
@ -5,8 +5,13 @@ import HelloWorld from './components/HelloWorld.vue'
|
|||
</script>
|
||||
|
||||
<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>
|
||||
|
||||
<style>
|
||||
|
|
|
@ -5,7 +5,7 @@ defineProps<{ msg: string }>()
|
|||
|
||||
const count = ref(0)
|
||||
|
||||
fetch("/api/users").then(res => res.json()).then(res => console.log(res))
|
||||
fetch('/api/users').then(res => res.json()).then(res => console.log(res))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -13,22 +13,39 @@ fetch("/api/users").then(res => res.json()).then(res => console.log(res))
|
|||
|
||||
<p>
|
||||
Recommended IDE setup:
|
||||
<a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
|
||||
<a
|
||||
href="https://code.visualstudio.com/"
|
||||
target="_blank"
|
||||
>VSCode</a>
|
||||
+
|
||||
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
|
||||
<a
|
||||
href="https://github.com/johnsoncodehk/volar"
|
||||
target="_blank"
|
||||
>Volar</a>
|
||||
</p>
|
||||
|
||||
<p>See <code>README.md</code> for more information.</p>
|
||||
|
||||
<p>
|
||||
<a href="https://vitejs.dev/guide/features.html" target="_blank">
|
||||
<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>
|
||||
<a
|
||||
href="https://v3.vuejs.org/"
|
||||
target="_blank"
|
||||
>Vue 3 Docs</a>
|
||||
</p>
|
||||
|
||||
<button type="button" @click="count++">count is: {{ count }}</button>
|
||||
<button
|
||||
type="button"
|
||||
@click="count++"
|
||||
>
|
||||
count is: {{ count }}
|
||||
</button>
|
||||
<p>
|
||||
Edit
|
||||
<code>components/HelloWorld.vue</code> to test hot module replacement.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
// @ts-ignore
|
||||
import { makeServer } from "./server"
|
||||
// @ts-ignore
|
||||
import { makeServer } from './server'
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
makeServer()
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
// src/server.js
|
||||
import { createServer, Model } from "miragejs"
|
||||
import { createServer, Model } from 'miragejs'
|
||||
|
||||
export function makeServer({ environment = "development" } = {}) {
|
||||
let server = createServer({
|
||||
export function makeServer ({ environment = 'development' } = {}) {
|
||||
const server = createServer({
|
||||
environment,
|
||||
|
||||
models: {
|
||||
user: Model,
|
||||
user: Model
|
||||
},
|
||||
|
||||
seeds(server) {
|
||||
server.create("user", { name: "Bob" })
|
||||
server.create("user", { name: "Alice" })
|
||||
seeds (server) {
|
||||
server.create('user', { name: 'Bob' })
|
||||
server.create('user', { name: 'Alice' })
|
||||
},
|
||||
|
||||
routes() {
|
||||
this.namespace = "api"
|
||||
routes () {
|
||||
this.namespace = 'api'
|
||||
|
||||
this.get("/users", (schema) => {
|
||||
this.get('/users', (schema) => {
|
||||
return schema.users.all()
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
return server
|
||||
|
|
Loading…
Reference in New Issue