From 169145181311f5d43fe7730bf106b30ab29e7174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Sun, 19 Jan 2020 11:42:22 +0800 Subject: [PATCH] chore(cli): update eslint config and prettier codes --- packages/vant-cli/package.json | 2 +- .../vant-cli/site/common/iframe-router.js | 4 +- packages/vant-cli/site/common/index.js | 5 +- packages/vant-cli/site/common/style/var.less | 2 +- packages/vant-cli/site/desktop/App.vue | 14 +- .../site/desktop/components/Container.vue | 4 +- .../site/desktop/components/Content.vue | 4 +- .../site/desktop/components/Header.vue | 44 ++++-- .../vant-cli/site/desktop/components/Nav.vue | 14 +- .../site/desktop/components/NavLink.vue | 19 ++- .../site/desktop/components/SearchInput.vue | 14 +- .../site/desktop/components/Simulator.vue | 10 +- .../site/desktop/components/index.vue | 16 +-- packages/vant-cli/site/desktop/index.html | 66 +++++---- packages/vant-cli/site/desktop/main.js | 2 +- packages/vant-cli/site/desktop/router.js | 20 +-- packages/vant-cli/site/desktop/utils.js | 2 +- packages/vant-cli/site/mobile/App.vue | 2 +- .../site/mobile/components/DemoBlock.vue | 4 +- .../site/mobile/components/DemoHome.vue | 18 ++- .../site/mobile/components/DemoHomeNav.vue | 10 +- .../site/mobile/components/DemoNav.vue | 8 +- .../site/mobile/components/DemoSection.vue | 4 +- packages/vant-cli/site/mobile/index.html | 65 +++++---- packages/vant-cli/site/mobile/main.js | 2 +- packages/vant-cli/site/mobile/router.js | 18 +-- packages/vant-cli/src/commands/build.ts | 19 ++- packages/vant-cli/src/commands/changelog.ts | 6 +- packages/vant-cli/src/commands/clean.ts | 2 +- packages/vant-cli/src/commands/jest.ts | 4 +- packages/vant-cli/src/commands/lint.ts | 6 +- packages/vant-cli/src/commands/release.ts | 6 +- packages/vant-cli/src/common/index.ts | 4 +- packages/vant-cli/src/common/manager.ts | 2 +- packages/vant-cli/src/compiler/compile-css.ts | 2 +- .../vant-cli/src/compiler/compile-less.ts | 4 +- packages/vant-cli/src/compiler/compile-sfc.ts | 4 +- .../vant-cli/src/compiler/compile-site.ts | 2 +- .../src/compiler/gen-component-style.ts | 12 +- .../src/compiler/gen-package-entry.ts | 7 +- .../src/compiler/gen-site-desktop-shared.ts | 10 +- .../src/compiler/gen-site-mobile-shared.ts | 9 +- .../vant-cli/src/compiler/gen-vetur-config.ts | 2 +- .../src/compiler/vant-cli-site-plugin.ts | 4 +- packages/vant-cli/src/config/babel.config.ts | 22 +-- packages/vant-cli/src/config/jest.config.ts | 10 +- .../vant-cli/src/config/postcss.config.ts | 8 +- packages/vant-cli/src/config/webpack.base.ts | 52 +++---- .../vant-cli/src/config/webpack.package.ts | 12 +- .../vant-cli/src/config/webpack.site.dev.ts | 30 ++-- .../vant-cli/src/config/webpack.site.prd.ts | 4 +- packages/vant-cli/yarn.lock | 130 +++++++----------- 52 files changed, 383 insertions(+), 363 deletions(-) diff --git a/packages/vant-cli/package.json b/packages/vant-cli/package.json index 211e226fb..631e3271a 100644 --- a/packages/vant-cli/package.json +++ b/packages/vant-cli/package.json @@ -54,7 +54,7 @@ "@babel/preset-env": "^7.7.7", "@babel/preset-typescript": "^7.7.7", "@nuxt/friendly-errors-webpack-plugin": "^2.5.0", - "@vant/eslint-config": "^1.5.1", + "@vant/eslint-config": "^2.0.0", "@vant/markdown-loader": "^2.3.0", "@vant/markdown-vetur": "^1.1.0", "@vant/stylelint-config": "^1.1.0", diff --git a/packages/vant-cli/site/common/iframe-router.js b/packages/vant-cli/site/common/iframe-router.js index 8f426e611..703beec2b 100644 --- a/packages/vant-cli/site/common/iframe-router.js +++ b/packages/vant-cli/site/common/iframe-router.js @@ -4,7 +4,7 @@ import { iframeReady, isMobile } from '.'; -window.syncPath = function () { +window.syncPath = function() { const router = window.vueRouter; const isInIframe = window !== window.top; const currentDir = router.history.current.path; @@ -21,7 +21,7 @@ window.syncPath = function () { } }; -window.replacePath = function (path = '') { +window.replacePath = function(path = '') { // should preserve hash for anchor if (window.vueRouter.currentRoute.path !== path) { window.vueRouter.replace(path).catch(() => {}); diff --git a/packages/vant-cli/site/common/index.js b/packages/vant-cli/site/common/index.js index a118e1802..38d345ea8 100644 --- a/packages/vant-cli/site/common/index.js +++ b/packages/vant-cli/site/common/index.js @@ -27,7 +27,4 @@ export function decamelize(str, sep = '-') { .toLowerCase(); } -export { - isMobile, - iframeReady -}; +export { isMobile, iframeReady }; diff --git a/packages/vant-cli/site/common/style/var.less b/packages/vant-cli/site/common/style/var.less index 6ae0506ae..ac642ce4c 100644 --- a/packages/vant-cli/site/common/style/var.less +++ b/packages/vant-cli/site/common/style/var.less @@ -4,7 +4,7 @@ @van-doc-fuchsia: #a7419e; @van-doc-green: #4fc08d; @van-doc-text-color: #34495e; -@van-doc-text-light-blue: rgba(69, 90, 100, .6); +@van-doc-text-light-blue: rgba(69, 90, 100, 0.6); @van-doc-background-color: #f7f8fa; @van-doc-grey: #999; @van-doc-dark-grey: #666; diff --git a/packages/vant-cli/site/desktop/App.vue b/packages/vant-cli/site/desktop/App.vue index b50c19985..b633671c8 100644 --- a/packages/vant-cli/site/desktop/App.vue +++ b/packages/vant-cli/site/desktop/App.vue @@ -19,7 +19,7 @@ import { setLang } from '../common/locales'; export default { components: { - VanDoc + VanDoc, }, data() { @@ -27,7 +27,7 @@ export default { return { packageVersion, - simulator: `${path}mobile.html${location.hash}` + simulator: `${path}mobile.html${location.hash}`, }; }, @@ -41,7 +41,7 @@ export default { const { locales = {} } = config.site; return Object.keys(locales).map(key => ({ lang: key, - label: locales[key].langLabel || '' + label: locales[key].langLabel || '', })); }, @@ -61,14 +61,14 @@ export default { } return null; - } + }, }, watch: { lang(val) { setLang(val); this.setTitle(); - } + }, }, created() { @@ -84,8 +84,8 @@ export default { } document.title = title; - } - } + }, + }, }; diff --git a/packages/vant-cli/site/desktop/components/Container.vue b/packages/vant-cli/site/desktop/components/Container.vue index 86313a5ef..7ed8d7e0f 100644 --- a/packages/vant-cli/site/desktop/components/Container.vue +++ b/packages/vant-cli/site/desktop/components/Container.vue @@ -12,8 +12,8 @@ export default { name: 'van-doc-container', props: { - hasSimulator: Boolean - } + hasSimulator: Boolean, + }, }; diff --git a/packages/vant-cli/site/desktop/components/Content.vue b/packages/vant-cli/site/desktop/components/Content.vue index 9d961cf3c..9ddbc2ad0 100644 --- a/packages/vant-cli/site/desktop/components/Content.vue +++ b/packages/vant-cli/site/desktop/components/Content.vue @@ -15,8 +15,8 @@ export default { return path.split('/').slice(-1)[0]; } return this.$route.name; - } - } + }, + }, }; diff --git a/packages/vant-cli/site/desktop/components/Header.vue b/packages/vant-cli/site/desktop/components/Header.vue index e0739e550..7bdea680e 100644 --- a/packages/vant-cli/site/desktop/components/Header.vue +++ b/packages/vant-cli/site/desktop/components/Header.vue @@ -3,21 +3,36 @@
- +
  • - - + +
  • -
  • - +
  • + {{ versions[0].label }}
    @@ -49,19 +64,19 @@ export default { name: 'van-doc-header', components: { - SearchInput + SearchInput, }, props: { lang: String, config: Object, versions: Array, - langConfigs: Array + langConfigs: Array, }, data() { return { - showVersionPop: false + showVersionPop: false, }; }, @@ -85,7 +100,7 @@ export default { searchConfig() { return this.config.searchConfig; - } + }, }, methods: { @@ -93,7 +108,10 @@ export default { const val = !this.showVersionPop; const action = val ? 'add' : 'remove'; - document.body[`${action}EventListener`]('click', this.checkHideVersionPop); + document.body[`${action}EventListener`]( + 'click', + this.checkHideVersionPop + ); this.showVersionPop = val; }, @@ -110,8 +128,8 @@ export default { onSwitchVersion(version) { location.href = version.link; - } - } + }, + }, }; diff --git a/packages/vant-cli/site/desktop/components/Nav.vue b/packages/vant-cli/site/desktop/components/Nav.vue index 4103b9a7e..1e3039e6d 100644 --- a/packages/vant-cli/site/desktop/components/Nav.vue +++ b/packages/vant-cli/site/desktop/components/Nav.vue @@ -28,18 +28,18 @@ export default { name: 'van-doc-nav', components: { - [NavLink.name]: NavLink + [NavLink.name]: NavLink, }, props: { lang: String, - navConfig: Array + navConfig: Array, }, data() { return { top: 60, - bottom: 0 + bottom: 0, }; }, @@ -47,13 +47,13 @@ export default { style() { return { top: this.top + 'px', - bottom: this.bottom + 'px' + bottom: this.bottom + 'px', }; }, base() { return this.lang ? `/${this.lang}/` : '/'; - } + }, }, created() { @@ -65,8 +65,8 @@ export default { onScroll() { const { pageYOffset: offset } = window; this.top = Math.max(0, 60 - offset); - } - } + }, + }, }; diff --git a/packages/vant-cli/site/desktop/components/NavLink.vue b/packages/vant-cli/site/desktop/components/NavLink.vue index ebc017eb6..b4090b1eb 100644 --- a/packages/vant-cli/site/desktop/components/NavLink.vue +++ b/packages/vant-cli/site/desktop/components/NavLink.vue @@ -1,7 +1,12 @@ diff --git a/packages/vant-cli/site/desktop/components/SearchInput.vue b/packages/vant-cli/site/desktop/components/SearchInput.vue index 91fda83b1..103f74adc 100644 --- a/packages/vant-cli/site/desktop/components/SearchInput.vue +++ b/packages/vant-cli/site/desktop/components/SearchInput.vue @@ -1,5 +1,5 @@ diff --git a/packages/vant-cli/site/desktop/components/Simulator.vue b/packages/vant-cli/site/desktop/components/Simulator.vue index 4e7c64924..5c0f0b9fc 100644 --- a/packages/vant-cli/site/desktop/components/Simulator.vue +++ b/packages/vant-cli/site/desktop/components/Simulator.vue @@ -9,13 +9,13 @@ export default { name: 'van-doc-simulator', props: { - src: String + src: String, }, data() { return { scrollTop: window.scrollY, - windowHeight: window.innerHeight + windowHeight: window.innerHeight, }; }, @@ -27,9 +27,9 @@ export default { simulatorStyle() { const height = Math.min(640, this.windowHeight - 90); return { - height: height + 'px' + height: height + 'px', }; - } + }, }, mounted() { @@ -39,7 +39,7 @@ export default { window.addEventListener('resize', () => { this.windowHeight = window.innerHeight; }); - } + }, }; diff --git a/packages/vant-cli/site/desktop/components/index.vue b/packages/vant-cli/site/desktop/components/index.vue index 1b078658a..09c069b6a 100644 --- a/packages/vant-cli/site/desktop/components/index.vue +++ b/packages/vant-cli/site/desktop/components/index.vue @@ -8,7 +8,7 @@ @switch-version="$emit('switch-version', $event)" /> - + @@ -32,7 +32,7 @@ export default { DocHeader, DocContent, DocContainer, - DocSimulator + DocSimulator, }, props: { @@ -42,19 +42,19 @@ export default { langConfigs: Array, config: { type: Object, - required: true + required: true, }, base: { type: String, - default: '' - } + default: '', + }, }, watch: { // eslint-disable-next-line '$route.path'() { this.setNav(); - } + }, }, created() { @@ -98,8 +98,8 @@ export default { break; } }); - } - } + }, + }, }; diff --git a/packages/vant-cli/site/desktop/index.html b/packages/vant-cli/site/desktop/index.html index fb5c24522..23d0381ad 100644 --- a/packages/vant-cli/site/desktop/index.html +++ b/packages/vant-cli/site/desktop/index.html @@ -1,29 +1,43 @@ - - - <%= htmlWebpackPlugin.options.title %> - - - - - - - - <% if (htmlWebpackPlugin.options.baiduAnalytics) { %> - - <% } %> - - -
    - - + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + <% if (htmlWebpackPlugin.options.baiduAnalytics) { %> + + <% } %> + + +
    + + diff --git a/packages/vant-cli/site/desktop/main.js b/packages/vant-cli/site/desktop/main.js index f3437235f..33c2a7708 100644 --- a/packages/vant-cli/site/desktop/main.js +++ b/packages/vant-cli/site/desktop/main.js @@ -15,5 +15,5 @@ new Vue({ } }, render: h => h(App), - router + router, }); diff --git a/packages/vant-cli/site/desktop/router.js b/packages/vant-cli/site/desktop/router.js index b283ad334..a55e60a9a 100644 --- a/packages/vant-cli/site/desktop/router.js +++ b/packages/vant-cli/site/desktop/router.js @@ -20,13 +20,13 @@ function parseName(name) { return { component: `${decamelize(component)}`, - lang: pairs.join('-') + lang: pairs.join('-'), }; } return { component: `${decamelize(name)}`, - lang: '' + lang: '', }; } @@ -48,12 +48,12 @@ function getRoutes() { if (locales) { routes.push({ path: '*', - redirect: route => `/${getLangFromRoute(route)}/` + redirect: route => `/${getLangFromRoute(route)}/`, }); } else { routes.push({ path: '*', - redirect: '/' + redirect: '/', }); } @@ -62,7 +62,7 @@ function getRoutes() { name: lang, path: `/${lang || ''}`, component: Home, - meta: { lang } + meta: { lang }, }); } @@ -80,8 +80,8 @@ function getRoutes() { component: documents[name], meta: { lang, - name: component - } + name: component, + }, }); } else { routes.push({ @@ -89,8 +89,8 @@ function getRoutes() { path: `/${component}`, component: documents[name], meta: { - name: component - } + name: component, + }, }); } }); @@ -109,7 +109,7 @@ export const router = new VueRouter({ } return { x: 0, y: 0 }; - } + }, }); router.afterEach(() => { diff --git a/packages/vant-cli/site/desktop/utils.js b/packages/vant-cli/site/desktop/utils.js index 5db855c0f..154d088a5 100644 --- a/packages/vant-cli/site/desktop/utils.js +++ b/packages/vant-cli/site/desktop/utils.js @@ -5,7 +5,7 @@ export function scrollToAnchor(selector) { const el = document.querySelector(selector); if (el) { el.scrollIntoView({ - behavior: 'smooth' + behavior: 'smooth', }); clearInterval(timer); } else { diff --git a/packages/vant-cli/site/mobile/App.vue b/packages/vant-cli/site/mobile/App.vue index b5ca849c1..905517f1b 100644 --- a/packages/vant-cli/site/mobile/App.vue +++ b/packages/vant-cli/site/mobile/App.vue @@ -11,7 +11,7 @@ import DemoNav from './components/DemoNav'; export default { - components: { DemoNav } + components: { DemoNav }, }; diff --git a/packages/vant-cli/site/mobile/components/DemoBlock.vue b/packages/vant-cli/site/mobile/components/DemoBlock.vue index 93bfbea03..9e8cb782d 100644 --- a/packages/vant-cli/site/mobile/components/DemoBlock.vue +++ b/packages/vant-cli/site/mobile/components/DemoBlock.vue @@ -10,8 +10,8 @@ export default { name: 'demo-block', props: { - title: String - } + title: String, + }, }; diff --git a/packages/vant-cli/site/mobile/components/DemoHome.vue b/packages/vant-cli/site/mobile/components/DemoHome.vue index e8d77b68e..fbe9c5e52 100644 --- a/packages/vant-cli/site/mobile/components/DemoHome.vue +++ b/packages/vant-cli/site/mobile/components/DemoHome.vue @@ -4,16 +4,14 @@ class="demo-home__title" :class="{ 'demo-home__title--small': smallTitle }" > - + {{ config.title }} -

    {{ config.description }}

    +

    + {{ config.description }} +

    @@ -24,7 +22,7 @@ import DemoHomeNav from './DemoHomeNav'; export default { components: { - DemoHomeNav + DemoHomeNav, }, computed: { @@ -45,8 +43,8 @@ export default { smallTitle() { return this.config.title.length >= 8; - } - } + }, + }, }; diff --git a/packages/vant-cli/site/mobile/components/DemoHomeNav.vue b/packages/vant-cli/site/mobile/components/DemoHomeNav.vue index 63b26a31f..2ba2d074d 100644 --- a/packages/vant-cli/site/mobile/components/DemoHomeNav.vue +++ b/packages/vant-cli/site/mobile/components/DemoHomeNav.vue @@ -20,25 +20,25 @@ import ArrowRight from './ArrowRight'; export default { components: { - ArrowRight + ArrowRight, }, props: { lang: String, - group: Object + group: Object, }, data() { return { - active: [] + active: [], }; }, computed: { base() { return this.lang ? `/${this.lang}` : ''; - } - } + }, + }, }; diff --git a/packages/vant-cli/site/mobile/components/DemoNav.vue b/packages/vant-cli/site/mobile/components/DemoNav.vue index cbe64752a..9cc7e9305 100644 --- a/packages/vant-cli/site/mobile/components/DemoNav.vue +++ b/packages/vant-cli/site/mobile/components/DemoNav.vue @@ -13,7 +13,7 @@ export default { data() { return { path: - 'M296.114 508.035c-3.22-13.597.473-28.499 11.079-39.105l333.912-333.912c16.271-16.272 42.653-16.272 58.925 0s16.272 42.654 0 58.926L395.504 498.47l304.574 304.574c16.272 16.272 16.272 42.654 0 58.926s-42.654 16.272-58.926 0L307.241 528.058a41.472 41.472 0 0 1-11.127-20.023z' + 'M296.114 508.035c-3.22-13.597.473-28.499 11.079-39.105l333.912-333.912c16.271-16.272 42.653-16.272 58.925 0s16.272 42.654 0 58.926L395.504 498.47l304.574 304.574c16.272 16.272 16.272 42.654 0 58.926s-42.654 16.272-58.926 0L307.241 528.058a41.472 41.472 0 0 1-11.127-20.023z', }; }, @@ -21,14 +21,14 @@ export default { title() { const { name } = this.$route.meta || {}; return name ? name.replace(/-/g, '') : ''; - } + }, }, methods: { onBack() { history.back(); - } - } + }, + }, }; diff --git a/packages/vant-cli/site/mobile/components/DemoSection.vue b/packages/vant-cli/site/mobile/components/DemoSection.vue index 969a8ff72..2452394f5 100644 --- a/packages/vant-cli/site/mobile/components/DemoSection.vue +++ b/packages/vant-cli/site/mobile/components/DemoSection.vue @@ -18,8 +18,8 @@ export default { } return ''; - } - } + }, + }, }; diff --git a/packages/vant-cli/site/mobile/index.html b/packages/vant-cli/site/mobile/index.html index de6e2ffb1..35ecf3a99 100644 --- a/packages/vant-cli/site/mobile/index.html +++ b/packages/vant-cli/site/mobile/index.html @@ -1,30 +1,41 @@ - - - <%= htmlWebpackPlugin.options.title %> - - - - - - - <% if (htmlWebpackPlugin.options.baiduAnalytics) { %> - - <% } %> - - -
    - + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + <% if (htmlWebpackPlugin.options.baiduAnalytics) { %> + + <% } %> + + +
    + diff --git a/packages/vant-cli/site/mobile/main.js b/packages/vant-cli/site/mobile/main.js index 5c735e56f..94c80f4ae 100644 --- a/packages/vant-cli/site/mobile/main.js +++ b/packages/vant-cli/site/mobile/main.js @@ -16,6 +16,6 @@ setTimeout(() => { new Vue({ el: '#app', render: h => h(App), - router + router, }); }, 0); diff --git a/packages/vant-cli/site/mobile/router.js b/packages/vant-cli/site/mobile/router.js index 9340b8605..c3f1d9fa0 100644 --- a/packages/vant-cli/site/mobile/router.js +++ b/packages/vant-cli/site/mobile/router.js @@ -29,25 +29,25 @@ function getRoutes() { if (langs.length) { routes.push({ path: '*', - redirect: route => `/${getLangFromRoute(route)}/` + redirect: route => `/${getLangFromRoute(route)}/`, }); langs.forEach(lang => { routes.push({ path: `/${lang}`, component: DemoHome, - meta: { lang } + meta: { lang }, }); }); } else { routes.push({ path: '*', - redirect: () => '/' + redirect: () => '/', }); routes.push({ path: '/', - component: DemoHome + component: DemoHome, }); } @@ -62,8 +62,8 @@ function getRoutes() { component: demos[name], meta: { name, - lang - } + lang, + }, }); }); } else { @@ -72,8 +72,8 @@ function getRoutes() { path: `/${component}`, component: demos[name], meta: { - name - } + name, + }, }); } }); @@ -86,7 +86,7 @@ Vue.use(VueRouter); export const router = new VueRouter({ mode: 'hash', routes: getRoutes(), - scrollBehavior: (to, from, savedPosition) => savedPosition || { x: 0, y: 0 } + scrollBehavior: (to, from, savedPosition) => savedPosition || { x: 0, y: 0 }, }); router.afterEach(() => { diff --git a/packages/vant-cli/src/commands/build.ts b/packages/vant-cli/src/commands/build.ts index d4eacaa75..4c554bb6d 100644 --- a/packages/vant-cli/src/commands/build.ts +++ b/packages/vant-cli/src/commands/build.ts @@ -23,7 +23,7 @@ import { isDemoDir, isTestDir, setNodeEnv, - setModuleEnv + setModuleEnv, } from '../common'; async function compileFile(filePath: string) { @@ -62,7 +62,6 @@ async function compileDir(dir: string) { ); } - async function buildEs() { setModuleEnv('esmodule'); await copy(SRC_DIR, ES_DIR); @@ -87,7 +86,7 @@ async function buildPacakgeEntry() { genPackageEntry({ outputPath: esEntryFile, - pathResolver: (path: string) => `./${relative(SRC_DIR, path)}` + pathResolver: (path: string) => `./${relative(SRC_DIR, path)}`, }); setModuleEnv('esmodule'); @@ -95,7 +94,7 @@ async function buildPacakgeEntry() { genPacakgeStyle({ outputPath: styleEntryFile, - pathResolver: (path: string) => path.replace(SRC_DIR, '.') + pathResolver: (path: string) => path.replace(SRC_DIR, '.'), }); setModuleEnv('commonjs'); @@ -114,24 +113,24 @@ async function buildPackages() { const tasks = [ { text: 'Build ESModule Outputs', - task: buildEs + task: buildEs, }, { text: 'Build Commonjs Outputs', - task: buildLib + task: buildLib, }, { text: 'Build Style Entry', - task: buildStyleEntry + task: buildStyleEntry, }, { text: 'Build Package Entry', - task: buildPacakgeEntry + task: buildPacakgeEntry, }, { text: 'Build Packed Outputs', - task: buildPackages - } + task: buildPackages, + }, ]; async function runBuildTasks() { diff --git a/packages/vant-cli/src/commands/changelog.ts b/packages/vant-cli/src/commands/changelog.ts index 4c494a683..9d39d62a8 100644 --- a/packages/vant-cli/src/commands/changelog.ts +++ b/packages/vant-cli/src/commands/changelog.ts @@ -19,7 +19,7 @@ function formatType(type: string) { fix: 'Bug Fixes', feat: 'Feature', docs: 'Document', - types: 'Types' + types: 'Types', }; return MAP[type] || type; @@ -52,7 +52,7 @@ export async function changelog() { return new Promise(resolve => { conventionalChangelog( { - preset: 'angular' + preset: 'angular', }, null, null, @@ -61,7 +61,7 @@ export async function changelog() { mainTemplate, headerPartial, commitPartial, - transform + transform, } ) .pipe(createWriteStream(DIST_FILE)) diff --git a/packages/vant-cli/src/commands/clean.ts b/packages/vant-cli/src/commands/clean.ts index bed36facd..080b15b54 100644 --- a/packages/vant-cli/src/commands/clean.ts +++ b/packages/vant-cli/src/commands/clean.ts @@ -6,6 +6,6 @@ export async function clean() { emptyDir(ES_DIR), emptyDir(LIB_DIR), emptyDir(DIST_DIR), - emptyDir(SITE_DIST_DIR) + emptyDir(SITE_DIST_DIR), ]); } diff --git a/packages/vant-cli/src/commands/jest.ts b/packages/vant-cli/src/commands/jest.ts index fea8de048..368d49d19 100644 --- a/packages/vant-cli/src/commands/jest.ts +++ b/packages/vant-cli/src/commands/jest.ts @@ -7,14 +7,14 @@ export function test(command: any) { setNodeEnv('test'); genPackageEntry({ - outputPath: PACKAGE_ENTRY_FILE + outputPath: PACKAGE_ENTRY_FILE, }); const config = { rootDir: ROOT, watch: command.watch, config: JEST_CONFIG_FILE, - clearCache: command.clearCache + clearCache: command.clearCache, } as any; runCLI(config, [ROOT]) diff --git a/packages/vant-cli/src/commands/lint.ts b/packages/vant-cli/src/commands/lint.ts index a29284bd3..2f54a5098 100644 --- a/packages/vant-cli/src/commands/lint.ts +++ b/packages/vant-cli/src/commands/lint.ts @@ -18,7 +18,7 @@ function runCommand( return new Promise(resolve => { execa(cmd, options, { - env: { FORCE_COLOR: true } + env: { FORCE_COLOR: true }, }) .then(() => { spinner.succeed(messages.succeed); @@ -39,7 +39,7 @@ function eslint() { { start: 'Running eslint...', succeed: 'ESLint Passed.', - failed: 'ESLint failed!' + failed: 'ESLint failed!', } ); } @@ -51,7 +51,7 @@ function stylelint() { { start: 'Running stylelint...', succeed: 'Stylelint Passed.', - failed: 'Stylelint failed!' + failed: 'Stylelint failed!', } ); } diff --git a/packages/vant-cli/src/commands/release.ts b/packages/vant-cli/src/commands/release.ts index b2925c32c..e6270ace3 100644 --- a/packages/vant-cli/src/commands/release.ts +++ b/packages/vant-cli/src/commands/release.ts @@ -8,11 +8,11 @@ const PLUGIN_PATH = join(__dirname, '../compiler/vant-cli-release-plugin.js'); export async function release() { await releaseIt({ plugins: { - [PLUGIN_PATH]: {} + [PLUGIN_PATH]: {}, }, git: { tagName: 'v${version}', - commitMessage: 'chore: release ${version}' - } + commitMessage: 'chore: release ${version}', + }, }); } diff --git a/packages/vant-cli/src/common/index.ts b/packages/vant-cli/src/common/index.ts index 1922de8fb..0d01f02ae 100644 --- a/packages/vant-cli/src/common/index.ts +++ b/packages/vant-cli/src/common/index.ts @@ -4,13 +4,13 @@ import { existsSync, readdirSync, readFileSync, - outputFileSync + outputFileSync, } from 'fs-extra'; import { SRC_DIR, getVantConfig, ROOT_WEBPACK_CONFIG_FILE, - ROOT_POSTCSS_CONFIG_FILE + ROOT_POSTCSS_CONFIG_FILE, } from './constant'; export const EXT_REGEXP = /\.\w+$/; diff --git a/packages/vant-cli/src/common/manager.ts b/packages/vant-cli/src/common/manager.ts index 320efd7ff..22ea1be29 100644 --- a/packages/vant-cli/src/common/manager.ts +++ b/packages/vant-cli/src/common/manager.ts @@ -25,7 +25,7 @@ export async function installDependencies() { const manager = hasYarn() ? 'yarn' : 'npm'; await execa(manager, ['install', '--prod=false'], { - stdio: 'inherit' + stdio: 'inherit', }); console.log(''); diff --git a/packages/vant-cli/src/compiler/compile-css.ts b/packages/vant-cli/src/compiler/compile-css.ts index 591af0f48..2a29dda16 100644 --- a/packages/vant-cli/src/compiler/compile-css.ts +++ b/packages/vant-cli/src/compiler/compile-css.ts @@ -8,7 +8,7 @@ const cleanCss = new CleanCss(); export async function compileCss(source: string | Buffer) { const config = await postcssrc({}, POSTCSS_CONFIG_FILE); const { css } = await postcss(config.plugins as any).process(source, { - from: undefined + from: undefined, }); return cleanCss.minify(css).styles; diff --git a/packages/vant-cli/src/compiler/compile-less.ts b/packages/vant-cli/src/compiler/compile-less.ts index f2eec94cf..1c548fc3f 100644 --- a/packages/vant-cli/src/compiler/compile-less.ts +++ b/packages/vant-cli/src/compiler/compile-less.ts @@ -13,14 +13,14 @@ class TildeResolver extends FileManager { const TildeResolverPlugin = { install(lessInstance: unknown, pluginManager: any) { pluginManager.addFileManager(new TildeResolver()); - } + }, }; export async function compileLess(filePath: string) { const source = readFileSync(filePath, 'utf-8'); const { css } = await render(source, { filename: filePath, - plugins: [TildeResolverPlugin] + plugins: [TildeResolverPlugin], }); return css; diff --git a/packages/vant-cli/src/compiler/compile-sfc.ts b/packages/vant-cli/src/compiler/compile-sfc.ts index 6b600a92e..1cb6badbd 100644 --- a/packages/vant-cli/src/compiler/compile-sfc.ts +++ b/packages/vant-cli/src/compiler/compile-sfc.ts @@ -57,7 +57,7 @@ function compileTemplate(template: string) { const result = compileUtils.compileTemplate({ compiler, source: template, - isProduction: true + isProduction: true, } as any); return result.code; @@ -73,7 +73,7 @@ export function parseSfc(filePath: string) { const descriptor = compileUtils.parse({ source, compiler, - needMap: false + needMap: false, } as any); return descriptor; diff --git a/packages/vant-cli/src/compiler/compile-site.ts b/packages/vant-cli/src/compiler/compile-site.ts index c1e834979..d023c7e0c 100644 --- a/packages/vant-cli/src/compiler/compile-site.ts +++ b/packages/vant-cli/src/compiler/compile-site.ts @@ -39,7 +39,7 @@ function watch() { getPort( { - port: config.devServer!.port + port: config.devServer!.port, }, (err, port) => { if (err) { diff --git a/packages/vant-cli/src/compiler/gen-component-style.ts b/packages/vant-cli/src/compiler/gen-component-style.ts index 0b912d7ac..e557d329b 100644 --- a/packages/vant-cli/src/compiler/gen-component-style.ts +++ b/packages/vant-cli/src/compiler/gen-component-style.ts @@ -11,7 +11,7 @@ import { ES_DIR, SRC_DIR, LIB_DIR, - STYPE_DEPS_JSON_FILE + STYPE_DEPS_JSON_FILE, } from '../common/constant'; function getDeps(component: string): string[] { @@ -41,12 +41,12 @@ function getRelativePath(component: string, style: string, ext: string) { const OUTPUT_CONFIG = [ { dir: ES_DIR, - template: (dep: string) => `import '${dep}';` + template: (dep: string) => `import '${dep}';`, }, { dir: LIB_DIR, - template: (dep: string) => `require('${dep}');` - } + template: (dep: string) => `require('${dep}');`, + }, ]; function genEntry(params: { @@ -92,7 +92,7 @@ export function genComponentStyle( baseFile, component, filename: 'index.js', - ext: '.css' + ext: '.css', }); if (CSS_LANG !== 'css') { @@ -100,7 +100,7 @@ export function genComponentStyle( baseFile, component, filename: CSS_LANG + '.js', - ext: '.' + CSS_LANG + ext: '.' + CSS_LANG, }); } }); diff --git a/packages/vant-cli/src/compiler/gen-package-entry.ts b/packages/vant-cli/src/compiler/gen-package-entry.ts index b8a242256..989533f4e 100644 --- a/packages/vant-cli/src/compiler/gen-package-entry.ts +++ b/packages/vant-cli/src/compiler/gen-package-entry.ts @@ -1,6 +1,11 @@ import { get } from 'lodash'; import { join } from 'path'; -import { pascalize, getComponents, smartOutputFile, normalizePath } from '../common'; +import { + pascalize, + getComponents, + smartOutputFile, + normalizePath, +} from '../common'; import { SRC_DIR, getPackageJson, getVantConfig } from '../common/constant'; type Options = { diff --git a/packages/vant-cli/src/compiler/gen-site-desktop-shared.ts b/packages/vant-cli/src/compiler/gen-site-desktop-shared.ts index 78a6badaa..3f20a6cff 100644 --- a/packages/vant-cli/src/compiler/gen-site-desktop-shared.ts +++ b/packages/vant-cli/src/compiler/gen-site-desktop-shared.ts @@ -6,14 +6,14 @@ import { removeExt, getVantConfig, smartOutputFile, - normalizePath + normalizePath, } from '../common'; import { SRC_DIR, DOCS_DIR, getPackageJson, VANT_CONFIG_FILE, - SITE_DESKTOP_SHARED_FILE + SITE_DESKTOP_SHARED_FILE, } from '../common/constant'; type DocumentItem = { @@ -52,7 +52,7 @@ function resolveDocuments(components: string[]): DocumentItem[] { components.forEach(component => { docs.push({ name: formatName(component, lang), - path: join(SRC_DIR, component, fileName) + path: join(SRC_DIR, component, fileName), }); }); }); @@ -60,7 +60,7 @@ function resolveDocuments(components: string[]): DocumentItem[] { components.forEach(component => { docs.push({ name: formatName(component), - path: join(SRC_DIR, component, 'README.md') + path: join(SRC_DIR, component, 'README.md'), }); }); } @@ -69,7 +69,7 @@ function resolveDocuments(components: string[]): DocumentItem[] { const pairs = parse(path).name.split('.'); return { name: formatName(pairs[0], pairs[1] || defaultLang), - path + path, }; }); diff --git a/packages/vant-cli/src/compiler/gen-site-mobile-shared.ts b/packages/vant-cli/src/compiler/gen-site-mobile-shared.ts index 3fc0bbd01..2edddef05 100644 --- a/packages/vant-cli/src/compiler/gen-site-mobile-shared.ts +++ b/packages/vant-cli/src/compiler/gen-site-mobile-shared.ts @@ -7,7 +7,7 @@ import { decamelize, getVantConfig, smartOutputFile, - normalizePath + normalizePath, } from '../common'; type DemoItem = { @@ -25,7 +25,10 @@ import './package-style'; function genImports(demos: DemoItem[]) { return demos - .map(item => `import ${item.name} from '${removeExt(normalizePath(item.path))}';`) + .map( + item => + `import ${item.name} from '${removeExt(normalizePath(item.path))}';` + ) .join('\n'); } @@ -73,7 +76,7 @@ function genCode(components: string[]) { .map(component => ({ component, name: pascalize(component), - path: join(SRC_DIR, component, 'demo/index.vue') + path: join(SRC_DIR, component, 'demo/index.vue'), })) .filter(item => existsSync(item.path)); diff --git a/packages/vant-cli/src/compiler/gen-vetur-config.ts b/packages/vant-cli/src/compiler/gen-vetur-config.ts index 6b5d0e17d..92f6eb267 100644 --- a/packages/vant-cli/src/compiler/gen-vetur-config.ts +++ b/packages/vant-cli/src/compiler/gen-vetur-config.ts @@ -14,7 +14,7 @@ export function genVeturConfig() { path: SRC_DIR, test: /zh-CN\.md/, outputDir: join(ROOT, 'vetur'), - ...options + ...options, }); } } diff --git a/packages/vant-cli/src/compiler/vant-cli-site-plugin.ts b/packages/vant-cli/src/compiler/vant-cli-site-plugin.ts index e9073ebed..cc7f31165 100644 --- a/packages/vant-cli/src/compiler/vant-cli-site-plugin.ts +++ b/packages/vant-cli/src/compiler/vant-cli-site-plugin.ts @@ -15,10 +15,10 @@ export async function genSiteEntry() { genStyleDepsMap() .then(() => { genPackageEntry({ - outputPath: PACKAGE_ENTRY_FILE + outputPath: PACKAGE_ENTRY_FILE, }); genPacakgeStyle({ - outputPath: replaceExt(PACKAGE_STYLE_FILE, `.${CSS_LANG}`) + outputPath: replaceExt(PACKAGE_STYLE_FILE, `.${CSS_LANG}`), }); genSiteMobileShared(); genSiteDesktopShared(); diff --git a/packages/vant-cli/src/config/babel.config.ts b/packages/vant-cli/src/config/babel.config.ts index 4f887d748..047cafede 100644 --- a/packages/vant-cli/src/config/babel.config.ts +++ b/packages/vant-cli/src/config/babel.config.ts @@ -15,38 +15,38 @@ module.exports = function(api?: ConfigAPI) { '@babel/preset-env', { loose: true, - modules: useESModules ? false : 'commonjs' - } + modules: useESModules ? false : 'commonjs', + }, ], [ '@vue/babel-preset-jsx', { - functional: false - } + functional: false, + }, ], - '@babel/preset-typescript' + '@babel/preset-typescript', ], plugins: [ [ '@babel/plugin-transform-runtime', { corejs: false, - useESModules - } + useESModules, + }, ], [ 'import', { libraryName: 'vant', libraryDirectory: useESModules ? 'es' : 'lib', - style: true + style: true, }, - 'vant' + 'vant', ], '@babel/plugin-transform-object-assign', '@babel/plugin-proposal-optional-chaining', - '@babel/plugin-proposal-nullish-coalescing-operator' - ] + '@babel/plugin-proposal-nullish-coalescing-operator', + ], }; }; diff --git a/packages/vant-cli/src/config/jest.config.ts b/packages/vant-cli/src/config/jest.config.ts index b9b80b206..52a727d11 100644 --- a/packages/vant-cli/src/config/jest.config.ts +++ b/packages/vant-cli/src/config/jest.config.ts @@ -4,26 +4,26 @@ import { ROOT, JEST_SETUP_FILE, JEST_FILE_MOCK_FILE, - JEST_STYLE_MOCK_FILE + JEST_STYLE_MOCK_FILE, } from '../common/constant'; const DEFAULT_CONFIG = { moduleNameMapper: { '\\.(css|less|scss)$': JEST_STYLE_MOCK_FILE, - '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': JEST_FILE_MOCK_FILE + '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': JEST_FILE_MOCK_FILE, }, setupFilesAfterEnv: [JEST_SETUP_FILE], moduleFileExtensions: ['js', 'jsx', 'vue', 'ts', 'tsx'], transform: { '\\.(vue)$': 'vue-jest', - '\\.(js|jsx|ts|tsx)$': 'babel-jest' + '\\.(js|jsx|ts|tsx)$': 'babel-jest', }, transformIgnorePatterns: ['/node_modules/(?!(@vant/cli))/'], snapshotSerializers: ['jest-serializer-vue'], collectCoverage: true, collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx,vue}', '!**/demo/**'], coverageReporters: ['html', 'lcov', 'text-summary'], - coverageDirectory: './test/coverage' + coverageDirectory: './test/coverage', }; function readRootConfig() { @@ -38,5 +38,5 @@ function readRootConfig() { module.exports = { ...DEFAULT_CONFIG, - ...readRootConfig() + ...readRootConfig(), }; diff --git a/packages/vant-cli/src/config/postcss.config.ts b/packages/vant-cli/src/config/postcss.config.ts index fbe328c58..51fbb6c5e 100644 --- a/packages/vant-cli/src/config/postcss.config.ts +++ b/packages/vant-cli/src/config/postcss.config.ts @@ -7,20 +7,20 @@ type PostcssConfig = object & { function mergePostcssConfig(config1: PostcssConfig, config2: PostcssConfig) { const plugins = { ...config1.plugins, - ...config2.plugins + ...config2.plugins, }; return { ...config1, ...config2, - plugins + plugins, }; } const DEFAULT_CONFIG = { plugins: { - autoprefixer: {} - } + autoprefixer: {}, + }, }; module.exports = mergePostcssConfig(DEFAULT_CONFIG, getPostcssConfig()); diff --git a/packages/vant-cli/src/config/webpack.base.ts b/packages/vant-cli/src/config/webpack.base.ts index 55477aa1b..952c94b95 100644 --- a/packages/vant-cli/src/config/webpack.base.ts +++ b/packages/vant-cli/src/config/webpack.base.ts @@ -6,14 +6,14 @@ import { CACHE_DIR, STYLE_EXTS, SCRIPT_EXTS, - POSTCSS_CONFIG_FILE + POSTCSS_CONFIG_FILE, } from '../common/constant'; const CACHE_LOADER = { loader: 'cache-loader', options: { - cacheDirectory: CACHE_DIR - } + cacheDirectory: CACHE_DIR, + }, }; const CSS_LOADERS = [ @@ -23,16 +23,16 @@ const CSS_LOADERS = [ loader: 'postcss-loader', options: { config: { - path: POSTCSS_CONFIG_FILE - } - } - } + path: POSTCSS_CONFIG_FILE, + }, + }, + }, ]; export const baseConfig = { mode: 'development', resolve: { - extensions: [...SCRIPT_EXTS, ...STYLE_EXTS] + extensions: [...SCRIPT_EXTS, ...STYLE_EXTS], }, module: { rules: [ @@ -44,26 +44,26 @@ export const baseConfig = { loader: 'vue-loader', options: { compilerOptions: { - preserveWhitespace: false - } - } - } - ] + preserveWhitespace: false, + }, + }, + }, + ], }, { test: /\.(js|ts|jsx|tsx)$/, exclude: /node_modules\/(?!(@vant\/cli))/, - use: [CACHE_LOADER, 'babel-loader'] + use: [CACHE_LOADER, 'babel-loader'], }, { test: /\.css$/, sideEffects: true, - use: CSS_LOADERS + use: CSS_LOADERS, }, { test: /\.less$/, sideEffects: true, - use: [...CSS_LOADERS, 'less-loader'] + use: [...CSS_LOADERS, 'less-loader'], }, { test: /\.scss$/, @@ -73,22 +73,22 @@ export const baseConfig = { { loader: 'sass-loader', options: { - implementation: sass - } - } - ] + implementation: sass, + }, + }, + ], }, { test: /\.md$/, - use: [CACHE_LOADER, 'vue-loader', '@vant/markdown-loader'] - } - ] + use: [CACHE_LOADER, 'vue-loader', '@vant/markdown-loader'], + }, + ], }, plugins: [ new VueLoaderPlugin(), new FriendlyErrorsPlugin({ clearConsole: false, - logLevel: 'WARNING' - }) - ] + logLevel: 'WARNING', + }), + ], }; diff --git a/packages/vant-cli/src/config/webpack.package.ts b/packages/vant-cli/src/config/webpack.package.ts index ceaf94af8..f87f0918f 100644 --- a/packages/vant-cli/src/config/webpack.package.ts +++ b/packages/vant-cli/src/config/webpack.package.ts @@ -14,7 +14,7 @@ export function getPackageConfig(isMinify: boolean) { { mode: 'production', entry: { - [name]: join(ES_DIR, 'index.js') + [name]: join(ES_DIR, 'index.js'), }, stats: 'none', output: { @@ -24,20 +24,20 @@ export function getPackageConfig(isMinify: boolean) { filename: isMinify ? '[name].min.js' : '[name].js', umdNamedDefine: true, // https://github.com/webpack/webpack/issues/6522 - globalObject: "typeof self !== 'undefined' ? self : this" + globalObject: "typeof self !== 'undefined' ? self : this", }, externals: { vue: { root: 'Vue', commonjs: 'vue', commonjs2: 'vue', - amd: 'vue' - } + amd: 'vue', + }, }, performance: false, optimization: { - minimize: isMinify - } + minimize: isMinify, + }, }, getWebpackConfig() ); diff --git a/packages/vant-cli/src/config/webpack.site.dev.ts b/packages/vant-cli/src/config/webpack.site.dev.ts index 1c3c10041..0c503a285 100644 --- a/packages/vant-cli/src/config/webpack.site.dev.ts +++ b/packages/vant-cli/src/config/webpack.site.dev.ts @@ -10,7 +10,7 @@ import { VantCliSitePlugin } from '../compiler/vant-cli-site-plugin'; import { GREEN, SITE_MODILE_SHARED_FILE, - SITE_DESKTOP_SHARED_FILE + SITE_DESKTOP_SHARED_FILE, } from '../common/constant'; export function getSiteDevBaseConfig() { @@ -43,7 +43,7 @@ export function getSiteDevBaseConfig() { return merge(baseConfig as any, { entry: { 'site-desktop': [join(__dirname, '../../site/desktop/main.js')], - 'site-mobile': [join(__dirname, '../../site/mobile/main.js')] + 'site-mobile': [join(__dirname, '../../site/mobile/main.js')], }, devServer: { port: 8080, @@ -51,16 +51,16 @@ export function getSiteDevBaseConfig() { host: '0.0.0.0', stats: 'errors-only', publicPath: '/', - disableHostCheck: true + disableHostCheck: true, }, resolve: { alias: { 'site-mobile-shared': SITE_MODILE_SHARED_FILE, - 'site-desktop-shared': SITE_DESKTOP_SHARED_FILE - } + 'site-desktop-shared': SITE_DESKTOP_SHARED_FILE, + }, }, output: { - chunkFilename: '[name].js' + chunkFilename: '[name].js', }, optimization: { splitChunks: { @@ -69,15 +69,15 @@ export function getSiteDevBaseConfig() { chunks: 'all', minChunks: 2, minSize: 0, - name: 'chunks' - } - } - } + name: 'chunks', + }, + }, + }, }, plugins: [ new WebpackBar({ name: 'Vant Cli', - color: GREEN + color: GREEN, }), new VantCliSitePlugin(), new HtmlWebpackPlugin({ @@ -87,7 +87,7 @@ export function getSiteDevBaseConfig() { chunks: ['chunks', 'site-desktop'], template: join(__dirname, '../../site/desktop/index.html'), filename: 'index.html', - baiduAnalytics + baiduAnalytics, }), new HtmlWebpackPlugin({ title, @@ -96,9 +96,9 @@ export function getSiteDevBaseConfig() { chunks: ['chunks', 'site-mobile'], template: join(__dirname, '../../site/mobile/index.html'), filename: 'mobile.html', - baiduAnalytics - }) - ] + baiduAnalytics, + }), + ], }); } diff --git a/packages/vant-cli/src/config/webpack.site.prd.ts b/packages/vant-cli/src/config/webpack.site.prd.ts index 1a68b0aa1..93ddca3de 100644 --- a/packages/vant-cli/src/config/webpack.site.prd.ts +++ b/packages/vant-cli/src/config/webpack.site.prd.ts @@ -18,8 +18,8 @@ export function getSitePrdConfig() { publicPath, path: outputDir, filename: '[name].[hash:8].js', - chunkFilename: 'async_[name].[chunkhash:8].js' - } + chunkFilename: 'async_[name].[chunkhash:8].js', + }, }, getWebpackConfig() ); diff --git a/packages/vant-cli/yarn.lock b/packages/vant-cli/yarn.lock index f80fbd335..71f37f4f2 100644 --- a/packages/vant-cli/yarn.lock +++ b/packages/vant-cli/yarn.lock @@ -1466,13 +1466,6 @@ resolved "https://registry.npm.taobao.org/@types/source-list-map/download/@types/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" integrity sha1-AHiDYGP/rxdBI0m7o2QIfgrALsk= -"@types/source-map@^0.5.7": - version "0.5.7" - resolved "https://registry.npm.taobao.org/@types/source-map/download/@types/source-map-0.5.7.tgz#165eeb583c1ef00196fe4ef4da5d7832b03b275b" - integrity sha1-Fl7rWDwe8AGW/k702l14MrA7J1s= - dependencies: - source-map "*" - "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.npm.taobao.org/@types/stack-utils/download/@types/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" @@ -1562,59 +1555,59 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^2.12.0": - version "2.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.12.0.tgz#0da7cbca7b24f4c6919e9eb31c704bfb126f90ad" - integrity sha512-1t4r9rpLuEwl3hgt90jY18wJHSyb0E3orVL3DaqwmpiSDHmHiSspVsvsFF78BJ/3NNG3qmeso836jpuBWYziAA== +"@typescript-eslint/eslint-plugin@^2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.16.0.tgz#bf339b7db824c7cc3fd1ebedbc88dd17016471af" + integrity sha512-TKWbeFAKRPrvKiR9GNxErQ8sELKqg1ZvXi6uho07mcKShBnCnqNpDQWP01FEvWKf0bxM2g7uQEI5MNjSNqvUpQ== dependencies: - "@typescript-eslint/experimental-utils" "2.12.0" + "@typescript-eslint/experimental-utils" "2.16.0" eslint-utils "^1.4.3" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@2.12.0": - version "2.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.12.0.tgz#e0a76ffb6293e058748408a191921e453c31d40d" - integrity sha512-jv4gYpw5N5BrWF3ntROvCuLe1IjRenLy5+U57J24NbPGwZFAjhnM45qpq0nDH1y/AZMb3Br25YiNVwyPbz6RkA== +"@typescript-eslint/experimental-utils@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.16.0.tgz#bba65685728c532e0ddc811a0376e8d38e671f77" + integrity sha512-bXTmAztXpqxliDKZgvWkl+5dHeRN+jqXVZ16peKKFzSXVzT6mz8kgBpHiVzEKO2NZ8OCU7dG61K9sRS/SkUUFQ== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.12.0" + "@typescript-eslint/typescript-estree" "2.16.0" eslint-scope "^5.0.0" -"@typescript-eslint/parser@^2.12.0": - version "2.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.12.0.tgz#393f1604943a4ca570bb1a45bc8834e9b9158884" - integrity sha512-lPdkwpdzxEfjI8TyTzZqPatkrswLSVu4bqUgnB03fHSOwpC7KSerPgJRgIAf11UGNf7HKjJV6oaPZI4AghLU6g== +"@typescript-eslint/parser@^2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.16.0.tgz#d0c0135a8fdb915f670802ddd7c1ba457c1b4f9d" + integrity sha512-+w8dMaYETM9v6il1yYYkApMSiwgnqXWJbXrA94LAWN603vXHACsZTirJduyeBOJjA9wT6xuXe5zZ1iCUzoxCfw== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.12.0" - "@typescript-eslint/typescript-estree" "2.12.0" + "@typescript-eslint/experimental-utils" "2.16.0" + "@typescript-eslint/typescript-estree" "2.16.0" eslint-visitor-keys "^1.1.0" -"@typescript-eslint/typescript-estree@2.12.0": - version "2.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.12.0.tgz#bd9e547ccffd17dfab0c3ab0947c80c8e2eb914c" - integrity sha512-rGehVfjHEn8Frh9UW02ZZIfJs6SIIxIu/K1bbci8rFfDE/1lQ8krIJy5OXOV3DVnNdDPtoiPOdEANkLMrwXbiQ== +"@typescript-eslint/typescript-estree@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.16.0.tgz#b444943a76c716ed32abd08cbe96172d2ca0ab75" + integrity sha512-hyrCYjFHISos68Bk5KjUAXw0pP/455qq9nxqB1KkT67Pxjcfw+r6Yhcmqnp8etFL45UexCHUMrADHH7dI/m2WQ== dependencies: debug "^4.1.1" eslint-visitor-keys "^1.1.0" glob "^7.1.6" is-glob "^4.0.1" - lodash.unescape "4.0.1" + lodash "^4.17.15" semver "^6.3.0" tsutils "^3.17.1" -"@vant/eslint-config@^1.5.1": - version "1.5.1" - resolved "https://registry.yarnpkg.com/@vant/eslint-config/-/eslint-config-1.5.1.tgz#cfa4418b0b43ca0afb7dbda6973b2b1450306fb2" - integrity sha512-jGN4GJw+MYeXGH9XsYeaWJMpD8TwS1fx4qw4kGXoud8VM6tMdUToxodzJRERoHlDgnpxsqwd4bOf1aztoVuuHg== +"@vant/eslint-config@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@vant/eslint-config/-/eslint-config-2.0.0.tgz#cbfc1daaa42c5ffcf9fa4341d867149737986967" + integrity sha512-W6v4gNieMTGOGWSJVuSSdYjHy3giELbJibFlCMuCGK8VE8MFMSwz2M/riG/NxEOoKx51J1MVH9rFy3lvWuMH6g== dependencies: - "@typescript-eslint/eslint-plugin" "^2.12.0" - "@typescript-eslint/parser" "^2.12.0" + "@typescript-eslint/eslint-plugin" "^2.16.0" + "@typescript-eslint/parser" "^2.16.0" eslint-config-airbnb-base "^14.0.0" - eslint-plugin-import "^2.19.1" - eslint-plugin-vue "^6.0.1" + eslint-plugin-import "^2.20.0" + eslint-plugin-vue "^6.1.2" "@vant/markdown-loader@^2.3.0": version "2.3.0" @@ -1954,7 +1947,7 @@ acorn-globals@^4.1.0: acorn "^6.0.1" acorn-walk "^6.0.1" -acorn-jsx@^5.0.0, acorn-jsx@^5.1.0: +acorn-jsx@^5.1.0: version "5.1.0" resolved "https://registry.npm.taobao.org/acorn-jsx/download/acorn-jsx-5.1.0.tgz?cache=0&sync_timestamp=1570991459312&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn-jsx%2Fdownload%2Facorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" integrity sha1-KUrbcbVzmLBoABXwo4xWPuHbU4Q= @@ -1974,11 +1967,6 @@ acorn@^6.0.1, acorn@^6.2.1: resolved "https://registry.npm.taobao.org/acorn/download/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e" integrity sha1-AIdQkRn/pPwKAEHR6TpBfmjLhW4= -acorn@^6.0.7: - version "6.4.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784" - integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw== - acorn@^7.1.0: version "7.1.0" resolved "https://registry.npm.taobao.org/acorn/download/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" @@ -4381,10 +4369,10 @@ eslint-module-utils@^2.4.1: debug "^2.6.9" pkg-dir "^2.0.0" -eslint-plugin-import@^2.19.1: - version "2.19.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.19.1.tgz#5654e10b7839d064dd0d46cd1b88ec2133a11448" - integrity sha512-x68131aKoCZlCae7rDXKSAQmbT5DQuManyXo2sK6fJJ0aK5CWAkv6A6HJZGgqC8IhjQxYPgo6/IY4Oz8AFsbBw== +eslint-plugin-import@^2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.0.tgz#d749a7263fb6c29980def8e960d380a6aa6aecaa" + integrity sha512-NK42oA0mUc8Ngn4kONOPsPB1XhbUvNHqF+g307dPV28aknPoiNnKLFd9em4nkswwepdF5ouieqv5Th/63U7YJQ== dependencies: array-includes "^3.0.3" array.prototype.flat "^1.2.1" @@ -4399,14 +4387,15 @@ eslint-plugin-import@^2.19.1: read-pkg-up "^2.0.0" resolve "^1.12.0" -eslint-plugin-vue@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-6.0.1.tgz#166d3eb24cf290f3ff24d44fe9fca496f3924fc2" - integrity sha512-5tgFPcxGDKjfVB/6Yi56bKiWxygUibfZmzSh26Np3kuwAk/lfaGbVld+Yt+MPgD84ppvcachtiL4/winsXLjXA== +eslint-plugin-vue@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-6.1.2.tgz#4b05c28c83c0ec912669b64dbd998bb8bf692ef6" + integrity sha512-M75oAB+2a/LNkLKRbeEaS07EjzjIUaV7/hYoHAfRFeeF8ZMmCbahUn8nQLsLP85mkar24+zDU3QW2iT1JRsACw== dependencies: - vue-eslint-parser "^6.0.5" + semver "^5.6.0" + vue-eslint-parser "^7.0.0" -eslint-scope@^4.0.0, eslint-scope@^4.0.3: +eslint-scope@^4.0.3: version "4.0.3" resolved "https://registry.npm.taobao.org/eslint-scope/download/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" integrity sha1-ygODMxD2iJoyZHgaqC5j65z+eEg= @@ -4429,7 +4418,7 @@ eslint-utils@^1.4.3: dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: +eslint-visitor-keys@^1.1.0: version "1.1.0" resolved "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha1-4qgs6oT/JGrW+1f5veW0ZiFFnsI= @@ -4477,15 +4466,6 @@ eslint@^6.8.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" - integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== - dependencies: - acorn "^6.0.7" - acorn-jsx "^5.0.0" - eslint-visitor-keys "^1.0.0" - espree@^6.1.2: version "6.1.2" resolved "https://registry.npm.taobao.org/espree/download/espree-6.1.2.tgz#6c272650932b4f91c3714e5e7b5f5e2ecf47262d" @@ -7263,11 +7243,6 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash.unescape@4.0.1: - version "4.0.1" - resolved "https://registry.npm.taobao.org/lodash.unescape/download/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" - integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= - lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.npm.taobao.org/lodash.uniq/download/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" @@ -10150,11 +10125,6 @@ source-map-url@^0.4.0: resolved "https://registry.npm.taobao.org/source-map-url/download/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@*: - version "0.7.3" - resolved "https://registry.npm.taobao.org/source-map/download/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha1-UwL4FpAxc1ImVECS5kmB91F1A4M= - source-map@^0.5.0, source-map@^0.5.6: version "0.5.7" resolved "https://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -11432,17 +11402,17 @@ vm-browserify@^1.0.1: resolved "https://registry.npm.taobao.org/vm-browserify/download/vm-browserify-1.1.2.tgz?cache=0&sync_timestamp=1572870772154&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvm-browserify%2Fdownload%2Fvm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" integrity sha1-eGQcSIuObKkadfUR56OzKobl3aA= -vue-eslint-parser@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-6.0.5.tgz#c1c067c2755748e28f3872cd42e8c1c4c1a8059f" - integrity sha512-Bvjlx7rH1Ulvus56KHeLXOjEi3JMOYTa1GAqZr9lBQhd8weK8mV7U7V2l85yokBZEWHJQjLn6X3nosY8TzkOKg== +vue-eslint-parser@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-7.0.0.tgz#a4ed2669f87179dedd06afdd8736acbb3a3864d6" + integrity sha512-yR0dLxsTT7JfD2YQo9BhnQ6bUTLsZouuzt9SKRP7XNaZJV459gvlsJo4vT2nhZ/2dH9j3c53bIx9dnqU2prM9g== dependencies: debug "^4.1.1" - eslint-scope "^4.0.0" - eslint-visitor-keys "^1.0.0" - espree "^5.0.0" + eslint-scope "^5.0.0" + eslint-visitor-keys "^1.1.0" + espree "^6.1.2" esquery "^1.0.1" - lodash "^4.17.11" + lodash "^4.17.15" vue-hot-reload-api@^2.3.0: version "2.3.4"