Browse Source

add eslint sass

master
nelson 3 years ago
parent
commit
ced7c2aa5e
  1. 17
      .eslintrc.js
  2. 4
      README.md
  3. 4
      package.json
  4. 6
      src/main.ts
  5. 8
      src/views/tst/About.vue
  6. 12
      tsconfig.json

17
.eslintrc.js

@ -0,0 +1,17 @@
module.exports = {
root: true,
parserOptions: {
sourceType: "module"
},
parser: "vue-eslint-parser",
extends: ["plugin:vue/vue3-essential","plugin:vue/vue3-strongly-recommended","plugin:vue/vue3-recommended"],
env: {
browser: true,
node: true,
es6: true
},
rules: {
'no-console': 'off',
'comma-dangle': [2,'never']
}
}

4
README.md

@ -23,3 +23,7 @@ npm install axios save
npm install @types/node --save-dev
npm install --save-dev eslint eslint-plugin-vue
npm install -D sass sass-loader

4
package.json

@ -17,6 +17,10 @@
"devDependencies": {
"@types/node": "^17.0.24",
"@vitejs/plugin-vue": "^2.3.1",
"eslint": "^8.13.0",
"eslint-plugin-vue": "^8.6.0",
"sass": "^1.50.0",
"sass-loader": "^12.6.0",
"typescript": "^4.5.4",
"vite": "^2.9.2",
"vue-tsc": "^0.29.8"

6
src/main.ts

@ -1,9 +1,9 @@
import { createApp } from 'vue'
import App from './App.vue'
import App from '@/App.vue'
// @ts-ignore
import router from './router/index'
import router from '@/router/index'
// @ts-ignore
import {store,key} from './store/index'
import {store,key} from '@/store/index'
createApp(App).use(router).use(store,key).mount('#app')

8
src/views/tst/About.vue

@ -6,7 +6,7 @@
<script setup lang="ts">
import {ref, computed} from 'vue'
import {useStore} from '../../store/index'
import {useStore} from '@/store/index'
const store = useStore()
const showCount = computed(() => {
@ -23,6 +23,8 @@ const addBtn = () => {
</script>
<style scoped>
<style scoped lang="scss">
button{
margin-top: 10px;
}
</style>

12
tsconfig.json

@ -10,8 +10,16 @@
"resolveJsonModule": true,
"isolatedModules": false,
"esModuleInterop": true,
"lib": ["esnext", "dom"]
"skipLibCheck": true,
"lib": ["esnext", "dom"],
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
}
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
"references": [{ "path": "./tsconfig.node.json" }],
"exclude": ["node_modules"]
}

Loading…
Cancel
Save