Skip to content

Commit

Permalink
chore: upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Jun 28, 2022
1 parent 514365e commit dc2edcb
Show file tree
Hide file tree
Showing 29 changed files with 1,912 additions and 1,002 deletions.
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead
93 changes: 64 additions & 29 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,50 @@ module.exports = {
jsxPragma: 'React',
ecmaFeatures: {
jsx: true,
tsx: true,
},
},
plugins: ['@typescript-eslint', 'prettier', 'import'],
extends: [
'plugin:vue/vue3-recommended',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
'prettier',
'plugin:prettier/recommended',
],
overrides: [
{
files: ['*.ts', '*.tsx', '*.vue'],
rules: {
'no-undef': 'off',
},
},
],
rules: {
'vue/script-setup-uses-vars': 'error',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'vue/custom-event-name-casing': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
// js/ts
// 'no-console': ['warn', { allow: ['error'] }],
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
camelcase: ['error', { properties: 'never' }],

'no-var': 'error',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-void': 'error',
'prefer-const': ['warn', { destructuring: 'all', ignoreReadBeforeAssign: true }],
'prefer-template': 'error',
'object-shorthand': ['error', 'always', { ignoreConstructors: false, avoidQuotes: true }],
'block-scoped-var': 'error',
'no-constant-condition': ['error', { checkLoops: false }],

'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
// '@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }],
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
Expand All @@ -49,29 +71,42 @@ module.exports = {
varsIgnorePattern: '^_',
},
],
'space-before-function-paren': 'off',

'vue/attributes-order': 'off',
'vue/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/attribute-hyphenation': 'off',
// vue
'vue/no-v-html': 'off',
'vue/require-default-prop': 'off',
'vue/require-explicit-emits': 'off',
'vue/html-self-closing': [
'vue/multi-word-component-names': 'off',

// prettier
'prettier/prettier': 'error',

// import
'import/first': 'error',
'import/no-duplicates': 'error',
'import/order': [
'error',
{
html: {
void: 'always',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],

pathGroups: [
{
pattern: 'vue',
group: 'external',
position: 'before',
},
{
pattern: '@vue/**',
group: 'external',
position: 'before',
},
{
pattern: 'ant-design-vue',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['type'],
},
],
'vue/multi-word-component-names': 'off',
},
};
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
* text=auto eol=lf
*.ts linguist-detectable=false
*.css linguist-detectable=false
*.scss linguist-detectable=false
*.js linguist-detectable=true
*.vue linguist-detectable=true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tests/server/static/upload
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
*pnpm-debug.log*

# Editor directories and files
.idea
Expand Down
8 changes: 0 additions & 8 deletions .husky/lintstagedrc.js

This file was deleted.

2 changes: 0 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@

# Format and submit code according to lintstagedrc.js configuration
npm run lint:lint-staged

npm run lint:pretty
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
.output.js
/node_modules/**

.yarnrc

**/*.svg
**/*.sh

Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"recommendations": [
"octref.vetur",
"vue.volar",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"esbenp.prettier-vscode",
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
},
"[vue]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": false
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
}
},
"i18n-ally.localesPaths": ["src/locales/lang"],
Expand Down
8 changes: 4 additions & 4 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
registry "https://registry.npm.taobao.org"
registry "https://registry.npmmirror.com"

sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"
sass_binary_site "https://npmmirror.com/mirrors/node-sass/"
phantomjs_cdnurl "http://cnpmjs.org/downloads"
electron_mirror "https://npm.taobao.org/mirrors/electron/"
electron_mirror "https://npmmirror.com/mirrors/electron/"
sqlite3_binary_host_mirror "https://foxgis.oss-cn-shanghai.aliyuncs.com/"
profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/"
profiler_binary_host_mirror "https://npmmirror.com/mirrors/node-inspector/"
chromedriver_cdnurl "https://cdn.npm.taobao.org/dist/chromedriver"
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
'header-max-length': [2, 'always', 108],
'subject-empty': [2, 'never'],
'type-empty': [2, 'never'],
'subject-case': [0],
'type-enum': [
2,
'always',
Expand Down
7 changes: 5 additions & 2 deletions components.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/vue-next/pull/3399
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core';

declare module 'vue' {
declare module '@vue/runtime-core' {
export interface GlobalComponents {
Empty: typeof import('./src/components/empty.vue')['default'];
FieldAreaPicker: typeof import('./src/components/field-area-picker.vue')['default'];
Expand All @@ -11,6 +12,8 @@ declare module 'vue' {
FieldPicker: typeof import('./src/components/field-picker.vue')['default'];
ListCard: typeof import('./src/components/list-card.vue')['default'];
PersonSelect: typeof import('./src/components/person-select.vue')['default'];
RouterLink: typeof import('vue-router')['RouterLink'];
RouterView: typeof import('vue-router')['RouterView'];
SearchPerson: typeof import('./src/components/search-person.vue')['default'];
VanCard: typeof import('vant/es')['Card'];
VanGrid: typeof import('vant/es')['Grid'];
Expand Down
88 changes: 48 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,75 +3,83 @@
"version": "0.0.0",
"homepage": "git@buqiyuan.github.io/vite-vue3-h5",
"scripts": {
"serve": "npm run dev",
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"deploy": "gh-pages -d dist",
"format": "prettier --write ./src",
"lint": "eslint ./src --ext .vue,.js,.ts,.tsx",
"lint-fix": "eslint --fix ./src --ext .vue,.js,.ts,.tsx",
"lint:eslint": "eslint \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
"lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
"lint:stylelint": "stylelint --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js",
"lint:pretty": "pretty-quick --staged",
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
"lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged",
"prepare": "husky install",
"postversion": "git push && git push origin --tags",
"reinstall": "rimraf yarn.lock && rimraf package.lock.json && rimraf node_modules && npm run dev",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
"test:gzip": "npx http-server dist --cors --gzip -c-1",
"test:br": "npx http-server dist --cors --brotli -c-1"
},
"dependencies": {
"@vant/area-data": "^1.2.4",
"@vant/area-data": "^1.3.1",
"@vant/touch-emulator": "^1.3.2",
"@vueuse/core": "^8.3.1",
"@vueuse/core": "^8.7.5",
"axios": "^0.27.2",
"dayjs": "^1.11.1",
"lodash": "^4.17.21",
"dayjs": "^1.11.3",
"lodash-es": "^4.17.21",
"pinia": "^2.0.13",
"qs": "^6.10.3",
"vant": "^3.4.8",
"qs": "^6.11.0",
"vant": "^4.0.0-alpha.4",
"vconsole": "^3.14.6",
"vue": "^3.2.33",
"vue-router": "^4.0.14"
"vue": "^3.2.37",
"vue-router": "^4.0.16"
},
"devDependencies": {
"@commitlint/cli": "^16.2.4",
"@commitlint/config-conventional": "^16.2.4",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@types/lodash": "^4.14.182",
"@types/node": "^17.0.30",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"@vitejs/plugin-legacy": "^1.8.1",
"@vitejs/plugin-vue": "^2.3.1",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"@typescript-eslint/parser": "^5.30.0",
"@vitejs/plugin-legacy": "^1.8.2",
"@vitejs/plugin-vue": "^2.3.3",
"@vitejs/plugin-vue-jsx": "^1.3.10",
"@vue/compiler-sfc": "3.2.33",
"@vue/eslint-config-typescript": "^10.0.0",
"@vue/eslint-config-typescript": "^11.0.0",
"commitizen": "^4.2.4",
"conventional-changelog-cli": "^2.2.2",
"cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^6.3.0",
"eslint": "^8.14.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.7.1",
"gh-pages": "^3.2.3",
"husky": "^7.0.4",
"lint-staged": "^12.4.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.1.0",
"eslint-plugin-vue": "^9.1.1",
"gh-pages": "^4.0.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"mockjs": "^1.1.0",
"postcss": "^8.4.14",
"postcss-html": "^1.4.1",
"prettier": "^2.6.2",
"pretty-quick": "^3.1.3",
"sass": "^1.51.0",
"stylelint": "^14.8.1",
"postcss-scss": "^4.0.4",
"prettier": "^2.7.1",
"sass": "^1.53.0",
"stylelint": "^14.9.1",
"stylelint-config-html": "^1.0.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^25.0.0",
"stylelint-config-recommended": "^8.0.0",
"stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-standard": "^26.0.0",
"stylelint-order": "^5.0.0",
"stylelint-scss": "^4.2.0",
"typescript": "^4.6.4",
"vite": "^2.9.6",
"typescript": "^4.7.4",
"unplugin-vue-components": "^0.20.1",
"unplugin-vue-define-options": "^0.6.1",
"vite": "^2.9.13",
"vite-plugin-checker": "^0.4.6",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-style-import": "^1.4.1",
"vue-eslint-parser": "^8.3.0",
"vue-tsc": "^0.34.11"
"vue-eslint-parser": "^9.0.3",
"vue-tsc": "^0.38.2"
},
"license": "MIT",
"engines": {
Expand All @@ -83,7 +91,7 @@
"prettier --write"
],
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
"prettier --write--parser json"
"prettier --write"
],
"package.json": [
"prettier --write"
Expand Down
1 change: 1 addition & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ module.exports = {
proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict',
endOfLine: 'auto',
useTabs: false,
};
12 changes: 2 additions & 10 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
<template>
<router-view #="{ Component }">
<keep-alive>
<component :is="Component" />
</keep-alive>
<component :is="Component" />
</router-view>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
name: 'App',
});
</script>
<script setup lang="ts"></script>

<style lang="scss">
@import './styles/common';
Expand Down
2 changes: 1 addition & 1 deletion src/api/user.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import request from '@/utils/request';
import { LoginParams, LoginResult } from './models/userModel';
import request from '@/utils/request';

enum Api {
getUserId = '/base/appLogin', // 获取用户userid
Expand Down
Loading

1 comment on commit dc2edcb

@vercel
Copy link

@vercel vercel bot commented on dc2edcb Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vite-vue3-h5 – ./

vite-vue3-h5-buqiyuan.vercel.app
vite-vue3-h5.vercel.app
vite-vue3-h5-git-main-buqiyuan.vercel.app

Please sign in to comment.