Skip to content

Commit

Permalink
Use eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
pespantelis committed Jun 30, 2016
1 parent 58c08b4 commit 5d7b9e0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "vue",
"rules": {
"no-duplicate-imports": 0
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"bugs": "https://github.com/pespantelis/vue-typeahead/issues",
"homepage": "http://pespantelis.github.io/vue-typeahead/",
"scripts": {
"lint": "eslint src demo",
"dev": "webpack-dev-server --content-base demo/ --inline --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
"dist": "rollup src/main.js -o dist/vue-typeahead.js -f cjs"
Expand All @@ -33,6 +34,8 @@
"babel-preset-stage-2": "^6.0.0",
"cross-env": "^1.0.6",
"css-loader": "^0.23.0",
"eslint": "^2.13.1",
"eslint-config-vue": "^1.0.3",
"vue-hot-reload-api": "^1.2.0",
"vue-html-loader": "^1.0.0",
"vue-loader": "^8.3.0",
Expand Down
11 changes: 5 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {util} from 'vue'
import { util } from 'vue'

export default {
data () {
Expand Down Expand Up @@ -57,15 +57,14 @@ export default {
return util.warn('You need to set the `src` property', this)
}

if (this.queryParamName == null) {
if (this.queryParamName === null) {
return this.$http.get(this.src + this.query)
} else {
let queryParam = {
const queryParam = {
[this.queryParamName]: this.query
}
return this.$http.get(this.src, Object.assign(queryParam, this.data))
}

},

reset () {
Expand All @@ -80,7 +79,7 @@ export default {

activeClass (index) {
return {
active: this.current == index
active: this.current === index
}
},

Expand All @@ -93,7 +92,7 @@ export default {
up () {
if (this.current > 0) {
this.current--
} else if (this.current == -1) {
} else if (this.current === -1) {
this.current = this.items.length - 1
} else {
this.current = -1
Expand Down

0 comments on commit 5d7b9e0

Please sign in to comment.