提交 7400419b 编写于 作者: Q qiang

chore: lint

上级 17a0c3ab
const path = require('path') const path = require('path')
const fs = require('fs')
const hash = require('hash-sum') const hash = require('hash-sum')
const crypto = require('crypto') const crypto = require('crypto')
...@@ -20,7 +21,7 @@ function getCLIContext () { ...@@ -20,7 +21,7 @@ function getCLIContext () {
if (isInHBuilderX) { if (isInHBuilderX) {
return context return context
} }
const pnpmFind = __dirname.match(/.+?[\/\\].pnpm[\/\\]/) const pnpmFind = __dirname.match(/.+?[/\\].pnpm[/\\]/)
if (pnpmFind) { if (pnpmFind) {
const pnpm = pnpmFind[0] const pnpm = pnpmFind[0]
context = path.resolve(pnpm, '../../') context = path.resolve(pnpm, '../../')
......
...@@ -193,7 +193,7 @@ describe('codegen', () => { ...@@ -193,7 +193,7 @@ describe('codegen', () => {
`with(this){return _c('p',{slot:"one"})}` `with(this){return _c('p',{slot:"one"})}`
) )
}) })
it('generate slot with v-for', () => { it('generate slot with v-for', () => {
assertCodegen( assertCodegen(
'<div><slot v-for="item in list"></slot></div>', '<div><slot v-for="item in list"></slot></div>',
......
...@@ -21,6 +21,7 @@ class Upate { ...@@ -21,6 +21,7 @@ class Upate {
get uniId () { get uniId () {
return this._uniId return this._uniId
} }
set uniId (value) { set uniId (value) {
this._uniId = value this._uniId = value
} }
...@@ -28,6 +29,7 @@ class Upate { ...@@ -28,6 +29,7 @@ class Upate {
get appId () { get appId () {
return this._appId return this._appId
} }
set appId (value) { set appId (value) {
this._appId = value this._appId = value
} }
...@@ -35,6 +37,7 @@ class Upate { ...@@ -35,6 +37,7 @@ class Upate {
get compilerVersion () { get compilerVersion () {
return this._compilerVersion return this._compilerVersion
} }
set compilerVersion (value) { set compilerVersion (value) {
this._compilerVersion = value this._compilerVersion = value
} }
...@@ -42,6 +45,7 @@ class Upate { ...@@ -42,6 +45,7 @@ class Upate {
get isAlpha () { get isAlpha () {
return this._isAlpha return this._isAlpha
} }
set isAlpha (value) { set isAlpha (value) {
this._isAlpha = value this._isAlpha = value
} }
...@@ -49,6 +53,7 @@ class Upate { ...@@ -49,6 +53,7 @@ class Upate {
get wt () { get wt () {
return this._wt return this._wt
} }
set wt (value) { set wt (value) {
this._wt = value this._wt = value
} }
...@@ -56,6 +61,7 @@ class Upate { ...@@ -56,6 +61,7 @@ class Upate {
get lc () { get lc () {
return this._lc return this._lc
} }
set lc (value) { set lc (value) {
this._lc = value this._lc = value
} }
...@@ -63,6 +69,7 @@ class Upate { ...@@ -63,6 +69,7 @@ class Upate {
get lcin () { get lcin () {
return this._lcin return this._lcin
} }
set lcin (value) { set lcin (value) {
this._lcin = value this._lcin = value
} }
...@@ -257,17 +264,17 @@ Object.assign(Upate.prototype, { ...@@ -257,17 +264,17 @@ Object.assign(Upate.prototype, {
DEFAULT_INTERVAL: 1000 * 60 * 60 * 24 DEFAULT_INTERVAL: 1000 * 60 * 60 * 24
}) })
function getLc() { function getLc () {
let result = [] const result = []
const locale_dir = path.join(process.env.UNI_CLI_CONTEXT, 'src/locale') const localeDir = path.join(process.env.UNI_CLI_CONTEXT, 'src/locale')
if (!fs.existsSync(locale_dir)) { if (!fs.existsSync(localeDir)) {
return result return result
} }
let files = fs.readdirSync(locale_dir) const files = fs.readdirSync(localeDir)
for (let i = files.length - 1; i >= 0; i--) { for (let i = files.length - 1; i >= 0; i--) {
let filePath = files[i] const filePath = files[i]
let extName = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase() const extName = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase()
if (extName !== 'json') { if (extName !== 'json') {
continue continue
} }
...@@ -300,9 +307,9 @@ module.exports = async function checkUpdate () { ...@@ -300,9 +307,9 @@ module.exports = async function checkUpdate () {
update.uniId = manifest.appid update.uniId = manifest.appid
const appIdKey = process.env.UNI_PLATFORM.includes('quickapp') ? 'package' : 'appid' const appIdKey = process.env.UNI_PLATFORM.includes('quickapp') ? 'package' : 'appid'
update.appId = manifest[process.env.UNI_PLATFORM] ? (manifest[process.env.UNI_PLATFORM][appIdKey] || '') : '' update.appId = manifest[process.env.UNI_PLATFORM] ? (manifest[process.env.UNI_PLATFORM][appIdKey] || '') : ''
const cf = manifest['mp-weixin'] ? manifest['mp-weixin']['cloudfunctionRoot'] : '' const cf = manifest['mp-weixin'] ? manifest['mp-weixin'].cloudfunctionRoot : ''
update.wt = (cf && cf.length) ? 1 : 0 update.wt = (cf && cf.length) ? 1 : 0
update.lc = manifest['locale'] ? manifest['locale'] : '' update.lc = manifest.locale ? manifest.locale : ''
update.lcin = getLc().join(',') update.lcin = getLc().join(',')
update.check() update.check()
} catch (e) { } catch (e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册