Evan You 10 éve
szülő
commit
7cf0f58b8d
51 módosított fájl, 329 hozzáadás és 153 törlés
  1. 184 0
      .eslintrc
  2. 2 2
      build/grunt-tasks/casper.js
  3. 3 3
      build/grunt-tasks/codecov.js
  4. 1 1
      build/grunt-tasks/release.js
  5. 10 10
      build/saucelabs-config.js
  6. 1 1
      build/webpack-dev-config.js
  7. 1 1
      build/webpack-test-config.js
  8. 1 1
      src/api/child.js
  9. 3 3
      src/cache.js
  10. 2 4
      src/compiler/compile.js
  11. 1 1
      src/compiler/index.js
  12. 1 1
      src/directive.js
  13. 2 2
      src/directives/class.js
  14. 1 3
      src/directives/cloak.js
  15. 1 1
      src/directives/component.js
  16. 1 2
      src/directives/el.js
  17. 1 2
      src/directives/html.js
  18. 14 14
      src/directives/index.js
  19. 1 2
      src/directives/model/checkbox.js
  20. 1 2
      src/directives/model/index.js
  21. 3 3
      src/directives/model/radio.js
  22. 5 4
      src/directives/model/select.js
  23. 6 6
      src/directives/model/text.js
  24. 1 1
      src/directives/on.js
  25. 1 2
      src/directives/ref.js
  26. 1 1
      src/directives/show.js
  27. 1 1
      src/directives/style.js
  28. 1 2
      src/directives/text.js
  29. 1 2
      src/directives/transition.js
  30. 1 1
      src/element-directives/content.js
  31. 0 1
      src/filters/array-filters.js
  32. 8 8
      src/filters/index.js
  33. 2 2
      src/instance/events.js
  34. 18 18
      src/instance/init.js
  35. 1 1
      src/instance/scope.js
  36. 1 1
      src/observer/index.js
  37. 1 1
      src/observer/object.js
  38. 1 1
      src/parsers/directive.js
  39. 2 3
      src/parsers/expression.js
  40. 9 7
      src/parsers/path.js
  41. 13 11
      src/parsers/template.js
  42. 2 1
      src/parsers/text.js
  43. 1 1
      src/transition/index.js
  44. 1 1
      src/transition/queue.js
  45. 2 2
      src/transition/transition.js
  46. 1 2
      src/util/debug.js
  47. 2 1
      src/util/dom.js
  48. 1 1
      src/util/env.js
  49. 2 2
      src/util/index.js
  50. 8 8
      src/util/lang.js
  51. 0 1
      src/watcher.js

+ 184 - 0
.eslintrc

@@ -0,0 +1,184 @@
+{
+  "env": {
+    "browser": true,
+    "node": true
+  },
+
+  "globals": {
+    "jQuery": true
+  },
+
+  "rules": {
+    "accessor-pairs": 2,
+    "array-bracket-spacing": 0,
+    "block-scoped-var": 0,
+    "brace-style": [2, "1tbs", { "allowSingleLine": true }],
+    "camelcase": 0,
+    "comma-dangle": [2, "never"],
+    "comma-spacing": [2, { "before": false, "after": true }],
+    "comma-style": [2, "last"],
+    "complexity": 0,
+    "computed-property-spacing": 0,
+    "consistent-return": 0,
+    "consistent-this": 0,
+    "constructor-super": 2,
+    "curly": [2, "multi-line"],
+    "default-case": 0,
+    "dot-location": [2, "property"],
+    "dot-notation": 0,
+    "eol-last": 2,
+    "eqeqeq": [2, "allow-null"],
+    "func-names": 0,
+    "func-style": 0,
+    "generator-star": 0,
+    "generator-star-spacing": [2, { "before": true, "after": true }],
+    "global-strict": 0,
+    "guard-for-in": 0,
+    "handle-callback-err": [2, "^(err|error)$" ],
+    "indent": [2, 2],
+    "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
+    "linebreak-style": 0,
+    "lines-around-comment": 0,
+    "max-depth": 0,
+    "max-len": 0,
+    "max-nested-callbacks": 0,
+    "max-params": 0,
+    "max-statements": 0,
+    "new-cap": [2, { "newIsCap": true, "capIsNew": false }],
+    "new-parens": 2,
+    "newline-after-var": 0,
+    "no-alert": 0,
+    "no-array-constructor": 2,
+    "no-bitwise": 0,
+    "no-caller": 2,
+    "no-catch-shadow": 0,
+    "no-comma-dangle": 0,
+    "no-cond-assign": 2,
+    "no-console": 0,
+    "no-constant-condition": 0,
+    "no-continue": 0,
+    "no-control-regex": 2,
+    "no-debugger": 2,
+    "no-delete-var": 2,
+    "no-div-regex": 0,
+    "no-dupe-args": 2,
+    "no-dupe-keys": 2,
+    "no-duplicate-case": 2,
+    "no-else-return": 0,
+    "no-empty": 0,
+    "no-empty-character-class": 2,
+    "no-empty-class": 0,
+    "no-empty-label": 2,
+    "no-eq-null": 0,
+    "no-eval": 2,
+    "no-ex-assign": 2,
+    "no-extend-native": 2,
+    "no-extra-bind": 2,
+    "no-extra-boolean-cast": 2,
+    "no-extra-parens": 0,
+    "no-extra-semi": 0,
+    "no-extra-strict": 0,
+    "no-fallthrough": 2,
+    "no-floating-decimal": 2,
+    "no-func-assign": 2,
+    "no-implied-eval": 2,
+    "no-inline-comments": 0,
+    "no-inner-declarations": [2, "functions"],
+    "no-invalid-regexp": 2,
+    "no-irregular-whitespace": 2,
+    "no-iterator": 2,
+    "no-label-var": 2,
+    "no-labels": 2,
+    "no-lone-blocks": 2,
+    "no-lonely-if": 0,
+    "no-loop-func": 0,
+    "no-mixed-requires": 0,
+    "no-mixed-spaces-and-tabs": 2,
+    "no-multi-spaces": 2,
+    "no-multi-str": 2,
+    "no-multiple-empty-lines": [2, { "max": 1 }],
+    "no-native-reassign": 2,
+    "no-negated-in-lhs": 2,
+    "no-nested-ternary": 0,
+    "no-new": 2,
+    "no-new-func": 0,
+    "no-new-object": 2,
+    "no-new-require": 2,
+    "no-new-wrappers": 2,
+    "no-obj-calls": 2,
+    "no-octal": 2,
+    "no-octal-escape": 2,
+    "no-param-reassign": 0,
+    "no-path-concat": 0,
+    "no-plusplus": 0,
+    "no-process-env": 0,
+    "no-process-exit": 0,
+    "no-proto": 0,
+    "no-redeclare": 2,
+    "no-regex-spaces": 2,
+    "no-reserved-keys": 0,
+    "no-restricted-modules": 0,
+    "no-return-assign": 2,
+    "no-script-url": 0,
+    "no-self-compare": 2,
+    "no-sequences": 2,
+    "no-shadow": 0,
+    "no-shadow-restricted-names": 2,
+    "no-space-before-semi": 0,
+    "no-spaced-func": 2,
+    "no-sparse-arrays": 2,
+    "no-sync": 0,
+    "no-ternary": 0,
+    "no-this-before-super": 2,
+    "no-throw-literal": 2,
+    "no-trailing-spaces": 2,
+    "no-undef": 2,
+    "no-undef-init": 2,
+    "no-undefined": 0,
+    "no-underscore-dangle": 0,
+    "no-unexpected-multiline": 2,
+    "no-unneeded-ternary": 2,
+    "no-unreachable": 2,
+    "no-unused-expressions": 0,
+    "no-unused-vars": [2, { "vars": "all", "args": "none" }],
+    "no-use-before-define": 0,
+    "no-var": 0,
+    "no-void": 0,
+    "no-warning-comments": 0,
+    "no-with": 2,
+    "no-wrap-func": 2,
+    "object-curly-spacing": 0,
+    "object-shorthand": 0,
+    "one-var": [2, { "initialized": "never" }],
+    "operator-assignment": 0,
+    "operator-linebreak": [2, "after"],
+    "padded-blocks": 0,
+    "prefer-const": 0,
+    "quote-props": 0,
+    "quotes": [2, "single", "avoid-escape"],
+    "radix": 2,
+    "semi": [2, "never"],
+    "semi-spacing": 0,
+    "sort-vars": 0,
+    "space-after-function-name": 0,
+    "space-after-keywords": [2, "always"],
+    "space-before-blocks": [2, "always"],
+    "space-before-function-paren": [2, "always"],
+    "space-before-function-parentheses": 0,
+    "space-in-brackets": 0,
+    "space-in-parens": [2, "never"],
+    "space-infix-ops": 2,
+    "space-return-throw-case": 2,
+    "space-unary-ops": [2, { "words": true, "nonwords": false }],
+    "spaced-comment": [2, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!"] }],
+    "spaced-line-comment": 0,
+    "strict": 0,
+    "use-isnan": 2,
+    "valid-jsdoc": 0,
+    "valid-typeof": 2,
+    "vars-on-top": 0,
+    "wrap-iife": [2, "any"],
+    "wrap-regex": 0,
+    "yoda": [2, "never"]
+  }
+}

+ 2 - 2
build/grunt-tasks/casper.js

@@ -3,7 +3,7 @@
  */
 
 module.exports = function (grunt) {
-  grunt.registerTask( 'casper', function (id) {
+  grunt.registerTask('casper', function (id) {
     var path = require('path')
     var done = this.async()
     var file = id ? id + '.js' : ''
@@ -23,4 +23,4 @@ module.exports = function (grunt) {
       done()
     })
   })
-}
+}

+ 3 - 3
build/grunt-tasks/codecov.js

@@ -6,9 +6,9 @@ module.exports = function (grunt) {
     var coverage = require('fs').readFileSync('coverage/lcov.info', 'utf-8')
     sendToCodeCov(coverage, function (err) {
       if (err) {
-        console.log("error sending to codecov.io: ", err, err.stack);
-        if (/non-success response/.test(err.message)){
-          console.log("detail: ", err.detail);
+        console.log('error sending to codecov.io: ', err, err.stack)
+        if (/non-success response/.test(err.message)) {
+          console.log('detail: ', err.detail)
         }
       }
       done()

+ 1 - 1
build/grunt-tasks/release.js

@@ -80,4 +80,4 @@ module.exports = function (grunt) {
   function blue (str) {
     return '\x1b[1m\x1b[34m' + str + '\x1b[39m\x1b[22m'
   }
-}
+}

+ 10 - 10
build/saucelabs-config.js

@@ -1,7 +1,7 @@
 var sauceConfig = {
   testName: 'Vue.js unit tests',
   recordScreenshots: false,
-  build: process.env.TRAVIS_JOB_ID || Date.now(),
+  build: process.env.TRAVIS_JOB_ID || Date.now()
 }
 
 /**
@@ -24,23 +24,23 @@ var batches = [
     },
     sl_mac_safari: {
       base: 'SauceLabs',
-      browserName: "safari",
-      platform: "OS X 10.10"
+      browserName: 'safari',
+      platform: 'OS X 10.10'
     }
   },
   // ie family
   {
     sl_ie_9: {
       base: 'SauceLabs',
-      browserName: "internet explorer",
-      platform: "Windows 7",
-      version: "9"
+      browserName: 'internet explorer',
+      platform: 'Windows 7',
+      version: '9'
     },
     sl_ie_10: {
       base: 'SauceLabs',
-      browserName: "internet explorer",
-      platform: "Windows 8",
-      version: "10"
+      browserName: 'internet explorer',
+      platform: 'Windows 8',
+      version: '10'
     },
     sl_ie_11: {
       base: 'SauceLabs',
@@ -67,7 +67,7 @@ var batches = [
 ]
 
 for (var i = 0; i < 3; i++) {
-  exports['batch' + (i+1)] = {
+  exports['batch' + (i + 1)] = {
     sauceLabs: sauceConfig,
     // mobile emulators are really slow
     captureTimeout: 300000,

+ 1 - 1
build/webpack-dev-config.js

@@ -7,4 +7,4 @@ module.exports = {
     libraryTarget: 'umd'
   },
   devtool: '#source-map'
-}
+}

+ 1 - 1
build/webpack-test-config.js

@@ -10,4 +10,4 @@ module.exports = {
     filename: 'specs.js'
   },
   devtool: '#source-map'
-}
+}

+ 1 - 1
src/api/child.js

@@ -44,4 +44,4 @@ exports.$addChild = function (opts, BaseCtor) {
   opts._root = parent.$root
   var child = new ChildVue(opts)
   return child
-}
+}

+ 3 - 3
src/cache.js

@@ -33,8 +33,8 @@ var p = Cache.prototype
 
 p.put = function (key, value) {
   var entry = {
-    key:key,
-    value:value
+    key: key,
+    value: value
   }
   this._keymap[key] = entry
   if (this.tail) {
@@ -109,4 +109,4 @@ p.get = function (key, returnEntry) {
     : entry.value
 }
 
-module.exports = Cache
+module.exports = Cache

+ 2 - 4
src/compiler/compile.js

@@ -65,7 +65,6 @@ exports.compile = function (el, options, partial, host) {
       if (nodeLinkFn) nodeLinkFn(vm, el, host)
       if (childLinkFn) childLinkFn(vm, childNodes, host)
     }, vm)
-    // 
     return makeUnlinkFn(vm, dirs)
   }
 }
@@ -88,7 +87,7 @@ function linkAndCapture (linker, vm) {
  * Linker functions return an unlink function that
  * tearsdown all directives instances generated during
  * the process.
- * 
+ *
  * We create unlink functions with only the necessary
  * information to avoid retaining additional closures.
  *
@@ -163,7 +162,7 @@ exports.compileAndLinkProps = function (vm, el, props) {
  * @return {Function}
  */
 
- exports.compileAndLinkRoot = function (vm, el, options) {
+exports.compileAndLinkRoot = function (vm, el, options) {
   var containerAttrs = options._containerAttrs
   var replacerAttrs = options._replacerAttrs
   var contextLinkFn, replacerLinkFn
@@ -608,7 +607,6 @@ function checkTerminalDirectives (el, options) {
     return skip
   }
   var value, dirName
-  /* jshint boss: true */
   for (var i = 0, l = terminalDirectives.length; i < l; i++) {
     dirName = terminalDirectives[i]
     if ((value = _.attr(el, dirName)) !== null) {

+ 1 - 1
src/compiler/index.js

@@ -1,4 +1,4 @@
 var _ = require('../util')
 
 _.extend(exports, require('./compile'))
-_.extend(exports, require('./transclude'))
+_.extend(exports, require('./transclude'))

+ 1 - 1
src/directive.js

@@ -217,4 +217,4 @@ p._withLock = function (fn) {
   })
 }
 
-module.exports = Directive
+module.exports = Directive

+ 2 - 2
src/directives/class.js

@@ -3,7 +3,7 @@ var addClass = _.addClass
 var removeClass = _.removeClass
 
 module.exports = {
-  
+
   update: function (value) {
     if (this.arg) {
       // single toggle
@@ -42,4 +42,4 @@ module.exports = {
       }
     }
   }
-}
+}

+ 1 - 3
src/directives/cloak.js

@@ -1,12 +1,10 @@
 var config = require('../config')
 
 module.exports = {
-
   bind: function () {
     var el = this.el
     this.vm.$once('hook:compiled', function () {
       el.removeAttribute(config.prefix + 'cloak')
     })
   }
-
-}
+}

+ 1 - 1
src/directives/component.js

@@ -257,7 +257,7 @@ module.exports = {
   /**
    * Set childVM and parent ref
    */
-  
+
   setCurrent: function (child) {
     this.childVM = child
     var refID = child._refID || this.refID

+ 1 - 2
src/directives/el.js

@@ -9,5 +9,4 @@ module.exports = {
   unbind: function () {
     delete this.vm.$$[this.expression]
   }
-  
-}
+}

+ 1 - 2
src/directives/html.js

@@ -37,5 +37,4 @@ module.exports = {
     this.nodes = _.toArray(frag.childNodes)
     _.before(frag, this.anchor)
   }
-
-}
+}

+ 14 - 14
src/directives/index.js

@@ -1,24 +1,24 @@
 // manipulation directives
-exports.text       = require('./text')
-exports.html       = require('./html')
-exports.attr       = require('./attr')
-exports.show       = require('./show')
-exports['class']   = require('./class')
-exports.el         = require('./el')
-exports.ref        = require('./ref')
-exports.cloak      = require('./cloak')
-exports.style      = require('./style')
+exports.text = require('./text')
+exports.html = require('./html')
+exports.attr = require('./attr')
+exports.show = require('./show')
+exports['class'] = require('./class')
+exports.el = require('./el')
+exports.ref = require('./ref')
+exports.cloak = require('./cloak')
+exports.style = require('./style')
 exports.transition = require('./transition')
 
 // event listener directives
-exports.on         = require('./on')
-exports.model      = require('./model')
+exports.on = require('./on')
+exports.model = require('./model')
 
 // logic control directives
-exports.repeat     = require('./repeat')
-exports['if']      = require('./if')
+exports.repeat = require('./repeat')
+exports['if'] = require('./if')
 
 // internal directives that should not be used directly
 // but we still want to expose them for advanced usage.
 exports._component = require('./component')
-exports._prop      = require('./prop')
+exports._prop = require('./prop')

+ 1 - 2
src/directives/model/checkbox.js

@@ -21,5 +21,4 @@ module.exports = {
   unbind: function () {
     _.off(this.el, 'change', this.listener)
   }
-
-}
+}

+ 1 - 2
src/directives/model/index.js

@@ -71,5 +71,4 @@ module.exports = {
       }
     }
   }
-
-}
+}

+ 3 - 3
src/directives/model/radio.js

@@ -15,12 +15,12 @@ module.exports = {
   },
 
   update: function (value) {
-    /* jshint eqeqeq: false */
+    /* eslint-disable eqeqeq */
     this.el.checked = value == this.el.value
+    /* eslint-enable eqeqeq */
   },
 
   unbind: function () {
     _.off(this.el, 'change', this.listener)
   }
-
-}
+}

+ 5 - 4
src/directives/model/select.js

@@ -30,7 +30,6 @@ module.exports = {
   },
 
   update: function (value) {
-    /* jshint eqeqeq: false */
     var el = this.el
     el.selectedIndex = -1
     var multi = this.multiple && _.isArray(value)
@@ -39,9 +38,11 @@ module.exports = {
     var option
     while (i--) {
       option = options[i]
+      /* eslint-disable eqeqeq */
       option.selected = multi
         ? indexOf(value, option.value) > -1
         : value == option.value
+      /* eslint-enable eqeqeq */
     }
   },
 
@@ -105,7 +106,6 @@ function buildOptions (parent, options) {
       if (typeof op === 'string') {
         el.text = el.value = op
       } else {
-        /* jshint eqeqeq: false */
         if (op.value != null) {
           el.value = op.value
         }
@@ -177,10 +177,11 @@ function getOptionValue (op) {
  */
 
 function indexOf (arr, val) {
-  /* jshint eqeqeq: false */
   var i = arr.length
   while (i--) {
+    /* eslint-disable eqeqeq */
     if (arr[i] == val) return i
+    /* eslint-enable eqeqeq */
   }
   return -1
-}
+}

+ 6 - 6
src/directives/model/text.js

@@ -33,8 +33,8 @@ module.exports = {
         // at the end... have to call it here.
         self.listener()
       }
-      _.on(el,'compositionstart', this.onComposeStart)
-      _.on(el,'compositionend', this.onComposeEnd)
+      _.on(el, 'compositionstart', this.onComposeStart)
+      _.on(el, 'compositionend', this.onComposeEnd)
     }
 
     function syncToModel () {
@@ -97,7 +97,7 @@ module.exports = {
     // Support jQuery events, since jQuery.trigger() doesn't
     // trigger native events in some cases and some plugins
     // rely on $.trigger()
-    // 
+    //
     // We want to make sure if a listener is attached using
     // jQuery, it is also removed with jQuery, that's why
     // we do the check for each directive instance and
@@ -152,8 +152,8 @@ module.exports = {
       _.off(el, 'compositionend', this.onComposeEnd)
     }
     if (this.onCut) {
-      _.off(el,'cut', this.onCut)
-      _.off(el,'keyup', this.onDel)
+      _.off(el, 'cut', this.onCut)
+      _.off(el, 'keyup', this.onDel)
     }
   }
-}
+}

+ 1 - 1
src/directives/on.js

@@ -56,4 +56,4 @@ module.exports = {
     this.reset()
     _.off(this.el, 'load', this.iframeBind)
   }
-}
+}

+ 1 - 2
src/directives/ref.js

@@ -19,5 +19,4 @@ module.exports = {
     // if any.
     vm._refID = this.expression
   }
-  
-}
+}

+ 1 - 1
src/directives/show.js

@@ -5,4 +5,4 @@ module.exports = function (value) {
   transition.apply(el, value ? 1 : -1, function () {
     el.style.display = value ? '' : 'none'
   }, this.vm)
-}
+}

+ 1 - 1
src/directives/style.js

@@ -107,4 +107,4 @@ function prefix (prop) {
       return prefixes[i] + prop
     }
   }
-}
+}

+ 1 - 2
src/directives/text.js

@@ -11,5 +11,4 @@ module.exports = {
   update: function (value) {
     this.el[this.attr] = _.toString(value)
   }
-  
-}
+}

+ 1 - 2
src/directives/transition.js

@@ -23,5 +23,4 @@ module.exports = {
     }
     _.addClass(el, id + '-transition')
   }
-
-}
+}

+ 1 - 1
src/element-directives/content.js

@@ -77,7 +77,7 @@ module.exports = {
   unbind: function () {
     if (this.unlink) {
       this.unlink()
-    } 
+    }
   }
 }
 

+ 0 - 1
src/filters/array-filters.js

@@ -15,7 +15,6 @@ exports.filterBy = function (arr, search, delimiter, dataKey) {
   if (delimiter && delimiter !== 'in') {
     dataKey = delimiter
   }
-  /* jshint eqeqeq: false */
   if (search == null) {
     return arr
   }

+ 8 - 8
src/filters/index.js

@@ -104,14 +104,14 @@ exports.pluralize = function (value) {
  */
 
 var keyCodes = {
-  enter    : 13,
-  tab      : 9,
-  'delete' : 46,
-  up       : 38,
-  left     : 37,
-  right    : 39,
-  down     : 40,
-  esc      : 27
+  esc: 27,
+  tab: 9,
+  enter: 13,
+  'delete': 46,
+  up: 38,
+  left: 37,
+  right: 39,
+  down: 40
 }
 
 exports.key = function (handler, key) {

+ 2 - 2
src/instance/events.js

@@ -87,7 +87,7 @@ function onAttached () {
 
 /**
  * Iterator to call attached hook
- * 
+ *
  * @param {Vue} child
  */
 
@@ -108,7 +108,7 @@ function onDetached () {
 
 /**
  * Iterator to call detached hook
- * 
+ *
  * @param {Vue} child
  */
 

+ 18 - 18
src/instance/init.js

@@ -15,36 +15,36 @@ exports._init = function (options) {
 
   options = options || {}
 
-  this.$el           = null
-  this.$parent       = options._parent
-  this.$root         = options._root || this
-  this.$children     = []
-  this.$             = {} // child vm references
-  this.$$            = {} // element references
-  this._watchers     = [] // all watchers as an array
-  this._directives   = [] // all directives
-  this._childCtors   = {} // inherit:true constructors
+  this.$el = null
+  this.$parent = options._parent
+  this.$root = options._root || this
+  this.$children = []
+  this.$ = {}           // child vm references
+  this.$$ = {}          // element references
+  this._watchers = []   // all watchers as an array
+  this._directives = [] // all directives
+  this._childCtors = {} // inherit:true constructors
 
   // a flag to avoid this being observed
   this._isVue = true
 
   // events bookkeeping
-  this._events         = {}    // registered callbacks
-  this._eventsCount    = {}    // for $broadcast optimization
+  this._events = {}            // registered callbacks
+  this._eventsCount = {}       // for $broadcast optimization
   this._eventCancelled = false // for event cancellation
 
   // block instance properties
-  this._isBlock     = false
-  this._blockStart  =          // @type {CommentNode}
-  this._blockEnd    = null     // @type {CommentNode}
+  this._isBlock = false
+  this._blockStart =    // @type {CommentNode}
+  this._blockEnd = null // @type {CommentNode}
 
   // lifecycle state
-  this._isCompiled  =
+  this._isCompiled =
   this._isDestroyed =
-  this._isReady     =
-  this._isAttached  =
+  this._isReady =
+  this._isAttached =
   this._isBeingDestroyed = false
-  this._unlinkFn    = null
+  this._unlinkFn = null
 
   // context: the scope in which the component was used,
   // and the scope in which props and contents of this

+ 1 - 1
src/instance/scope.js

@@ -43,7 +43,7 @@ exports._initProps = function () {
 }
 
 /**
- * Initialize the data. 
+ * Initialize the data.
  */
 
 exports._initData = function () {

+ 1 - 1
src/observer/index.js

@@ -11,7 +11,7 @@ var uid = 0
  * Type enums
  */
 
-var ARRAY  = 0
+var ARRAY = 0
 var OBJECT = 1
 
 /**

+ 1 - 1
src/observer/object.js

@@ -79,4 +79,4 @@ _.define(
       }
     }
   }
-)
+)

+ 1 - 1
src/parsers/directive.js

@@ -176,4 +176,4 @@ exports.parse = function (s) {
 
   cache.put(s, dirs)
   return dirs
-}
+}

+ 2 - 3
src/parsers/expression.js

@@ -107,8 +107,7 @@ function restore (str, i) {
 function compileExpFns (exp, needSet) {
   if (improperKeywordsRE.test(exp)) {
     _.warn(
-      'Avoid using reserved keywords in expression: '
-      + exp
+      'Avoid using reserved keywords in expression: ' + exp
     )
   }
   // reset state
@@ -260,4 +259,4 @@ exports.isSimplePath = function (exp) {
     !booleanLiteralRE.test(exp) &&
     // Math constants e.g. Math.PI, Math.E etc.
     exp.slice(0, 5) !== 'Math.'
-}
+}

+ 9 - 7
src/parsers/path.js

@@ -44,7 +44,7 @@ var pathStateMachine = {
     'number': ['inIndex', 'append'],
     "'": ['inSingleQuote', 'append', ''],
     '"': ['inDoubleQuote', 'append', ''],
-    "ident": ['inIdent', 'append', '*']
+    'ident': ['inIdent', 'append', '*']
   },
 
   'afterZero': {
@@ -93,7 +93,7 @@ function getPathCharType (ch) {
 
   var code = ch.charCodeAt(0)
 
-  switch(code) {
+  switch (code) {
     case 0x5B: // [
     case 0x5D: // ]
     case 0x2E: // .
@@ -118,13 +118,15 @@ function getPathCharType (ch) {
   }
 
   // a-z, A-Z
-  if ((0x61 <= code && code <= 0x7A) ||
-      (0x41 <= code && code <= 0x5A)) {
+  if (
+    (code >= 0x61 && code <= 0x7A) ||
+    (code >= 0x41 && code <= 0x5A)
+  ) {
     return 'ident'
   }
 
   // 1-9
-  if (0x31 <= code && code <= 0x39) {
+  if (code >= 0x31 && code <= 0x39) {
     return 'number'
   }
 
@@ -146,14 +148,14 @@ function parsePath (path) {
   var c, newChar, key, type, transition, action, typeMap
 
   var actions = {
-    push: function() {
+    push: function () {
       if (key === undefined) {
         return
       }
       keys.push(key)
       key = undefined
     },
-    append: function() {
+    append: function () {
       if (key === undefined) {
         key = newChar
       } else {

+ 13 - 11
src/parsers/template.js

@@ -4,10 +4,10 @@ var templateCache = new Cache(1000)
 var idSelectorCache = new Cache(1000)
 
 var map = {
-  _default : [0, '', ''],
-  legend   : [1, '<fieldset>', '</fieldset>'],
-  tr       : [2, '<table><tbody>', '</tbody></table>'],
-  col      : [
+  _default: [0, '', ''],
+  legend: [1, '<fieldset>', '</fieldset>'],
+  tr: [2, '<table><tbody>', '</tbody></table>'],
+  col: [
     2,
     '<table><tbody></tbody><colgroup>',
     '</colgroup></table>'
@@ -86,12 +86,12 @@ function stringToFragment (templateString) {
     )
   } else {
 
-    var tag    = tagMatch && tagMatch[1]
-    var wrap   = map[tag] || map._default
-    var depth  = wrap[0]
+    var tag = tagMatch && tagMatch[1]
+    var wrap = map[tag] || map._default
+    var depth = wrap[0]
     var prefix = wrap[1]
     var suffix = wrap[2]
-    var node   = document.createElement('div')
+    var node = document.createElement('div')
 
     node.innerHTML = prefix + templateString.trim() + suffix
     while (depth--) {
@@ -99,8 +99,9 @@ function stringToFragment (templateString) {
     }
 
     var child
-    /* jshint boss:true */
+    /* eslint-disable no-cond-assign */
     while (child = node.firstChild) {
+    /* eslint-enable no-cond-assign */
       frag.appendChild(child)
     }
   }
@@ -133,8 +134,9 @@ function nodeToFragment (node) {
   var clone = exports.clone(node)
   var frag = document.createDocumentFragment()
   var child
-  /* jshint boss:true */
+  /* eslint-disable no-cond-assign */
   while (child = clone.firstChild) {
+  /* eslint-enable no-cond-assign */
     frag.appendChild(child)
   }
   return frag
@@ -256,4 +258,4 @@ exports.parse = function (template, clone, noSelector) {
   return frag && clone
     ? exports.clone(frag)
     : frag
-}
+}

+ 2 - 1
src/parsers/text.js

@@ -72,8 +72,9 @@ exports.parse = function (text) {
   var tokens = []
   var lastIndex = tagRE.lastIndex = 0
   var match, index, value, first, oneTime, twoWay
-  /* jshint boss:true */
+  /* eslint-disable no-cond-assign */
   while (match = tagRE.exec(text)) {
+  /* eslint-enable no-cond-assign */
     index = match.index
     // push text token
     if (index > lastIndex) {

+ 1 - 1
src/transition/index.js

@@ -125,4 +125,4 @@ var apply = exports.apply = function (el, direction, op, vm, cb) {
   }
   var action = direction > 0 ? 'enter' : 'leave'
   transition[action](op, cb)
-}
+}

+ 1 - 1
src/transition/queue.js

@@ -32,4 +32,4 @@ function flush () {
   // dummy return, so js linters don't complain about
   // unused variable f
   return f
-}
+}

+ 2 - 2
src/transition/transition.js

@@ -123,7 +123,7 @@ p.enterDone = function () {
  *    - transition or animation:
  *        wait for end event, remove class, then done if
  *        there's no explicit js callback.
- *    - no css transition: 
+ *    - no css transition:
  *        done if there's no explicit js callback.
  * 7. wait for either done or js callback, then call
  *    afterLeave hook.
@@ -305,4 +305,4 @@ p.setupCssCb = function (event, cb) {
   _.on(el, event, onEnd)
 }
 
-module.exports = Transition
+module.exports = Transition

+ 1 - 2
src/util/debug.js

@@ -11,7 +11,7 @@ enableDebug()
 function enableDebug () {
 
   var hasConsole = typeof console !== 'undefined'
-  
+
   /**
    * Log a message.
    *
@@ -35,7 +35,6 @@ function enableDebug () {
       console.warn('[Vue warn]: ' + msg)
       /* istanbul ignore if */
       if (config.debug) {
-        /* jshint debug: true */
         console.warn((e || new Error('Warning Stack Trace')).stack)
       }
     }

+ 2 - 1
src/util/dom.js

@@ -207,8 +207,9 @@ exports.extractContent = function (el, asFragment) {
     rawContent = asFragment
       ? document.createDocumentFragment()
       : document.createElement('div')
-    /* jshint boss:true */
+    /* eslint-disable no-cond-assign */
     while (child = el.firstChild) {
+    /* eslint-enable no-cond-assign */
       rawContent.appendChild(child)
     }
   }

+ 1 - 1
src/util/env.js

@@ -82,4 +82,4 @@ exports.nextTick = (function () {
     pending = true
     timerFunc(handle, 0)
   }
-})()
+})()

+ 2 - 2
src/util/index.js

@@ -1,4 +1,4 @@
-var lang   = require('./lang')
+var lang = require('./lang')
 var extend = lang.extend
 
 extend(exports, lang)
@@ -6,4 +6,4 @@ extend(exports, require('./env'))
 extend(exports, require('./dom'))
 extend(exports, require('./misc'))
 extend(exports, require('./debug'))
-extend(exports, require('./options'))
+extend(exports, require('./options'))

+ 8 - 8
src/util/lang.js

@@ -79,7 +79,7 @@ exports.stripQuotes = function (str) {
  * @return {String}
  */
 function toUpper (_, c) {
-  return c ? c.toUpperCase () : ''
+  return c ? c.toUpperCase() : ''
 }
 
 /**
@@ -208,10 +208,10 @@ exports.isArray = Array.isArray
 
 exports.define = function (obj, key, val, enumerable) {
   Object.defineProperty(obj, key, {
-    value        : val,
-    enumerable   : !!enumerable,
-    writable     : true,
-    configurable : true
+    value: val,
+    enumerable: !!enumerable,
+    writable: true,
+    configurable: true
   })
 }
 
@@ -224,9 +224,9 @@ exports.define = function (obj, key, val, enumerable) {
  * @return {Function} - the debounced function
  */
 
-exports.debounce = function(func, wait) {
+exports.debounce = function (func, wait) {
   var timeout, args, context, timestamp, result
-  var later = function() {
+  var later = function () {
     var last = Date.now() - timestamp
     if (last < wait && last >= 0) {
       timeout = setTimeout(later, wait - last)
@@ -236,7 +236,7 @@ exports.debounce = function(func, wait) {
       if (!timeout) context = args = null
     }
   }
-  return function() {
+  return function () {
     context = this
     args = arguments
     timestamp = Date.now()

+ 0 - 1
src/watcher.js

@@ -212,7 +212,6 @@ p.teardown = function () {
   }
 }
 
-
 /**
  * Recrusively traverse an object to evoke all converted
  * getters, so that every nested property inside the object