Skip to content

Commit 521e8d2

Browse files
committed
use standard and eslint 2.0
1 parent 6d85660 commit 521e8d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+71
-542
lines changed

.eslintrc

+2-177
Original file line numberDiff line numberDiff line change
@@ -1,181 +1,6 @@
11
{
2-
"env": {
3-
"browser": true,
4-
"node": true
5-
},
6-
7-
"globals": {
8-
"jQuery": true
9-
},
10-
11-
"ecmaFeatures": {
12-
"arrowFunctions": true,
13-
"destructuring": true,
14-
"classes": true,
15-
"defaultParams": true,
16-
"blockBindings": true,
17-
"modules": true,
18-
"objectLiteralComputedProperties": true,
19-
"objectLiteralShorthandMethods": true,
20-
"objectLiteralShorthandProperties": true,
21-
"restParams": true,
22-
"spread": true,
23-
"templateStrings": true
24-
},
25-
2+
"extends": "standard",
263
"rules": {
27-
"accessor-pairs": 2,
28-
"array-bracket-spacing": 0,
29-
"block-scoped-var": 0,
30-
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
31-
"camelcase": 0,
32-
"comma-dangle": [2, "never"],
33-
"comma-spacing": [2, { "before": false, "after": true }],
34-
"comma-style": [2, "last"],
35-
"complexity": 0,
36-
"computed-property-spacing": 0,
37-
"consistent-return": 0,
38-
"consistent-this": 0,
39-
"constructor-super": 2,
40-
"curly": [2, "multi-line"],
41-
"default-case": 0,
42-
"dot-location": [2, "property"],
43-
"dot-notation": 0,
44-
"eol-last": 2,
45-
"eqeqeq": [2, "allow-null"],
46-
"func-names": 0,
47-
"func-style": 0,
48-
"generator-star-spacing": [2, { "before": true, "after": true }],
49-
"guard-for-in": 0,
50-
"handle-callback-err": [2, "^(err|error)$" ],
51-
"indent": [2, 2, { "SwitchCase": 1 }],
52-
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
53-
"linebreak-style": 0,
54-
"lines-around-comment": 0,
55-
"max-nested-callbacks": 0,
56-
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
57-
"new-parens": 2,
58-
"newline-after-var": 0,
59-
"no-alert": 0,
60-
"no-array-constructor": 2,
61-
"no-caller": 2,
62-
"no-catch-shadow": 0,
63-
"no-cond-assign": 2,
64-
"no-console": 0,
65-
"no-constant-condition": 0,
66-
"no-continue": 0,
67-
"no-control-regex": 2,
68-
"no-debugger": 2,
69-
"no-delete-var": 2,
70-
"no-div-regex": 0,
71-
"no-dupe-args": 2,
72-
"no-dupe-keys": 2,
73-
"no-duplicate-case": 2,
74-
"no-else-return": 0,
75-
"no-empty": 0,
76-
"no-empty-character-class": 2,
77-
"no-empty-label": 2,
78-
"no-eq-null": 0,
79-
"no-eval": 2,
80-
"no-ex-assign": 2,
81-
"no-extend-native": 2,
82-
"no-extra-bind": 2,
83-
"no-extra-boolean-cast": 2,
84-
"no-extra-parens": 0,
85-
"no-extra-semi": 0,
86-
"no-fallthrough": 2,
87-
"no-floating-decimal": 2,
88-
"no-func-assign": 2,
89-
"no-implied-eval": 2,
90-
"no-inline-comments": 0,
91-
"no-inner-declarations": [2, "functions"],
92-
"no-invalid-regexp": 2,
93-
"no-irregular-whitespace": 2,
94-
"no-iterator": 2,
95-
"no-label-var": 2,
96-
"no-labels": 2,
97-
"no-lone-blocks": 2,
98-
"no-lonely-if": 0,
99-
"no-loop-func": 0,
100-
"no-mixed-requires": 0,
101-
"no-mixed-spaces-and-tabs": 2,
102-
"no-multi-spaces": 2,
103-
"no-multi-str": 2,
104-
"no-multiple-empty-lines": [2, { "max": 1 }],
105-
"no-native-reassign": 2,
106-
"no-negated-in-lhs": 2,
107-
"no-nested-ternary": 0,
108-
"no-new": 2,
109-
"no-new-func": 0,
110-
"no-new-object": 2,
111-
"no-new-require": 2,
112-
"no-new-wrappers": 2,
113-
"no-obj-calls": 2,
114-
"no-octal": 2,
115-
"no-octal-escape": 2,
116-
"no-param-reassign": 0,
117-
"no-path-concat": 0,
118-
"no-process-env": 0,
119-
"no-process-exit": 0,
120-
"no-proto": 0,
121-
"no-redeclare": 2,
122-
"no-regex-spaces": 2,
123-
"no-restricted-modules": 0,
124-
"no-return-assign": 2,
125-
"no-script-url": 0,
126-
"no-self-compare": 2,
127-
"no-sequences": 2,
128-
"no-shadow": 0,
129-
"no-shadow-restricted-names": 2,
130-
"no-spaced-func": 2,
131-
"no-sparse-arrays": 2,
132-
"no-sync": 0,
133-
"no-ternary": 0,
134-
"no-this-before-super": 2,
135-
"no-throw-literal": 2,
136-
"no-trailing-spaces": 2,
137-
"no-undef": 2,
138-
"no-undef-init": 2,
139-
"no-undefined": 0,
140-
"no-underscore-dangle": 0,
141-
"no-unexpected-multiline": 2,
142-
"no-unneeded-ternary": 2,
143-
"no-unreachable": 2,
144-
"no-unused-expressions": 0,
145-
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
146-
"no-use-before-define": 0,
147-
"no-var": 0,
148-
"no-void": 0,
149-
"no-warning-comments": 0,
150-
"no-with": 2,
151-
"object-curly-spacing": 0,
152-
"object-shorthand": 0,
153-
"one-var": [2, { "initialized": "never" }],
154-
"operator-assignment": 0,
155-
"operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }],
156-
"padded-blocks": 0,
157-
"prefer-const": 0,
158-
"quote-props": 0,
159-
"quotes": [2, "single", "avoid-escape"],
160-
"radix": 2,
161-
"semi": [2, "never"],
162-
"semi-spacing": 0,
163-
"sort-vars": 0,
164-
"space-after-keywords": [2, "always"],
165-
"space-before-blocks": [2, "always"],
166-
"space-before-function-paren": [2, "always"],
167-
"space-in-parens": [2, "never"],
168-
"space-infix-ops": 2,
169-
"space-return-throw-case": 2,
170-
"space-unary-ops": [2, { "words": true, "nonwords": false }],
171-
"spaced-comment": [2, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!"] }],
172-
"strict": 0,
173-
"use-isnan": 2,
174-
"valid-jsdoc": 0,
175-
"valid-typeof": 2,
176-
"vars-on-top": 0,
177-
"wrap-iife": [2, "any"],
178-
"wrap-regex": 0,
179-
"yoda": [2, "never"]
4+
"arrow-parens": [2, "as-needed"]
1805
}
1816
}

build/karma.cover.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ var assign = require('object-assign')
22
var base = require('./karma.base.config.js')
33

44
module.exports = function (config) {
5-
65
var options = assign(base, {
76
browsers: ['PhantomJS'],
87
reporters: ['progress', 'coverage'],

build/karma.sauce.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ var batches = [
6464
]
6565

6666
module.exports = function (config) {
67-
6867
var batch = batches[process.argv[4] || 0]
6968

7069
config.set(assign(base, {

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@
5151
"babel-runtime": "^5.8.0",
5252
"casperjs": "^1.1.0-beta3",
5353
"codecov.io": "^0.1.2",
54-
"eslint": "^1.3.1",
54+
"eslint": "^2.1.0",
55+
"eslint-config-standard": "^5.1.0",
56+
"eslint-plugin-promise": "^1.0.8",
57+
"eslint-plugin-standard": "^1.3.2",
5558
"istanbul-instrumenter-loader": "^0.1.3",
5659
"jasmine-core": "^2.3.4",
5760
"karma": "^0.13.8",

src/directives/internal/prop.js

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const bindingModes = config._propBindingModes
1212
export default {
1313

1414
bind () {
15-
1615
var child = this.vm
1716
var parent = child._context
1817
// passed in from compiler directly

src/directives/public/model/text.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global jQuery */
2+
13
import {
24
isIE9,
35
isAndroid,

src/instance/api/data.js

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { isSimplePath, parseExpression } from '../../parsers/expression'
88
const filterRE = /[^|]\|[^|]/
99

1010
export default function (Vue) {
11-
1211
/**
1312
* Get the value from an expression on this vm.
1413
*

src/instance/api/dom.js

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
} from '../../transition/index'
1515

1616
export default function (Vue) {
17-
1817
/**
1918
* Convenience on-instance nextTick. The callback is
2019
* auto-bound to the instance, and this avoids component

src/instance/api/events.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { toArray } from '../../util/index'
22

33
export default function (Vue) {
4-
54
/**
65
* Listen on the given `event` with `fn`.
76
*

src/instance/api/global.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import FragmentFactory from '../../fragment/factory'
2323
import internalDirectives from '../../directives/internal/index'
2424

2525
export default function (Vue) {
26-
2726
/**
2827
* Expose useful internals
2928
*/
@@ -118,10 +117,12 @@ export default function (Vue) {
118117
*/
119118

120119
function createClass (name) {
120+
/* eslint-disable no-new-func */
121121
return new Function(
122122
'return function ' + classify(name) +
123123
' (options) { this._init(options) }'
124124
)()
125+
/* eslint-enable no-new-func */
125126
}
126127

127128
/**

src/instance/api/lifecycle.js

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { warn, query, inDoc } from '../../util/index'
22
import { compile } from '../../compiler/index'
33

44
export default function (Vue) {
5-
65
/**
76
* Set instance target element and kick off the compilation
87
* process. The passed in `el` can be a selector string, an

src/instance/internal/events.js

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
const eventRE = /^v-on:|^@/
88

99
export default function (Vue) {
10-
1110
/**
1211
* Setup the instance's option events & watchers.
1312
* If the value is a string, we pull it from the

src/instance/internal/init.js

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { mergeOptions } from '../../util/index'
33
let uid = 0
44

55
export default function (Vue) {
6-
76
/**
87
* The main init sequence. This is called for every
98
* instance, including ones that are created from extended
@@ -16,7 +15,6 @@ export default function (Vue) {
1615
*/
1716

1817
Vue.prototype._init = function (options) {
19-
2018
options = options || {}
2119

2220
this.$el = null

src/instance/internal/lifecycle.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { replace, getAttr, isFragment } from '../../util/index'
33
import { compile, compileRoot, transclude } from '../../compiler/index'
44

55
export default function (Vue) {
6-
76
/**
87
* Update v-ref for component.
98
*

src/instance/internal/misc.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
} from '../../util/index'
77

88
export default function (Vue) {
9-
109
/**
1110
* Apply a list of filter (descriptors) to a value.
1211
* Using plain for loops here because this will be called in

src/instance/internal/state.js

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
} from '../../util/index'
1717

1818
export default function (Vue) {
19-
2019
/**
2120
* Accessor for `$data` property, since setting $data
2221
* requires observing the new object and updating

src/observer/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ Observer.prototype.removeVm = function (vm) {
112112
*/
113113

114114
function protoAugment (target, src) {
115+
/* eslint-disable no-proto */
115116
target.__proto__ = src
117+
/* eslint-enable no-proto */
116118
}
117119

118120
/**

src/parsers/directive.js

-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ function processFilterArg (arg) {
7676
*/
7777

7878
export function parseDirective (s) {
79-
8079
var hit = cache.get(s)
8180
if (hit) {
8281
return hit

src/parsers/expression.js

+2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ function compileGetter (exp) {
136136

137137
function makeGetterFn (body) {
138138
try {
139+
/* eslint-disable no-new-func */
139140
return new Function('scope', 'return ' + body + ';')
141+
/* eslint-enable no-new-func */
140142
} catch (e) {
141143
process.env.NODE_ENV !== 'production' && warn(
142144
'Invalid expression. ' +

src/parsers/template.js

-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ function stringToFragment (templateString, raw) {
107107
document.createTextNode(templateString)
108108
)
109109
} else {
110-
111110
var tag = tagMatch && tagMatch[1]
112111
var wrap = map[tag] || map.efault
113112
var depth = wrap[0]

src/transition/transition.js

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ p.enter = function (op, cb) {
117117
*/
118118

119119
p.enterNextTick = function () {
120-
121120
// Important hack:
122121
// in Chrome, if a just-entered element is applied the
123122
// leave class while its interpolated property still has

src/util/component.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export function assertProp (prop, value) {
144144
}
145145
var validator = options.validator
146146
if (validator) {
147-
if (!validator.call(null, value)) {
147+
if (!validator(value)) {
148148
process.env.NODE_ENV !== 'production' && warn(
149149
'Invalid prop: custom validator check failed for ' +
150150
prop.path + '="' + prop.raw + '"'

src/util/env.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global MutationObserver */
2+
13
// can we use __proto__?
24
export const hasProto = '__proto__' in {}
35

0 commit comments

Comments
 (0)