Skip to content

Commit

Permalink
improvement: 更新elint规则已经相关合法性修改 (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
luofann authored and pagezz-canway committed Apr 16, 2019
1 parent 2c590f7 commit b017596
Show file tree
Hide file tree
Showing 148 changed files with 16,512 additions and 16,214 deletions.
498 changes: 466 additions & 32 deletions pipeline/blueflow/.eslintrc.js

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions pipeline/blueflow/builds/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@ module.exports = {
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /node_modules/
exclude: /node_modules/,
options: {
formatter: require('eslint-friendly-formatter')
}
},
{
test: /\.s?[ac]ss$/,
use: [
process.env.NODE_ENV === 'development' ?
'style-loader' :
MiniCssExtractPlugin.loader,
process.env.NODE_ENV === 'development'
? 'style-loader'
: MiniCssExtractPlugin.loader,
'css-loader',
'postcss-loader',
'sass-loader'
Expand All @@ -94,14 +97,14 @@ module.exports = {
}
],
exclude: [
path.join(__dirname, "../node_modules")
path.join(__dirname, '../node_modules')
]
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: [
path.join(__dirname, "../node_modules")
path.join(__dirname, '../node_modules')
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion pipeline/blueflow/builds/webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const webpackBaseConfig = require('./webpack.base.js')

// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin

module.exports = merge( webpackBaseConfig, {
module.exports = merge(webpackBaseConfig, {
plugins: [
new webpack.DefinePlugin({
'process.env': {
Expand Down
15 changes: 11 additions & 4 deletions pipeline/blueflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"vuex": "^3.0.1"
},
"devDependencies": {
"acorn": "^6.1.1",
"babel-core": "^6.26.3",
"babel-eslint": "8.0.1",
"babel-eslint": "^10.0.1",
"babel-loader": "^7.1.4",
"babel-plugin-component": "^1.1.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
Expand All @@ -41,9 +42,15 @@
"cross-env": "^5.1.6",
"css-loader": "^0.28.11",
"cssnano": "^3.10.0",
"eslint": "^4.19.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-vue": "^4.5.0",
"eslint": "^5.15.1",
"eslint-config-standard": "^12.0.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.1.2",
"eslint-plugin-import": "^2.17.1",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^5.2.2",
"expose-loader": "^0.7.5",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion pipeline/blueflow/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ module.exports = {
// autoprefixer: false
// }
}
}
}
177 changes: 88 additions & 89 deletions pipeline/blueflow/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,105 +10,104 @@
* specific language governing permissions and limitations under the License.
*/
<template>
<div id="app">
<navigator
v-if="!hideHeader"
:appmakerDataLoading="appmakerDataLoading"/>
<UserLoginModal ref="userLogin"></UserLoginModal>
<ErrorCodeModal ref="errorModal"></ErrorCodeModal>
<router-view v-if="isRouterAlive"></router-view>
</div>
<div id="app">
<navigator
v-if="!hideHeader"
:appmaker-data-loading="appmakerDataLoading" />
<UserLoginModal ref="userLogin"></UserLoginModal>
<ErrorCodeModal ref="errorModal"></ErrorCodeModal>
<router-view v-if="isRouterAlive"></router-view>
</div>
</template>
<script>
import '@/utils/i18n.js'
import Vue from 'vue'
import { mapState, mapMutations, mapActions } from 'vuex'
import bus from '@/utils/bus.js'
import { errorHandler } from '@/utils/errorHandler.js'
import UserLoginModal from '@/components/common/modal/UserLoginModal.vue'
import ErrorCodeModal from '@/components/common/modal/ErrorCodeModal.vue'
import Navigator from '@/components/layout/Navigator.vue'
import '@/utils/i18n.js'
import { mapState, mapMutations, mapActions } from 'vuex'
import bus from '@/utils/bus.js'
import { errorHandler } from '@/utils/errorHandler.js'
import UserLoginModal from '@/components/common/modal/UserLoginModal.vue'
import ErrorCodeModal from '@/components/common/modal/ErrorCodeModal.vue'
import Navigator from '@/components/layout/Navigator.vue'
export default {
name: 'App',
components: {
Navigator,
UserLoginModal,
ErrorCodeModal
},
provide () {
return {
reload: this.reload
}
},
data () {
return {
isRouterAlive: true,
appmakerDataLoading: false // 轻应用加载 app 详情
}
},
computed: {
...mapState({
'hideHeader': state => state.hideHeader,
'viewMode': state => state.view_mode,
'appId': state => state.app_id
})
},
created () {
/**
* 兼容标准插件配置项里,异步请求用到的全局弹窗提示
*/
window.show_msg = (message, type) => {
this.$bkMessage({
message,
theme: type
export default {
name: 'App',
components: {
Navigator,
UserLoginModal,
ErrorCodeModal
},
provide () {
return {
reload: this.reload
}
},
data () {
return {
isRouterAlive: true,
appmakerDataLoading: false // 轻应用加载 app 详情
}
},
computed: {
...mapState({
'hideHeader': state => state.hideHeader,
'viewMode': state => state.view_mode,
'appId': state => state.app_id
})
}
},
created () {
/**
* 兼容标准插件配置项里,异步请求用到的全局弹窗提示
*/
window.show_msg = (message, type) => {
this.$bkMessage({
message,
theme: type
})
}
if (this.viewMode === 'appmaker') {
this.getAppmakerDetail()
}
},
mounted () {
bus.$on('showLoginModal', (src) => {
this.$refs.userLogin.show(src)
})
bus.$on('showErrorModal', (type, responseText) => {
this.$refs.errorModal.show(type, responseText)
})
bus.$on('showMessage', (info) => {
this.$bkMessage({
message: info.message,
theme: info.theme || 'error'
})
})
},
methods: {
...mapActions('appmaker/', [
'loadAppmakerDetail'
]),
...mapMutations([
'setTemplateId'
]),
async getAppmakerDetail () {
this.appmakerDataLoading = true
try {
const data = await this.loadAppmakerDetail(this.appId)
this.setTemplateId(data.template_id)
} catch (e) {
errorHandler(e, this)
} finally {
this.appmakerDataLoading = false
if (this.viewMode === 'appmaker') {
this.getAppmakerDetail()
}
},
reload () {
this.isRouterAlive = false
this.$nextTick(() => {
this.isRouterAlive = true
mounted () {
bus.$on('showLoginModal', (src) => {
this.$refs.userLogin.show(src)
})
bus.$on('showErrorModal', (type, responseText, title) => {
this.$refs.errorModal.show(type, responseText, title)
})
bus.$on('showMessage', (info) => {
this.$bkMessage({
message: info.message,
theme: info.theme || 'error'
})
})
},
methods: {
...mapActions('appmaker/', [
'loadAppmakerDetail'
]),
...mapMutations([
'setTemplateId'
]),
async getAppmakerDetail () {
this.appmakerDataLoading = true
try {
const data = await this.loadAppmakerDetail(this.appId)
this.setTemplateId(data.template_id)
} catch (e) {
errorHandler(e, this)
} finally {
this.appmakerDataLoading = false
}
},
reload () {
this.isRouterAlive = false
this.$nextTick(() => {
this.isRouterAlive = true
})
}
}
}
}
</script>
<style lang="scss">
@import './scss/app.scss';
Expand Down
7 changes: 3 additions & 4 deletions pipeline/blueflow/src/api/fileDownload.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
* specific language governing permissions and limitations under the License.
*/
export function fileDownload (data, filename) {
const blob = new Blob([data], {type: 'application/octet-stream'})
const blob = new Blob([data], { type: 'application/octet-stream' })
if (typeof window.navigator.msSaveBlob !== 'undefined') {
// hack old IE
window.navigator.msSaveBlob(blob, filename)
}
else {
} else {
const eleLink = document.createElement('a')
const blobURL = window.URL.createObjectURL(blob)
eleLink.style.display = 'none'
Expand All @@ -31,4 +30,4 @@ export function fileDownload (data, filename) {
document.body.removeChild(eleLink)
window.URL.revokeObjectURL(blobURL)
}
}
}
Loading

0 comments on commit b017596

Please sign in to comment.