From ced7c2aa5e115050b1ad5dd1fb51898e24aa7797 Mon Sep 17 00:00:00 2001 From: nelson Date: Sat, 16 Apr 2022 12:20:16 +0800 Subject: [PATCH] add eslint sass --- .eslintrc.js | 17 +++++++++++++++++ README.md | 4 ++++ package.json | 4 ++++ src/main.ts | 6 +++--- src/views/tst/About.vue | 8 +++++--- tsconfig.json | 12 ++++++++++-- 6 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..62ea6a9 --- /dev/null +++ b/.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'] + } +} \ No newline at end of file diff --git a/README.md b/README.md index e315145..c5b50f3 100644 --- a/README.md +++ b/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 + diff --git a/package.json b/package.json index 501c54c..102ad90 100644 --- a/package.json +++ b/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" diff --git a/src/main.ts b/src/main.ts index 870a9e4..65f639d 100644 --- a/src/main.ts +++ b/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') diff --git a/src/views/tst/About.vue b/src/views/tst/About.vue index 59abb71..b351308 100644 --- a/src/views/tst/About.vue +++ b/src/views/tst/About.vue @@ -6,7 +6,7 @@ - \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 3e3dee4..0aab7c8 100644 --- a/tsconfig.json +++ b/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"] }