Skip to content

Commit 5bca4fd

Browse files
style: upgrade dependencies and fix lint issues due to this upgrade
1 parent aa11adb commit 5bca4fd

File tree

18 files changed

+688
-893
lines changed

18 files changed

+688
-893
lines changed

.eslintrc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66
"sourceType": "module"
77
},
88
"plugins": [
9-
"jest"
9+
"jest",
10+
"vue"
1011
],
1112
"extends": [
12-
"plugin:vue/recommended"
13+
"plugin:vue/essential"
1314
],
1415
"env": {
1516
"jest/globals": true
1617
},
1718
"rules": {
1819
"arrow-parens": 0,
19-
"generator-star-spacing": 0,
20-
"vue/valid-v-on": 0,
20+
"generator-star-spacing": "off",
21+
"indent": "off",
22+
"indent-legacy": ["error", 2],
2123
"max-depth": [
2224
"error",
2325
4
@@ -37,9 +39,10 @@
3739
"complexity": [
3840
"error",
3941
{
40-
"max": 5
42+
"max": 6
4143
}
4244
],
45+
"vue/valid-v-on": 0,
4346
"vue/v-bind-style": [
4447
"error",
4548
"shorthand"

build/loaders/component-example-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const prettier = require('prettier')
44
const path = require('path')
55
const compiler = require('vue-template-compiler')
66
const { resolvePath } = require('../config')
7-
const { transform } = require('babel-core')
7+
const { transform } = require('@babel/core')
88
const transpile = code => transform(code).code
99
const { getIndentedSource } = require('../../docs/app/mixins/codeSource')
1010

build/local/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const app = express()
1111
const compiler = webpack(webpackConfig)
1212
const devMiddlewareInstance = devMiddleware(compiler, {
1313
publicPath: config.public,
14-
quiet: true
14+
logLevel: 'silent'
1515
})
1616

1717
const hotMiddlewareInstance = hotMiddleware(compiler, {

docs/app/pages/Components/List/List.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<p>Lists can have expansion panels to reveal more options:</p>
5454
<code-example title="Expansion" :component="examples['list-expansion']" />
5555

56-
<api-item title="API - md-content">
56+
<api-item title="API - md-list">
5757
Coming soon...
5858
</api-item>
5959
</div>

package.json

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -51,76 +51,76 @@
5151
"@babel/polyfill": "^7.0.0-beta.38",
5252
"@babel/preset-env": "^7.0.0-beta.38",
5353
"@babel/preset-es2015": "^7.0.0-beta.38",
54-
"autoprefixer": "^7.1.6",
55-
"avoriaz": "^6.0.1",
56-
"axios": "^0.17.0",
57-
"babel-eslint": "^8.0.1",
54+
"autoprefixer": "^7.2.5",
55+
"avoriaz": "^6.3.0",
56+
"axios": "^0.17.1",
57+
"babel-eslint": "^8.2.1",
58+
"babel-jest": "^22.1.0",
5859
"babel-loader": "8.0.0-beta.0",
5960
"chalk": "^2.3.0",
6061
"clipboard": "^1.7.1",
6162
"commitizen": "^2.9.6",
6263
"concat": "^1.0.3",
63-
"connect-history-api-fallback": "^1.4.0",
64-
"conventional-changelog": "^1.1.6",
64+
"connect-history-api-fallback": "^1.5.0",
65+
"conventional-changelog": "^1.1.10",
6566
"conventional-changelog-vue-material": "^0.0.1",
66-
"copy-webpack-plugin": "^4.2.0",
67-
"css-loader": "^0.28.7",
68-
"css-mqpacker": "^6.0.1",
67+
"copy-webpack-plugin": "^4.3.1",
68+
"css-loader": "^0.28.9",
69+
"css-mqpacker": "^6.0.2",
6970
"cz-conventional-changelog": "^2.1.0",
7071
"date-fns": "^1.29.0",
7172
"deepmerge": "^2.0.1",
72-
"eslint": "^4.10.0",
73-
"eslint-config-standard": "^10.2.1",
73+
"eslint": "^4.16.0",
74+
"eslint-config-standard": "^11.0.0-beta.0",
7475
"eslint-plugin-import": "^2.8.0",
75-
"eslint-plugin-jest": "^21.2.0",
76+
"eslint-plugin-jest": "^21.7.0",
7677
"eslint-plugin-node": "^5.2.1",
7778
"eslint-plugin-promise": "^3.6.0",
7879
"eslint-plugin-standard": "^3.0.1",
79-
"eslint-plugin-vue": "^3.13.1",
80+
"eslint-plugin-vue": "^4.2.2",
8081
"eventsource-polyfill": "^0.9.6",
8182
"express": "^4.16.2",
8283
"extract-text-webpack-plugin": "^3.0.2",
8384
"fast-deep-equal": "^1.0.0",
84-
"file-loader": "^1.1.5",
85+
"file-loader": "^1.1.6",
8586
"friendly-errors-webpack-plugin": "^1.6.1",
8687
"fuzzysearch": "^1.0.3",
8788
"github-release-cli": "^0.3.0",
8889
"highlight.js": "^9.12.0",
8990
"html-webpack-plugin": "^2.30.1",
9091
"is-firefox": "^1.0.3",
9192
"is-promise": "^2.1.0",
92-
"jest": "^21.2.1",
93-
"jest-css-modules": "^1.1.0",
94-
"jest-vue": "^0.8.2",
93+
"jest": "^22.1.4",
9594
"node-sass": "^4.7.2",
96-
"offline-plugin": "^4.8.4",
95+
"offline-plugin": "^4.9.0",
9796
"optimize-css-assets-webpack-plugin": "^3.2.0",
9897
"optimize-js-plugin": "^0.0.4",
9998
"ora": "^1.3.0",
10099
"popper.js": "^1.12.9",
101-
"postcss": "^6.0.14",
102-
"preload-webpack-plugin": "^2.0.0",
100+
"postcss": "^6.0.16",
101+
"preload-webpack-plugin": "^2.2.0",
103102
"prerender-spa-plugin": "^2.1.0",
104-
"prettier": "^1.8.2",
103+
"prettier": "^1.10.2",
105104
"pretty": "^2.0.0",
106105
"raf": "^3.4.0",
107106
"sass-loader": "^6.0.6",
108-
"sinon": "^4.1.1",
107+
"sinon": "^4.2.2",
109108
"url-loader": "^0.6.2",
110-
"vue": "^2.5.9",
109+
"vue": "^2.5.13",
111110
"vue-ga": "^1.0.0",
112-
"vue-i18n": "^7.3.2",
113-
"vue-loader": "^13.4.0",
111+
"vue-i18n": "^7.4.1",
112+
"vue-jest": "^2.0.0",
113+
"vue-loader": "^13.7.0",
114114
"vue-router": "^3.0.1",
115-
"vue-style-loader": "^3.0.3",
116-
"vue-template-compiler": "^2.5.3",
115+
"vue-style-loader": "^3.1.1",
116+
"vue-template-compiler": "^2.5.13",
117117
"vuelidate": "^0.6.1",
118118
"vuex": "^3.0.1",
119119
"vuex-router-sync": "^5.0.0",
120-
"webpack": "^3.8.1",
121-
"webpack-bundle-analyzer": "^2.9.0",
122-
"webpack-dev-middleware": "^1.12.0",
123-
"webpack-hot-middleware": "^2.20.0",
120+
"webpack": "^3.10.0",
121+
"webpack-bundle-analyzer": "^2.9.2",
122+
"webpack-dev-middleware": "^2.0.4",
123+
"webpack-hot-middleware": "^2.21.0",
124124
"webpack-merge": "^4.1.1"
125125
},
126126
"config": {
@@ -146,8 +146,7 @@
146146
],
147147
"transform": {
148148
"^.+\\.js?$": "babel-jest",
149-
"^.+\\.vue?$": "jest-vue",
150-
".*": "jest-css-modules"
149+
"^.+\\.vue?$": "vue-jest"
151150
},
152151
"mapCoverage": true,
153152
"setupTestFrameworkScriptFile": "<rootDir>/test/setup.js",

src/components/MdApp/MdApp.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
'md-app-content'
99
]
1010
11+
function isValidChild (componentOptions) {
12+
return componentOptions && componentTypes.includes(componentOptions.tag)
13+
}
14+
1115
function buildSlots (children, context, functionalContext, options) {
1216
let slots = []
1317
@@ -16,7 +20,7 @@
1620
const data = child.data
1721
const componentOptions = child.componentOptions
1822
19-
if ((data && componentTypes.includes(data.slot)) || (componentOptions && componentTypes.includes(componentOptions.tag))) {
23+
if ((data && componentTypes.includes(data.slot)) || isValidChild(componentOptions)) {
2024
child.data.slot = data.slot || componentOptions.tag
2125
child.data.provide = options.Ctor.options.provide
2226
child.context = context

src/components/MdApp/MdAppMixin.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ export default {
5858
}
5959
},
6060
computed: {
61+
isFixed () {
62+
return this.mdMode && this.mdMode !== 'fixed'
63+
},
64+
isMini () {
65+
return this.MdApp.drawer.mode === 'persistent' && this.MdApp.drawer.submode === 'mini'
66+
},
6167
contentStyles () {
6268
const drawer = this.MdApp.drawer
6369

@@ -68,15 +74,14 @@ export default {
6874
}
6975
},
7076
containerStyles () {
71-
const drawer = this.MdApp.drawer
7277
let styles = {}
7378

74-
if (this.mdMode && this.mdMode !== 'fixed') {
79+
if (this.isFixed) {
7580
styles['margin-top'] = this.MdApp.toolbar.initialHeight + 'px'
7681
}
7782

78-
if (drawer.mode === 'persistent' && drawer.submode === 'mini') {
79-
styles['padding-left'] = !drawer.active ? drawer.initialWidth + 'px' : 0
83+
if (this.isMini) {
84+
styles['padding-left'] = !this.MdApp.drawer.active ? this.MdApp.drawer.initialWidth + 'px' : 0
8085
}
8186

8287
return styles

src/components/MdAutocomplete/MdAutocomplete.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,17 @@
9898
return 'md-autocomplete-box-content'
9999
}
100100
},
101+
shouldFilter () {
102+
return this.mdOptions[0] && this.searchTerm
103+
},
101104
filteredStaticOptions () {
102105
if (this.isPromise(this.mdOptions)) {
103106
return false
104107
}
105108
106109
const firstItem = this.mdOptions[0]
107110
108-
if (this.mdOptions[0] && this.searchTerm) {
111+
if (this.shouldFilter) {
109112
if (typeof firstItem === 'string') {
110113
return this.filterByString()
111114
} else if (typeof firstItem === 'object') {

src/components/MdDatepicker/MdDatepickerDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<div class="md-datepicker-body-content" :style="contentStyles">
2828
<transition name="md-datepicker-view">
2929
<transition-group class="md-datepicker-panel md-datepicker-calendar" :class="calendarClasses" tag="div" name="md-datepicker-month" v-if="currentView === 'day'">
30-
<div class="md-datepicker-panel md-datepicker-month" v-for="(month, index) in [currentDate]" :key="month.getMonth()">
30+
<div class="md-datepicker-panel md-datepicker-month" v-for="month in [currentDate]" :key="month.getMonth()">
3131
<md-button class="md-dense md-datepicker-month-trigger" @click="currentView = 'month'">{{ currentMonthName }} {{ currentYear }}</md-button>
3232

3333
<div class="md-datepicker-week">

src/components/MdField/MdSelect/MdSelect.vue

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
immediate: true,
125125
handler (isMultiple) {
126126
this.MdSelect.multiple = isMultiple
127-
this.$nextTick(() => this.initialLocalValueByDefault())
127+
this.$nextTick(this.initialLocalValueByDefault)
128128
}
129129
}
130130
},
@@ -232,6 +232,7 @@
232232
if (!this.localValue) {
233233
this.initialLocalValueByDefault()
234234
}
235+
235236
let content = []
236237
237238
this.localValue.forEach(item => {
@@ -251,15 +252,30 @@
251252
this.setContentByValue()
252253
}
253254
},
255+
isLocalValueSet () {
256+
return this.localValue !== undefined && this.localValue !== null
257+
},
258+
setLocalValueIfMultiple () {
259+
if (isLocalValueSet()) {
260+
this.localValue = [this.localValue]
261+
} else {
262+
this.localValue = []
263+
}
264+
},
265+
setLocalValueIfNotMultiple () {
266+
if (this.localValue.length > 0) {
267+
this.localValue = this.localValue[0]
268+
} else {
269+
this.localValue = null
270+
}
271+
},
254272
initialLocalValueByDefault () {
255273
let isArray = Array.isArray(this.localValue)
274+
256275
if (this.multiple && !isArray) {
257-
let isSet = this.localValue !== undefined && this.localValue !== null
258-
this.localValue = isSet ? [this.localValue] : []
259-
return
260-
}
261-
if (!this.multiple && isArray) {
262-
this.localValue = this.localValue.length > 0 ? this.localValue[0] : null
276+
this.localValue = this.setLocalValueIfMultiple()
277+
} else if (!this.multiple && isArray) {
278+
this.localValue = this.setLocalValueIfNotMultiple()
263279
}
264280
},
265281
emitSelected (value) {

src/components/MdImage/MdImage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
</style>
1414

15-
<script lang="babel">
15+
<script>
1616
import MdComponent from 'core/MdComponent'
1717
1818
export default new MdComponent({

0 commit comments

Comments
 (0)