Sfoglia il codice sorgente

use standard and eslint 2.0

Evan You 10 anni fa
parent
commit
521e8d2754
84 ha cambiato i file con 71 aggiunte e 542 eliminazioni
  1. 2 177
      .eslintrc
  2. 0 1
      build/karma.cover.config.js
  3. 0 1
      build/karma.sauce.config.js
  4. 4 1
      package.json
  5. 0 1
      src/directives/internal/prop.js
  6. 2 0
      src/directives/public/model/text.js
  7. 0 1
      src/instance/api/data.js
  8. 0 1
      src/instance/api/dom.js
  9. 0 1
      src/instance/api/events.js
  10. 2 1
      src/instance/api/global.js
  11. 0 1
      src/instance/api/lifecycle.js
  12. 0 1
      src/instance/internal/events.js
  13. 0 2
      src/instance/internal/init.js
  14. 0 1
      src/instance/internal/lifecycle.js
  15. 0 1
      src/instance/internal/misc.js
  16. 0 1
      src/instance/internal/state.js
  17. 2 0
      src/observer/index.js
  18. 0 1
      src/parsers/directive.js
  19. 2 0
      src/parsers/expression.js
  20. 0 1
      src/parsers/template.js
  21. 0 1
      src/transition/transition.js
  22. 1 1
      src/util/component.js
  23. 2 0
      src/util/env.js
  24. 2 158
      test/.eslintrc
  25. 0 2
      test/e2e/commits.js
  26. 0 2
      test/e2e/grid.js
  27. 0 2
      test/e2e/markdown.js
  28. 0 2
      test/e2e/modal.js
  29. 0 2
      test/e2e/svg.js
  30. 0 8
      test/e2e/todomvc.js
  31. 0 2
      test/e2e/tree.js
  32. 0 1
      test/unit/specs/api/data_spec.js
  33. 0 12
      test/unit/specs/api/dom_spec.js
  34. 0 2
      test/unit/specs/api/events_spec.js
  35. 0 4
      test/unit/specs/api/global_spec.js
  36. 0 8
      test/unit/specs/api/lifecycle_spec.js
  37. 0 1
      test/unit/specs/async_component_spec.js
  38. 0 2
      test/unit/specs/batcher_spec.js
  39. 0 1
      test/unit/specs/cache_spec.js
  40. 1 2
      test/unit/specs/compiler/compile_spec.js
  41. 9 10
      test/unit/specs/compiler/transclude_spec.js
  42. 0 1
      test/unit/specs/directive_spec.js
  43. 0 2
      test/unit/specs/directives/element/partial_spec.js
  44. 0 2
      test/unit/specs/directives/element/slot_spec.js
  45. 0 1
      test/unit/specs/directives/internal/class_spec.js
  46. 0 1
      test/unit/specs/directives/internal/component_spec.js
  47. 0 3
      test/unit/specs/directives/internal/prop_spec.js
  48. 1 2
      test/unit/specs/directives/internal/style_spec.js
  49. 0 1
      test/unit/specs/directives/internal/transition_spec.js
  50. 0 1
      test/unit/specs/directives/public/bind_spec.js
  51. 0 1
      test/unit/specs/directives/public/cloak_spec.js
  52. 0 2
      test/unit/specs/directives/public/el_spec.js
  53. 0 1
      test/unit/specs/directives/public/for/for_ref_spec.js
  54. 1 3
      test/unit/specs/directives/public/for/for_spec.js
  55. 0 1
      test/unit/specs/directives/public/for/for_stagger_spec.js
  56. 0 1
      test/unit/specs/directives/public/html_spec.js
  57. 0 1
      test/unit/specs/directives/public/if_spec.js
  58. 0 1
      test/unit/specs/directives/public/model_spec.js
  59. 0 1
      test/unit/specs/directives/public/on_spec.js
  60. 0 1
      test/unit/specs/directives/public/pre_spec.js
  61. 0 1
      test/unit/specs/directives/public/ref_spec.js
  62. 0 1
      test/unit/specs/directives/public/show_spec.js
  63. 0 1
      test/unit/specs/directives/public/text_spec.js
  64. 4 5
      test/unit/specs/filters/filters_spec.js
  65. 0 7
      test/unit/specs/instance/events_spec.js
  66. 0 1
      test/unit/specs/instance/init_spec.js
  67. 0 2
      test/unit/specs/instance/misc_spec.js
  68. 0 10
      test/unit/specs/instance/state_spec.js
  69. 7 8
      test/unit/specs/misc_spec.js
  70. 0 1
      test/unit/specs/observer/dep_spec.js
  71. 0 2
      test/unit/specs/observer/observer_spec.js
  72. 0 1
      test/unit/specs/parsers/directive_spec.js
  73. 2 4
      test/unit/specs/parsers/expression_spec.js
  74. 0 2
      test/unit/specs/parsers/path_spec.js
  75. 12 13
      test/unit/specs/parsers/template_spec.js
  76. 0 2
      test/unit/specs/parsers/text_spec.js
  77. 0 8
      test/unit/specs/transition/transition_spec.js
  78. 0 1
      test/unit/specs/util/component_spec.js
  79. 0 3
      test/unit/specs/util/debug_spec.js
  80. 0 1
      test/unit/specs/util/dom_spec.js
  81. 0 2
      test/unit/specs/util/env_spec.js
  82. 0 1
      test/unit/specs/util/lang_spec.js
  83. 10 13
      test/unit/specs/util/options_spec.js
  84. 5 8
      test/unit/specs/watcher_spec.js

+ 2 - 177
.eslintrc

@@ -1,181 +1,6 @@
 {
-  "env": {
-    "browser": true,
-    "node": true
-  },
-
-  "globals": {
-    "jQuery": true
-  },
-
-  "ecmaFeatures": {
-    "arrowFunctions": true,
-    "destructuring": true,
-    "classes": true,
-    "defaultParams": true,
-    "blockBindings": true,
-    "modules": true,
-    "objectLiteralComputedProperties": true,
-    "objectLiteralShorthandMethods": true,
-    "objectLiteralShorthandProperties": true,
-    "restParams": true,
-    "spread": true,
-    "templateStrings": true
-  },
-
+  "extends": "standard",
   "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-spacing": [2, { "before": true, "after": true }],
-    "guard-for-in": 0,
-    "handle-callback-err": [2, "^(err|error)$" ],
-    "indent": [2, 2, { "SwitchCase": 1 }],
-    "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
-    "linebreak-style": 0,
-    "lines-around-comment": 0,
-    "max-nested-callbacks": 0,
-    "new-cap": [2, { "newIsCap": true, "capIsNew": false }],
-    "new-parens": 2,
-    "newline-after-var": 0,
-    "no-alert": 0,
-    "no-array-constructor": 2,
-    "no-caller": 2,
-    "no-catch-shadow": 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-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-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-process-env": 0,
-    "no-process-exit": 0,
-    "no-proto": 0,
-    "no-redeclare": 2,
-    "no-regex-spaces": 2,
-    "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-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,
-    "object-curly-spacing": 0,
-    "object-shorthand": 0,
-    "one-var": [2, { "initialized": "never" }],
-    "operator-assignment": 0,
-    "operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }],
-    "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-keywords": [2, "always"],
-    "space-before-blocks": [2, "always"],
-    "space-before-function-paren": [2, "always"],
-    "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", "!"] }],
-    "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"]
+    "arrow-parens": [2, "as-needed"]
   }
 }

+ 0 - 1
build/karma.cover.config.js

@@ -2,7 +2,6 @@ var assign = require('object-assign')
 var base = require('./karma.base.config.js')
 
 module.exports = function (config) {
-
   var options = assign(base, {
     browsers: ['PhantomJS'],
     reporters: ['progress', 'coverage'],

+ 0 - 1
build/karma.sauce.config.js

@@ -64,7 +64,6 @@ var batches = [
 ]
 
 module.exports = function (config) {
-
   var batch = batches[process.argv[4] || 0]
 
   config.set(assign(base, {

+ 4 - 1
package.json

@@ -51,7 +51,10 @@
     "babel-runtime": "^5.8.0",
     "casperjs": "^1.1.0-beta3",
     "codecov.io": "^0.1.2",
-    "eslint": "^1.3.1",
+    "eslint": "^2.1.0",
+    "eslint-config-standard": "^5.1.0",
+    "eslint-plugin-promise": "^1.0.8",
+    "eslint-plugin-standard": "^1.3.2",
     "istanbul-instrumenter-loader": "^0.1.3",
     "jasmine-core": "^2.3.4",
     "karma": "^0.13.8",

+ 0 - 1
src/directives/internal/prop.js

@@ -12,7 +12,6 @@ const bindingModes = config._propBindingModes
 export default {
 
   bind () {
-
     var child = this.vm
     var parent = child._context
     // passed in from compiler directly

+ 2 - 0
src/directives/public/model/text.js

@@ -1,3 +1,5 @@
+/* global jQuery */
+
 import {
   isIE9,
   isAndroid,

+ 0 - 1
src/instance/api/data.js

@@ -8,7 +8,6 @@ import { isSimplePath, parseExpression } from '../../parsers/expression'
 const filterRE = /[^|]\|[^|]/
 
 export default function (Vue) {
-
   /**
    * Get the value from an expression on this vm.
    *

+ 0 - 1
src/instance/api/dom.js

@@ -14,7 +14,6 @@ import {
 } from '../../transition/index'
 
 export default function (Vue) {
-
   /**
    * Convenience on-instance nextTick. The callback is
    * auto-bound to the instance, and this avoids component

+ 0 - 1
src/instance/api/events.js

@@ -1,7 +1,6 @@
 import { toArray } from '../../util/index'
 
 export default function (Vue) {
-
   /**
    * Listen on the given `event` with `fn`.
    *

+ 2 - 1
src/instance/api/global.js

@@ -23,7 +23,6 @@ import FragmentFactory from '../../fragment/factory'
 import internalDirectives from '../../directives/internal/index'
 
 export default function (Vue) {
-
   /**
    * Expose useful internals
    */
@@ -118,10 +117,12 @@ export default function (Vue) {
    */
 
   function createClass (name) {
+    /* eslint-disable no-new-func */
     return new Function(
       'return function ' + classify(name) +
       ' (options) { this._init(options) }'
     )()
+    /* eslint-enable no-new-func */
   }
 
   /**

+ 0 - 1
src/instance/api/lifecycle.js

@@ -2,7 +2,6 @@ import { warn, query, inDoc } from '../../util/index'
 import { compile } from '../../compiler/index'
 
 export default function (Vue) {
-
   /**
    * Set instance target element and kick off the compilation
    * process. The passed in `el` can be a selector string, an

+ 0 - 1
src/instance/internal/events.js

@@ -7,7 +7,6 @@ import {
 const eventRE = /^v-on:|^@/
 
 export default function (Vue) {
-
   /**
    * Setup the instance's option events & watchers.
    * If the value is a string, we pull it from the

+ 0 - 2
src/instance/internal/init.js

@@ -3,7 +3,6 @@ import { mergeOptions } from '../../util/index'
 let uid = 0
 
 export default function (Vue) {
-
   /**
    * The main init sequence. This is called for every
    * instance, including ones that are created from extended
@@ -16,7 +15,6 @@ export default function (Vue) {
    */
 
   Vue.prototype._init = function (options) {
-
     options = options || {}
 
     this.$el = null

+ 0 - 1
src/instance/internal/lifecycle.js

@@ -3,7 +3,6 @@ import { replace, getAttr, isFragment } from '../../util/index'
 import { compile, compileRoot, transclude } from '../../compiler/index'
 
 export default function (Vue) {
-
   /**
    * Update v-ref for component.
    *

+ 0 - 1
src/instance/internal/misc.js

@@ -6,7 +6,6 @@ import {
 } from '../../util/index'
 
 export default function (Vue) {
-
   /**
    * Apply a list of filter (descriptors) to a value.
    * Using plain for loops here because this will be called in

+ 0 - 1
src/instance/internal/state.js

@@ -16,7 +16,6 @@ import {
 } from '../../util/index'
 
 export default function (Vue) {
-
   /**
    * Accessor for `$data` property, since setting $data
    * requires observing the new object and updating

+ 2 - 0
src/observer/index.js

@@ -112,7 +112,9 @@ Observer.prototype.removeVm = function (vm) {
  */
 
 function protoAugment (target, src) {
+  /* eslint-disable no-proto */
   target.__proto__ = src
+  /* eslint-enable no-proto */
 }
 
 /**

+ 0 - 1
src/parsers/directive.js

@@ -76,7 +76,6 @@ function processFilterArg (arg) {
  */
 
 export function parseDirective (s) {
-
   var hit = cache.get(s)
   if (hit) {
     return hit

+ 2 - 0
src/parsers/expression.js

@@ -136,7 +136,9 @@ function compileGetter (exp) {
 
 function makeGetterFn (body) {
   try {
+    /* eslint-disable no-new-func */
     return new Function('scope', 'return ' + body + ';')
+    /* eslint-enable no-new-func */
   } catch (e) {
     process.env.NODE_ENV !== 'production' && warn(
       'Invalid expression. ' +

+ 0 - 1
src/parsers/template.js

@@ -107,7 +107,6 @@ function stringToFragment (templateString, raw) {
       document.createTextNode(templateString)
     )
   } else {
-
     var tag = tagMatch && tagMatch[1]
     var wrap = map[tag] || map.efault
     var depth = wrap[0]

+ 0 - 1
src/transition/transition.js

@@ -117,7 +117,6 @@ p.enter = function (op, cb) {
  */
 
 p.enterNextTick = function () {
-
   // Important hack:
   // in Chrome, if a just-entered element is applied the
   // leave class while its interpolated property still has

+ 1 - 1
src/util/component.js

@@ -144,7 +144,7 @@ export function assertProp (prop, value) {
   }
   var validator = options.validator
   if (validator) {
-    if (!validator.call(null, value)) {
+    if (!validator(value)) {
       process.env.NODE_ENV !== 'production' && warn(
         'Invalid prop: custom validator check failed for ' +
         prop.path + '="' + prop.raw + '"'

+ 2 - 0
src/util/env.js

@@ -1,3 +1,5 @@
+/* global MutationObserver */
+
 // can we use __proto__?
 export const hasProto = '__proto__' in {}
 

+ 2 - 158
test/.eslintrc

@@ -1,9 +1,4 @@
 {
-  "env": {
-    "browser": true,
-    "node": true
-  },
-
   "globals": {
     "jQuery": true,
     "$": true,
@@ -19,160 +14,9 @@
     "hasWarned": true,
     "casper": 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-spacing": [2, { "before": true, "after": true }],
-    "guard-for-in": 0,
-    "handle-callback-err": [2, "^(err|error)$" ],
-    "indent": [2, 2, { "SwitchCase": 1 }],
-    "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
-    "linebreak-style": 0,
-    "lines-around-comment": 0,
-    "max-nested-callbacks": 0,
-    "new-cap": [2, { "newIsCap": true, "capIsNew": false }],
-    "new-parens": 2,
-    "newline-after-var": 0,
-    "no-alert": 0,
-    "no-array-constructor": 2,
-    "no-caller": 2,
-    "no-catch-shadow": 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-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-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": 0,
-    "no-multiple-empty-lines": [2, { "max": 1 }],
-    "no-native-reassign": 2,
-    "no-negated-in-lhs": 2,
-    "no-nested-ternary": 0,
     "no-new": 0,
-    "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-process-env": 0,
-    "no-process-exit": 0,
-    "no-proto": 0,
-    "no-redeclare": 2,
-    "no-regex-spaces": 2,
-    "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-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,
-    "object-curly-spacing": 0,
-    "object-shorthand": 0,
-    "one-var": [2, { "initialized": "never" }],
-    "operator-assignment": 0,
-    "operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }],
-    "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-keywords": [2, "always"],
-    "space-before-blocks": [2, "always"],
-    "space-before-function-paren": [2, "always"],
-    "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", "!"] }],
-    "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"]
+    "no-multi-str": 0,
+    "standard/object-curly-even-spacing": 0
   }
 }

+ 0 - 2
test/e2e/commits.js

@@ -3,7 +3,6 @@ casper.on('remote.message', function (e) {
 })
 
 casper.test.begin('commits', 18, function (test) {
-
   casper
   .start('examples/commits/index.html')
   .then(function () {
@@ -34,5 +33,4 @@ casper.test.begin('commits', 18, function (test) {
   .run(function () {
     test.done()
   })
-
 })

+ 0 - 2
test/e2e/grid.js

@@ -1,5 +1,4 @@
 casper.test.begin('grid', 73, function (test) {
-
   casper
   .start('examples/grid/index.html')
   .then(function () {
@@ -110,5 +109,4 @@ casper.test.begin('grid', 73, function (test) {
       }
     }
   }
-
 })

+ 0 - 2
test/e2e/markdown.js

@@ -1,5 +1,4 @@
 casper.test.begin('markdown', 5, function (test) {
-
   casper
   .start('examples/markdown/index.html')
   .then(function () {
@@ -47,5 +46,4 @@ casper.test.begin('markdown', 5, function (test) {
   .run(function () {
     test.done()
   })
-
 })

+ 0 - 2
test/e2e/modal.js

@@ -1,5 +1,4 @@
 casper.test.begin('modal', 8, function (test) {
-
   casper
   .start('examples/modal/index.html')
   .then(function () {
@@ -20,5 +19,4 @@ casper.test.begin('modal', 8, function (test) {
   .run(function () {
     test.done()
   })
-
 })

+ 0 - 2
test/e2e/svg.js

@@ -1,7 +1,6 @@
 /* global stats, valueToPoint */
 
 casper.test.begin('svg', 18, function (test) {
-
   casper
   .start('examples/svg/index.html')
   .then(function () {
@@ -55,5 +54,4 @@ casper.test.begin('svg', 18, function (test) {
   .run(function () {
     test.done()
   })
-
 })

+ 0 - 8
test/e2e/todomvc.js

@@ -1,16 +1,13 @@
 /* global __utils__ */
 
 casper.test.begin('todomvc', 63, function (test) {
-
   casper
   .start('examples/todomvc/index.html')
   .then(function () {
-
     test.assertNotVisible('.main', '.main should be hidden')
     test.assertNotVisible('.footer', '.footer should be hidden')
     test.assertElementCount('.filters .selected', 1, 'should have one filter selected')
     test.assertSelectorHasText('.filters .selected', 'All', 'default filter should be "All"')
-
   })
 
   // let's add a new item -----------------------------------------------
@@ -24,7 +21,6 @@ casper.test.begin('todomvc', 63, function (test) {
     createNewItem()
   })
   .then(function () {
-
     test.assertElementCount('.todo', 1, 'new item should be created')
     test.assertNotVisible('.todo .edit', 'new item edit box should be hidden')
     test.assertSelectorHasText('.todo label', 'test', 'new item should have correct label text')
@@ -32,12 +28,10 @@ casper.test.begin('todomvc', 63, function (test) {
     test.assertEvalEquals(function () {
       return __utils__.findOne('.todo .toggle').checked
     }, false, 'new item toggle should not be checked')
-
     test.assertVisible('.main', '.main should now be visible')
     test.assertVisible('.footer', '.footer should now be visible')
     test.assertNotVisible('.clear-completed', '.clear-completed should be hidden')
     test.assertField({type: 'css', path: '.new-todo'}, '', 'new todo input should be reset')
-
   })
 
   // add another item ---------------------------------------------------
@@ -58,7 +52,6 @@ casper.test.begin('todomvc', 63, function (test) {
     test.assertEval(function () {
       return __utils__.findOne('.todo').classList.contains('completed')
     }, 'it should be the first one')
-
     test.assertSelectorHasText('.todo-count strong', '1', 'remaining count should be 1')
     test.assertVisible('.clear-completed', '.clear-completed should now be visible')
   })
@@ -292,5 +285,4 @@ casper.test.begin('todomvc', 63, function (test) {
       document.querySelector('.todo:nth-child(1) .edit').value = ''
     })
   }
-
 })

+ 0 - 2
test/e2e/tree.js

@@ -1,5 +1,4 @@
 casper.test.begin('tree', 22, function (test) {
-
   casper
   .start('examples/tree/index.html')
   .then(function () {
@@ -51,5 +50,4 @@ casper.test.begin('tree', 22, function (test) {
   .run(function () {
     test.done()
   })
-
 })

+ 0 - 1
test/unit/specs/api/data_spec.js

@@ -3,7 +3,6 @@ var _ = require('src/util')
 var nextTick = _.nextTick
 
 describe('Data API', function () {
-
   var vm
   beforeEach(function () {
     spyWarns()

+ 0 - 12
test/unit/specs/api/dom_spec.js

@@ -7,7 +7,6 @@ var Vue = require('src')
 var _ = require('src/util')
 
 describe('DOM API', function () {
-
   var vm, vm2, parent, target, sibling, empty, spy
   beforeEach(function () {
     spy = jasmine.createSpy('dom')
@@ -29,7 +28,6 @@ describe('DOM API', function () {
   })
 
   describe('$appendTo', function () {
-
     it('normal instance', function () {
       vm.$appendTo(parent, spy)
       expect(parent.childNodes.length).toBe(3)
@@ -47,11 +45,9 @@ describe('DOM API', function () {
       expect(parent.childNodes[5]).toBe(vm2._fragmentEnd)
       expect(spy.calls.count()).toBe(1)
     })
-
   })
 
   describe('$prependTo', function () {
-
     it('normal instance', function () {
       vm.$prependTo(parent, spy)
       expect(parent.childNodes.length).toBe(3)
@@ -82,11 +78,9 @@ describe('DOM API', function () {
       expect(empty.childNodes[3]).toBe(vm2._fragmentEnd)
       expect(spy.calls.count()).toBe(2)
     })
-
   })
 
   describe('$before', function () {
-
     it('normal instance', function () {
       vm.$before(sibling, spy)
       expect(parent.childNodes.length).toBe(3)
@@ -104,11 +98,9 @@ describe('DOM API', function () {
       expect(parent.childNodes[4]).toBe(vm2._fragmentEnd)
       expect(spy.calls.count()).toBe(1)
     })
-
   })
 
   describe('$after', function () {
-
     it('normal instance', function () {
       vm.$after(target, spy)
       expect(parent.childNodes.length).toBe(3)
@@ -144,11 +136,9 @@ describe('DOM API', function () {
       expect(parent.childNodes[5]).toBe(vm2._fragmentEnd)
       expect(spy.calls.count()).toBe(1)
     })
-
   })
 
   describe('$remove', function () {
-
     it('normal instance', function () {
       vm.$before(sibling)
       expect(parent.childNodes.length).toBe(3)
@@ -179,11 +169,9 @@ describe('DOM API', function () {
       vm.$remove(spy)
       expect(spy.calls.count()).toBe(1)
     })
-
   })
 
   describe('$nextTick', function () {
-
     it('should work', function (done) {
       var context
       var called = false

+ 0 - 2
test/unit/specs/api/events_spec.js

@@ -1,7 +1,6 @@
 var Vue = require('src')
 
 describe('Events API', function () {
-
   var vm, spy
   beforeEach(function () {
     vm = new Vue()
@@ -232,5 +231,4 @@ describe('Events API', function () {
     parent.$refs.child.$dispatch('test')
     expect(spy.calls.count()).toBe(3)
   })
-
 })

+ 0 - 4
test/unit/specs/api/global_spec.js

@@ -3,7 +3,6 @@ var _ = require('src/util')
 var config = require('src/config')
 
 describe('Global API', function () {
-
   beforeEach(function () {
     spyWarns()
   })
@@ -86,7 +85,6 @@ describe('Global API', function () {
   })
 
   describe('Asset registration', function () {
-
     var Test = Vue.extend()
 
     it('directive / elementDirective / filter / transition', function () {
@@ -116,7 +114,5 @@ describe('Global API', function () {
       // extended registration should not pollute global
       expect(Vue.options.components.test).toBeUndefined()
     })
-
   })
-
 })

+ 0 - 8
test/unit/specs/api/lifecycle_spec.js

@@ -2,9 +2,7 @@ var Vue = require('src')
 var compiler = require('src/compiler')
 
 describe('Lifecycle API', function () {
-
   describe('$mount', function () {
-
     var el, frag
     beforeEach(function () {
       el = document.createElement('div')
@@ -145,11 +143,9 @@ describe('Lifecycle API', function () {
       vm.$mount(el)
       expect(hasWarned('$mount() should be called only once')).toBe(true)
     })
-
   })
 
   describe('$destroy', function () {
-
     it('normal', function () {
       var vm = new Vue()
       expect(vm._isDestroyed).toBe(false)
@@ -296,11 +292,9 @@ describe('Lifecycle API', function () {
         vm.$destroy()
       }).not.toThrow()
     })
-
   })
 
   describe('$compile', function () {
-
     it('should partial compile and teardown stuff', function (done) {
       var el = document.createElement('div')
       var vm = new Vue({
@@ -325,7 +319,5 @@ describe('Lifecycle API', function () {
         done()
       })
     })
-
   })
-
 })

+ 0 - 1
test/unit/specs/async_component_spec.js

@@ -2,7 +2,6 @@ var Vue = require('src')
 var _ = Vue.util
 
 describe('Async components', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')

+ 0 - 2
test/unit/specs/batcher_spec.js

@@ -3,9 +3,7 @@ var batcher = require('src/batcher')
 var nextTick = require('src/util').nextTick
 
 describe('Batcher', function () {
-
   var spy
-
   beforeEach(function () {
     spy = jasmine.createSpy('batcher')
     spyWarns()

+ 0 - 1
test/unit/specs/cache_spec.js

@@ -20,7 +20,6 @@ function toString (cache) {
 }
 
 describe('Cache', function () {
-
   var c = new Cache(4)
 
   it('put', function () {

+ 1 - 2
test/unit/specs/compiler/compile_spec.js

@@ -6,7 +6,6 @@ var publicDirectives = require('src/directives/public')
 var internalDirectives = require('src/directives/internal')
 
 describe('Compile', function () {
-
   var vm, el, data, directiveBind, directiveTeardown
   beforeEach(function () {
     // We mock vms here so we can assert what the generated
@@ -630,7 +629,7 @@ describe('Compile', function () {
         }
       },
       template: '<comp v-test></comp>',
-      components: { comp: { template: '<div></div>'}}
+      components: { comp: { template: '<div></div>' }}
     })
     expect(el.textContent).toBe('worked!')
     expect(getWarnCount()).toBe(0)

+ 9 - 10
test/unit/specs/compiler/transclude_spec.js

@@ -3,7 +3,6 @@ var Vue = require('src')
 var _ = require('src/util')
 
 describe('Transclude', function () {
-
   var el, options
   beforeEach(function () {
     el = document.createElement('div')
@@ -48,44 +47,44 @@ describe('Transclude', function () {
     // multiple root
     options.template = '<div></div><div></div>'
     res = transclude(el, options)
-    expect(res instanceof DocumentFragment).toBe(true)
+    expect(res.nodeType).toBe(11)
 
     // non-element
     options.template = '{{hi}}'
     res = transclude(el, options)
-    expect(res instanceof DocumentFragment).toBe(true)
+    expect(res.nodeType).toBe(11)
 
     // single component: <component>
     options.template = '<component bind-is="hi"></component>'
     res = transclude(el, options)
-    expect(res instanceof DocumentFragment).toBe(true)
+    expect(res.nodeType).toBe(11)
 
     // single component: custom element
     options.template = '<test></test>'
     options.components = { test: {}}
     res = transclude(el, options)
-    expect(res instanceof DocumentFragment).toBe(true)
+    expect(res.nodeType).toBe(11)
 
     // single component: is
     options.template = '<div is="test"></div>'
     res = transclude(el, options)
-    expect(res instanceof DocumentFragment).toBe(true)
+    expect(res.nodeType).toBe(11)
 
     // element directive
     options.template = '<el-dir></el-dir>'
     options.elementDirectives = { 'el-dir': {}}
     res = transclude(el, options)
-    expect(res instanceof DocumentFragment).toBe(true)
+    expect(res.nodeType).toBe(11)
 
     // v-for
     options.template = '<div v-for="item in list"></div>'
     res = transclude(el, options)
-    expect(res instanceof DocumentFragment).toBe(true)
+    expect(res.nodeType).toBe(11)
 
     // v-if
     options.template = '<div v-if="ok"></div>'
     res = transclude(el, options)
-    expect(res instanceof DocumentFragment).toBe(true)
+    expect(res.nodeType).toBe(11)
   })
 
   it('direct fragment instance', function () {
@@ -103,7 +102,7 @@ describe('Transclude', function () {
     var tpl = document.createElement('template')
     tpl.innerHTML = '<div>123</div>'
     var res = transclude(tpl, options)
-    expect(res instanceof DocumentFragment).toBe(true)
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(3)
     expect(res.childNodes[0].nodeType).toBe(3)
     expect(res.childNodes[1].textContent).toBe('123')

+ 0 - 1
test/unit/specs/directive_spec.js

@@ -3,7 +3,6 @@ var Directive = require('src/directive')
 var nextTick = Vue.nextTick
 
 describe('Directive', function () {
-
   var el, vm, def
   beforeEach(function () {
     el = document.createElement('div')

+ 0 - 2
test/unit/specs/directives/element/partial_spec.js

@@ -3,7 +3,6 @@ var _ = require('src/util')
 var compiler = require('src/compiler')
 
 describe('Partial', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')
@@ -118,5 +117,4 @@ describe('Partial', function () {
     expect(vm._directives[0].name).toBe('partial')
     expect(vm._watchers.length).toBe(0)
   })
-
 })

+ 0 - 2
test/unit/specs/directives/element/slot_spec.js

@@ -2,7 +2,6 @@ var Vue = require('src')
 var nextTick = Vue.nextTick
 
 describe('Slot Distribution', function () {
-
   var el, vm, options
   beforeEach(function () {
     el = document.createElement('div')
@@ -421,5 +420,4 @@ describe('Slot Distribution', function () {
       done()
     })
   })
-
 })

+ 0 - 1
test/unit/specs/directives/internal/class_spec.js

@@ -2,7 +2,6 @@ var _ = require('src/util')
 var def = require('src/directives/internal/class')
 
 describe(':class', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')

+ 0 - 1
test/unit/specs/directives/internal/component_spec.js

@@ -2,7 +2,6 @@ var _ = require('src/util')
 var Vue = require('src')
 
 describe('Component', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')

+ 0 - 3
test/unit/specs/directives/internal/prop_spec.js

@@ -1,7 +1,6 @@
 var Vue = require('src')
 
 describe('prop', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')
@@ -294,7 +293,6 @@ describe('prop', function () {
   })
 
   describe('assertions', function () {
-
     function makeInstance (value, type, validator, coerce) {
       return new Vue({
         el: document.createElement('div'),
@@ -417,7 +415,6 @@ describe('prop', function () {
       })
       expect(hasWarned('Missing required prop')).toBe(true)
     })
-
   })
 
   it('alternative syntax', function () {

+ 1 - 2
test/unit/specs/directives/internal/style_spec.js

@@ -18,7 +18,6 @@ function checkPrefixedProp (prop) {
 }
 
 describe(':style', function () {
-
   var el, dir
   beforeEach(function () {
     el = document.createElement('div')
@@ -113,7 +112,7 @@ describe(':style', function () {
     el.setAttribute(':style', 'divStyling')
     var vm = new Vue({
       el: el,
-      data: {divStyling: { display: 'none'}}
+      data: {divStyling: { display: 'none' }}
     })
     expect(el.style.display).toBe('none')
     vm.divStyling.display = 'block'

+ 0 - 1
test/unit/specs/directives/internal/transition_spec.js

@@ -4,7 +4,6 @@ var Directive = require('src/directive')
 var def = require('src/directives/internal/transition')
 
 describe('transition', function () {
-
   it('should instantiate a transition object with correct args', function () {
     var fns = {}
     var el = document.createElement('div')

+ 0 - 1
test/unit/specs/directives/public/bind_spec.js

@@ -3,7 +3,6 @@ var def = require('src/directives/public/bind')
 var xlinkNS = 'http://www.w3.org/1999/xlink'
 
 describe('v-bind', function () {
-
   var el, dir
   beforeEach(function () {
     el = document.createElement('div')

+ 0 - 1
test/unit/specs/directives/public/cloak_spec.js

@@ -2,7 +2,6 @@ var compile = require('src/compiler').compile
 var Vue = require('src')
 
 describe('v-cloak', function () {
-
   it('should not remove during compile', function () {
     var el = document.createElement('div')
     el.setAttribute('v-cloak', '')

+ 0 - 2
test/unit/specs/directives/public/el_spec.js

@@ -2,7 +2,6 @@ var _ = require('src/util')
 var Vue = require('src')
 
 describe('el', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')
@@ -38,5 +37,4 @@ describe('el', function () {
     })
     expect(vm.$el.textContent).toBe('1122')
   })
-
 })

+ 0 - 1
test/unit/specs/directives/public/for/for_ref_spec.js

@@ -2,7 +2,6 @@ var Vue = require('src')
 var _ = Vue.util
 
 describe('v-for + ref', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')

+ 1 - 3
test/unit/specs/directives/public/for/for_spec.js

@@ -3,7 +3,6 @@ var Vue = require('src')
 var config = require('src/config')
 
 describe('v-for', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')
@@ -479,7 +478,6 @@ describe('v-for', function () {
   })
 
   it('track by id', function (done) {
-
     var vm = new Vue({
       el: el,
       template: '<test v-for="item in list" :item="item" track-by="id"></test>',
@@ -889,7 +887,7 @@ describe('v-for', function () {
         ready: false
       }
     })
-    expect(vm.$els.a instanceof Element).toBe(true)
+    expect(vm.$els.a.nodeType).toBe(1)
     expect(vm.$els.a.innerHTML).toContain('<div>0</div><div>0</div>')
     vm.ready = true
     vm.$nextTick(function () {

+ 0 - 1
test/unit/specs/directives/public/for/for_stagger_spec.js

@@ -2,7 +2,6 @@ var Vue = require('src')
 var _ = Vue.util
 
 describe('v-for staggering transitions', function () {
-
   var el
   var delayAmount = 50
   var multiplier = 2.5 // the bigger the slower, but safer

+ 0 - 1
test/unit/specs/directives/public/html_spec.js

@@ -2,7 +2,6 @@ var _ = require('src/util')
 var def = require('src/directives/public/html')
 
 describe('v-html', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')

+ 0 - 1
test/unit/specs/directives/public/if_spec.js

@@ -2,7 +2,6 @@ var Vue = require('src')
 var nextTick = Vue.nextTick
 
 describe('v-if', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')

+ 0 - 1
test/unit/specs/directives/public/model_spec.js

@@ -34,7 +34,6 @@ function updateSelect (el, value) {
 }
 
 describe('v-model', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')

+ 0 - 1
test/unit/specs/directives/public/on_spec.js

@@ -10,7 +10,6 @@ function trigger (target, event, process) {
 }
 
 describe('v-on', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')

+ 0 - 1
test/unit/specs/directives/public/pre_spec.js

@@ -1,7 +1,6 @@
 var Vue = require('src')
 
 describe('v-pre', function () {
-
   beforeEach(function () {
     spyWarns()
   })

+ 0 - 1
test/unit/specs/directives/public/ref_spec.js

@@ -2,7 +2,6 @@ var _ = require('src/util')
 var Vue = require('src')
 
 describe('ref', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')

+ 0 - 1
test/unit/specs/directives/public/show_spec.js

@@ -3,7 +3,6 @@ var transition = require('src/transition')
 var def = require('src/directives/public/show')
 
 describe('v-show', function () {
-
   var el
   beforeEach(function () {
     el = document.createElement('div')

+ 0 - 1
test/unit/specs/directives/public/text_spec.js

@@ -2,7 +2,6 @@ var _ = require('src/util')
 var def = require('src/directives/public/text')
 
 describe('v-text', function () {
-
   it('element', function () {
     var dir = {
       el: document.createElement('div')

+ 4 - 5
test/unit/specs/filters/filters_spec.js

@@ -1,7 +1,6 @@
 var filters = require('src/filters')
 
 describe('Filters', function () {
-
   it('json read', function () {
     var filter = filters.json.read
     var obj = {a: {b: 2}}
@@ -129,7 +128,7 @@ describe('Filters', function () {
     var filter = filters.filterBy
     var arr = [
       { a: 1, b: { c: 'hello' }},
-      { a: 2, b: 'hello'},
+      { a: 2, b: 'hello' },
       { a: 3, b: ['yoyo'] }
     ]
     var res
@@ -188,9 +187,9 @@ describe('Filters', function () {
   it('orderBy', function () {
     var filter = filters.orderBy
     var arr = [
-      { a: { b: 0 }, c: 'b'},
-      { a: { b: 2 }, c: 'c'},
-      { a: { b: 1 }, c: 'a'}
+      { a: { b: 0 }, c: 'b' },
+      { a: { b: 2 }, c: 'c' },
+      { a: { b: 1 }, c: 'a' }
     ]
     var res
     // sort key

+ 0 - 7
test/unit/specs/instance/events_spec.js

@@ -2,7 +2,6 @@ var Vue = require('src')
 var _ = require('src/util')
 
 describe('Instance Events', function () {
-
   var spy, spy2
   beforeEach(function () {
     spy = jasmine.createSpy()
@@ -11,7 +10,6 @@ describe('Instance Events', function () {
   })
 
   describe('option events', function () {
-
     it('normal events', function () {
       var vm = new Vue({
         events: {
@@ -49,11 +47,9 @@ describe('Instance Events', function () {
       vm.$emit('test2')
       expect(hasWarned('Unknown method')).toBe(true)
     })
-
   })
 
   describe('option watchers', function () {
-
     it('normal', function (done) {
       var spyA = jasmine.createSpy()
       var spyB = jasmine.createSpy()
@@ -114,11 +110,9 @@ describe('Instance Events', function () {
         done()
       })
     })
-
   })
 
   describe('hooks', function () {
-
     it('created', function () {
       var ctx
       var vm = new Vue({
@@ -269,7 +263,6 @@ describe('Instance Events', function () {
     })
 
     describe('attached/detached', function () {
-
       it('in DOM', function () {
         var el = document.createElement('div')
         var childEl = document.createElement('div')

+ 0 - 1
test/unit/specs/instance/init_spec.js

@@ -2,7 +2,6 @@ var Vue = require('src')
 var init = Vue.prototype._init
 
 describe('Instance Init', function () {
-
   var stub = {
     constructor: {
       options: { a: 1, b: 2 }

+ 0 - 2
test/unit/specs/instance/misc_spec.js

@@ -1,9 +1,7 @@
 var Vue = require('src')
 
 describe('misc', function () {
-
   describe('_applyFilters', function () {
-
     var vm = new Vue({
       data: {
         msg: 'BBB'

+ 0 - 10
test/unit/specs/instance/state_spec.js

@@ -2,9 +2,7 @@ var Vue = require('src')
 var _ = require('src/util')
 
 describe('Instance state initialization', function () {
-
   describe('data proxy', function () {
-
     var data = {
       a: 0,
       b: 0
@@ -29,11 +27,9 @@ describe('Instance state initialization', function () {
       expect(vm.b).toBe(2)
       expect(vm.b).toBe(data.b)
     })
-
   })
 
   describe('$data', function () {
-
     it('should initialize props', function () {
       var vm = new Vue({
         el: document.createElement('div'),
@@ -104,7 +100,6 @@ describe('Instance state initialization', function () {
   })
 
   describe('computed', function () {
-
     var spyE = jasmine.createSpy('computed e')
     var spyF = jasmine.createSpy('cached computed f')
     var spyCachedWatcher = jasmine.createSpy('cached computed watcher')
@@ -237,7 +232,6 @@ describe('Instance state initialization', function () {
   })
 
   describe('methods', function () {
-
     it('should work and have correct context', function () {
       var vm = new Vue({
         data: {
@@ -252,11 +246,9 @@ describe('Instance state initialization', function () {
       })
       expect(vm.test()).toBe(1)
     })
-
   })
 
   describe('meta', function () {
-
     var vm = new Vue({
       _meta: {
         $index: 0,
@@ -270,7 +262,5 @@ describe('Instance state initialization', function () {
       expect('$index' in vm.$data).toBe(false)
       expect('$value' in vm.$data).toBe(false)
     })
-
   })
-
 })

+ 7 - 8
test/unit/specs/misc_spec.js

@@ -3,7 +3,6 @@ var Vue = require('src')
 var _ = Vue.util
 
 describe('Misc', function () {
-
   beforeEach(function () {
     spyWarns()
   })
@@ -343,13 +342,13 @@ describe('Misc', function () {
     new Vue({
       el: el,
       template:
-        '<div>\
-          <comp v-bind:title="title"></comp>\
-          <comp title="static" v-bind:title="title"></comp>\
-          <comp title="static"></comp>\
-          <comp :title="title"></comp>\
-          <comp title="static" :title="title"></comp>\
-        </div>',
+        '<div>' +
+          '<comp v-bind:title="title"></comp>' +
+          '<comp title="static" v-bind:title="title"></comp>' +
+          '<comp title="static"></comp>' +
+          '<comp :title="title"></comp>' +
+          '<comp title="static" :title="title"></comp>' +
+        '</div>',
       data: {
         title: 'bound'
       },

+ 0 - 1
test/unit/specs/observer/dep_spec.js

@@ -1,7 +1,6 @@
 var Dep = require('src/observer/dep')
 
 describe('Dep', function () {
-
   var d
   beforeEach(function () {
     d = new Dep()

+ 0 - 2
test/unit/specs/observer/observer_spec.js

@@ -7,7 +7,6 @@ var _ = require('src/util')
 var config = require('src/config')
 
 describe('Observer', function () {
-
   beforeEach(function () {
     spyWarns()
   })
@@ -382,5 +381,4 @@ describe('Observer', function () {
     expect(dep2.notify).toHaveBeenCalled()
     _.hasProto = true
   })
-
 })

+ 0 - 1
test/unit/specs/parsers/directive_spec.js

@@ -1,7 +1,6 @@
 var parse = require('src/parsers/directive').parseDirective
 
 describe('Directive Parser', function () {
-
   it('simple', function () {
     var res = parse('exp')
     expect(res.expression).toBe('exp')

+ 2 - 4
test/unit/specs/parsers/expression_spec.js

@@ -5,7 +5,7 @@ var testCases = [
     // simple path
     exp: 'a.b.d',
     scope: {
-      a: {b: {d: 123}}
+      a: { b: { d: 123 }}
     },
     expected: 123,
     paths: ['a']
@@ -14,7 +14,7 @@ var testCases = [
   {
     exp: 'a["b"].c',
     scope: {
-      a: {b: {c: 234}}
+      a: { b: { c: 234 }}
     },
     expected: 234,
     paths: ['a']
@@ -249,7 +249,6 @@ var testCases = [
 ]
 
 describe('Expression Parser', function () {
-
   testCases.forEach(function (testCase) {
     it('parse getter: ' + testCase.exp, function () {
       var res = expParser.parseExpression(testCase.exp, true)
@@ -288,7 +287,6 @@ describe('Expression Parser', function () {
   })
 
   describe('invalid expression', function () {
-
     beforeEach(function () {
       spyWarns()
     })

+ 0 - 2
test/unit/specs/parsers/path_spec.js

@@ -28,7 +28,6 @@ function pathMatch (a, b) {
 }
 
 describe('Path Parser', function () {
-
   it('parse simple paths', function () {
     assertPath('', [])
     assertPath(' ', [])
@@ -163,5 +162,4 @@ describe('Path Parser', function () {
     var res = Path.setPath({}, 'ab[c]d', 123)
     expect(res).toBe(false)
   })
-
 })

+ 12 - 13
test/unit/specs/parsers/template_spec.js

@@ -3,7 +3,6 @@ var parse = templateParser.parseTemplate
 var testString = '<div>hello</div><p class="test">world</p>'
 
 describe('Template Parser', function () {
-
   it('should return same if argument is already a fragment', function () {
     var frag = document.createDocumentFragment()
     var res = parse(frag)
@@ -22,31 +21,31 @@ describe('Template Parser', function () {
 
   it('should parse if argument is a template string', function () {
     var res = parse(testString)
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(2)
     expect(res.querySelector('.test').textContent).toBe('world')
   })
 
   it('should work if the template string doesn\'t contain tags', function () {
     var res = parse('hello!')
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(1)
     expect(res.firstChild.nodeType).toBe(3) // Text node
   })
 
   it('should handle string that contains html entities', function () {
     var res = parse('hi&lt;hi')
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(1)
     expect(res.firstChild.nodeValue).toBe('hi<hi')
     // #1330
     res = parse('hello &#x2F; hello')
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(1)
     expect(res.firstChild.nodeValue).toBe('hello / hello')
     // #2021
     res = parse('&#xe604;')
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(1)
     expect(res.firstChild.nodeValue).toBe('')
   })
@@ -55,7 +54,7 @@ describe('Template Parser', function () {
     var node = document.createElement('script')
     node.textContent = testString
     var res = parse(node)
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(2)
     expect(res.querySelector('.test').textContent).toBe('world')
   })
@@ -64,7 +63,7 @@ describe('Template Parser', function () {
     var node = document.createElement('div')
     node.innerHTML = testString
     var res = parse(node)
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(2)
     expect(res.querySelector('.test').textContent).toBe('world')
   })
@@ -76,7 +75,7 @@ describe('Template Parser', function () {
     node.textContent = testString
     document.head.appendChild(node)
     var res = parse('#template-test')
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(2)
     expect(res.querySelector('.test').textContent).toBe('world')
     document.head.removeChild(node)
@@ -84,7 +83,7 @@ describe('Template Parser', function () {
 
   it('should work for table elements', function () {
     var res = parse('<td>hello</td>')
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(1)
     expect(res.firstChild.tagName).toBe('TD')
     expect(res.firstChild.textContent).toBe('hello')
@@ -92,7 +91,7 @@ describe('Template Parser', function () {
 
   it('should work for option elements', function () {
     var res = parse('<option>hello</option>')
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(1)
     expect(res.firstChild.tagName).toBe('OPTION')
     expect(res.firstChild.textContent).toBe('hello')
@@ -100,7 +99,7 @@ describe('Template Parser', function () {
 
   it('should work for svg elements', function () {
     var res = parse('<circle></circle>')
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.childNodes.length).toBe(1)
     // SVG tagNames should be lowercase because they are XML nodes not HTML
     expect(res.firstChild.tagName).toBe('circle')
@@ -133,7 +132,7 @@ describe('Template Parser', function () {
 
   it('should be able to not use id selectors', function () {
     var res = parse('#hi', false, true)
-    expect(res instanceof DocumentFragment).toBeTruthy()
+    expect(res.nodeType).toBe(11)
     expect(res.firstChild.nodeValue).toBe('#hi')
   })
 

+ 0 - 2
test/unit/specs/parsers/text_spec.js

@@ -69,7 +69,6 @@ function assertParse (test) {
 }
 
 describe('Text Parser', function () {
-
   it('parse', function () {
     testCases.forEach(assertParse)
   })
@@ -118,5 +117,4 @@ describe('Text Parser', function () {
         JSON.stringify(filters) +
       ',false)+" e"')
   })
-
 })

+ 0 - 8
test/unit/specs/transition/transition_spec.js

@@ -5,7 +5,6 @@ var Transition = require('src/transition/transition')
 
 if (!_.isIE9) {
   describe('Transition', function () {
-
     // insert a test css
     function insertCSS (text) {
       var cssEl = document.createElement('style')
@@ -42,7 +41,6 @@ if (!_.isIE9) {
     )
 
     describe('Wrapper methods', function () {
-
       var spy, el, target, parent, vm
       beforeEach(function () {
         el = document.createElement('div')
@@ -72,11 +70,9 @@ if (!_.isIE9) {
         expect(parent.childNodes.length).toBe(0)
         expect(spy).toHaveBeenCalled()
       })
-
     })
 
     describe('Skipping', function () {
-
       var el, vm, op, cb
       beforeEach(function () {
         el = document.createElement('div')
@@ -121,11 +117,9 @@ if (!_.isIE9) {
         expect(cb).toHaveBeenCalled()
         _.transitionEndEvent = e
       })
-
     })
 
     describe('CSS transitions', function () {
-
       var vm, el, op, cb, hooks
       beforeEach(function (done) {
         el = document.createElement('div')
@@ -427,11 +421,9 @@ if (!_.isIE9) {
           })
         })
       })
-
     })
 
     describe('JavaScript only transitions', function () {
-
       var el, vm, op, cb, hooks
       beforeEach(function () {
         hooks = {}

+ 0 - 1
test/unit/specs/util/component_spec.js

@@ -1,7 +1,6 @@
 var _ = require('src/util')
 
 describe('Util - component', function () {
-
   it('checkComponentAttr', function () {
     var el = document.createElement('component')
 

+ 0 - 3
test/unit/specs/util/debug_spec.js

@@ -3,9 +3,7 @@ var config = require('src/config')
 var warnPrefix = '[Vue warn]: '
 
 if (typeof console !== 'undefined') {
-
   describe('Util - Debug', function () {
-
     beforeEach(function () {
       spyOn(console, 'log')
       spyOn(console, 'warn')
@@ -25,6 +23,5 @@ if (typeof console !== 'undefined') {
       _.warn('oops')
       expect(console.warn).not.toHaveBeenCalled()
     })
-
   })
 }

+ 0 - 1
test/unit/specs/util/dom_spec.js

@@ -1,7 +1,6 @@
 var _ = require('src/util')
 
 describe('Util - DOM', function () {
-
   var parent, child, target
 
   function div () {

+ 0 - 2
test/unit/specs/util/env_spec.js

@@ -1,9 +1,7 @@
 var _ = require('src/util')
 
 describe('Util - Environment', function () {
-
   describe('nextTick', function () {
-
     it('should accept context', function (done) {
       var ctx = {}
       _.nextTick(function () {

+ 0 - 1
test/unit/specs/util/lang_spec.js

@@ -1,7 +1,6 @@
 var _ = require('src/util')
 
 describe('Util - Language Enhancement', function () {
-
   it('hasOwn', function () {
     var obj1 = { a: 1 }
     expect(_.hasOwn(obj1, 'a')).toBe(true)

+ 10 - 13
test/unit/specs/util/options_spec.js

@@ -4,7 +4,6 @@ var merge = _.mergeOptions
 var resolveAsset = _.resolveAsset
 
 describe('Util - Option merging', function () {
-
   beforeEach(function () {
     spyWarns()
   })
@@ -41,7 +40,6 @@ describe('Util - Option merging', function () {
   })
 
   it('events', function () {
-
     // no parent
     res = merge({}, {events: 1})
     expect(res.events).toBe(1)
@@ -181,7 +179,7 @@ describe('Util - Option merging', function () {
   it('class el merge', function () {
     function fn1 () {}
     function fn2 () {}
-    var res = merge({el: fn1}, {el: fn2})
+    var res = merge({ el: fn1 }, { el: fn2 })
     expect(res.el).toBe(fn2)
   })
 
@@ -193,14 +191,14 @@ describe('Util - Option merging', function () {
       return { a: 2, b: 3, d: { f: 2 }}
     }
     // both present
-    var res = merge({data: fn1}, {data: fn2}).data()
+    var res = merge({ data: fn1 }, { data: fn2 }).data()
     expect(res.a).toBe(2)
     expect(res.b).toBe(3)
     expect(res.c).toBe(4)
     expect(res.d.e).toBe(1)
     expect(res.d.f).toBe(2)
     // only parent
-    res = merge({data: fn1}, {}).data()
+    res = merge({ data: fn1 }, {}).data()
     expect(res.a).toBe(1)
     expect(res.b).toBeUndefined()
     expect(res.c).toBe(4)
@@ -219,16 +217,16 @@ describe('Util - Option merging', function () {
       return 2
     }
     // both functions
-    var res = merge({el: fn1}, {el: fn2}, vm)
+    var res = merge({ el: fn1 }, { el: fn2 }, vm)
     expect(res.el).toBe(2)
     // direct instance el
-    res = merge({el: fn1}, {el: 2}, vm)
+    res = merge({ el: fn1 }, { el: 2 }, vm)
     expect(res.el).toBe(2)
     // no parent
-    res = merge({}, {el: 2}, vm)
+    res = merge({}, { el: 2 }, vm)
     expect(res.el).toBe(2)
     // no child
-    res = merge({el: fn1}, {}, vm)
+    res = merge({ el: fn1 }, {}, vm)
     expect(res.el).toBe(1)
   })
 
@@ -269,7 +267,9 @@ describe('Util - Option merging', function () {
     observe(instanceData)
     var res = merge(
       {
-        data: function () { return { b: 234} }
+        data: function () {
+          return { b: 234 }
+        }
       },
       {
         data: instanceData
@@ -350,11 +350,9 @@ describe('Util - Option merging', function () {
     merge(a, b)
     expect(hasWarned('must provide a "name" or "id" field')).toBe(true)
   })
-
 })
 
 describe('Util - Option resolveAsset', function () {
-
   var vm
   beforeEach(function () {
     vm = new Vue({
@@ -378,5 +376,4 @@ describe('Util - Option resolveAsset', function () {
     expect(resolveAsset(vm.$options, 'components', 'camel-cased-component')).toBeTruthy()
     expect(resolveAsset(vm.$options, 'components', 'pascal-cased-component')).toBeTruthy()
   })
-
 })

+ 5 - 8
test/unit/specs/watcher_spec.js

@@ -5,9 +5,7 @@ var _ = Vue.util
 var config = Vue.config
 
 describe('Watcher', function () {
-
   var vm, spy
-
   beforeEach(function () {
     vm = new Vue({
       filters: {},
@@ -164,7 +162,7 @@ describe('Watcher', function () {
     var watcher2 = new Watcher(vm, 'e', spy2)
     expect(watcher.value).toBe(2)
     expect(watcher2.value).toBeUndefined()
-    vm.$data = { b: { c: 3}, e: 4 }
+    vm.$data = { b: { c: 3 }, e: 4 }
     nextTick(function () {
       expect(watcher.value).toBe(3)
       expect(watcher2.value).toBe(4)
@@ -181,7 +179,7 @@ describe('Watcher', function () {
     nextTick(function () {
       expect(watcher.value).toBe(3)
       expect(spy).toHaveBeenCalledWith(3, 2)
-      vm.$data = { b: {c: 4}}
+      vm.$data = { b: { c: 4 }}
       nextTick(function () {
         expect(watcher.value).toBe(4)
         expect(spy).toHaveBeenCalledWith(4, 3)
@@ -212,8 +210,8 @@ describe('Watcher', function () {
     }
     var watcher = new Watcher(vm, 'b.c', spy, {
       filters: [
-        { name: 'test', args: [{value: 3, dynamic: false}]},
-        { name: 'test2', args: [{value: 'msg', dynamic: true}]}
+        { name: 'test', args: [{ value: 3, dynamic: false }] },
+        { name: 'test2', args: [{ value: 'msg', dynamic: true }] }
       ]
     })
     expect(watcher.value).toBe('6yo')
@@ -275,7 +273,7 @@ describe('Watcher', function () {
     nextTick(function () {
       expect(spy).toHaveBeenCalledWith(vm.b, vm.b)
       var oldB = vm.b
-      vm.b = { c: [{a: 1}]}
+      vm.b = { c: [{ a: 1 }]}
       nextTick(function () {
         expect(spy).toHaveBeenCalledWith(vm.b, oldB)
         expect(spy.calls.count()).toBe(2)
@@ -374,5 +372,4 @@ describe('Watcher', function () {
     watcher.set(123)
     expect(hasWarned('Error when evaluating setter')).toBe(true)
   })
-
 })