Skip to content

Commit 7cf0f58

Browse files
committed
use eslint
1 parent a0b1a38 commit 7cf0f58

Some content is hidden

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

51 files changed

+329
-153
lines changed

.eslintrc

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

build/grunt-tasks/casper.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
module.exports = function (grunt) {
6-
grunt.registerTask( 'casper', function (id) {
6+
grunt.registerTask('casper', function (id) {
77
var path = require('path')
88
var done = this.async()
99
var file = id ? id + '.js' : ''
@@ -23,4 +23,4 @@ module.exports = function (grunt) {
2323
done()
2424
})
2525
})
26-
}
26+
}

build/grunt-tasks/codecov.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ module.exports = function (grunt) {
66
var coverage = require('fs').readFileSync('coverage/lcov.info', 'utf-8')
77
sendToCodeCov(coverage, function (err) {
88
if (err) {
9-
console.log("error sending to codecov.io: ", err, err.stack);
10-
if (/non-success response/.test(err.message)){
11-
console.log("detail: ", err.detail);
9+
console.log('error sending to codecov.io: ', err, err.stack)
10+
if (/non-success response/.test(err.message)) {
11+
console.log('detail: ', err.detail)
1212
}
1313
}
1414
done()

build/grunt-tasks/release.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ module.exports = function (grunt) {
8080
function blue (str) {
8181
return '\x1b[1m\x1b[34m' + str + '\x1b[39m\x1b[22m'
8282
}
83-
}
83+
}

build/saucelabs-config.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var sauceConfig = {
22
testName: 'Vue.js unit tests',
33
recordScreenshots: false,
4-
build: process.env.TRAVIS_JOB_ID || Date.now(),
4+
build: process.env.TRAVIS_JOB_ID || Date.now()
55
}
66

77
/**
@@ -24,23 +24,23 @@ var batches = [
2424
},
2525
sl_mac_safari: {
2626
base: 'SauceLabs',
27-
browserName: "safari",
28-
platform: "OS X 10.10"
27+
browserName: 'safari',
28+
platform: 'OS X 10.10'
2929
}
3030
},
3131
// ie family
3232
{
3333
sl_ie_9: {
3434
base: 'SauceLabs',
35-
browserName: "internet explorer",
36-
platform: "Windows 7",
37-
version: "9"
35+
browserName: 'internet explorer',
36+
platform: 'Windows 7',
37+
version: '9'
3838
},
3939
sl_ie_10: {
4040
base: 'SauceLabs',
41-
browserName: "internet explorer",
42-
platform: "Windows 8",
43-
version: "10"
41+
browserName: 'internet explorer',
42+
platform: 'Windows 8',
43+
version: '10'
4444
},
4545
sl_ie_11: {
4646
base: 'SauceLabs',
@@ -67,7 +67,7 @@ var batches = [
6767
]
6868

6969
for (var i = 0; i < 3; i++) {
70-
exports['batch' + (i+1)] = {
70+
exports['batch' + (i + 1)] = {
7171
sauceLabs: sauceConfig,
7272
// mobile emulators are really slow
7373
captureTimeout: 300000,

build/webpack-dev-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ module.exports = {
77
libraryTarget: 'umd'
88
},
99
devtool: '#source-map'
10-
}
10+
}

build/webpack-test-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ module.exports = {
1010
filename: 'specs.js'
1111
},
1212
devtool: '#source-map'
13-
}
13+
}

src/api/child.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ exports.$addChild = function (opts, BaseCtor) {
4444
opts._root = parent.$root
4545
var child = new ChildVue(opts)
4646
return child
47-
}
47+
}

src/cache.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ var p = Cache.prototype
3333

3434
p.put = function (key, value) {
3535
var entry = {
36-
key:key,
37-
value:value
36+
key: key,
37+
value: value
3838
}
3939
this._keymap[key] = entry
4040
if (this.tail) {
@@ -109,4 +109,4 @@ p.get = function (key, returnEntry) {
109109
: entry.value
110110
}
111111

112-
module.exports = Cache
112+
module.exports = Cache

src/compiler/compile.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ exports.compile = function (el, options, partial, host) {
6565
if (nodeLinkFn) nodeLinkFn(vm, el, host)
6666
if (childLinkFn) childLinkFn(vm, childNodes, host)
6767
}, vm)
68-
//
6968
return makeUnlinkFn(vm, dirs)
7069
}
7170
}
@@ -88,7 +87,7 @@ function linkAndCapture (linker, vm) {
8887
* Linker functions return an unlink function that
8988
* tearsdown all directives instances generated during
9089
* the process.
91-
*
90+
*
9291
* We create unlink functions with only the necessary
9392
* information to avoid retaining additional closures.
9493
*
@@ -163,7 +162,7 @@ exports.compileAndLinkProps = function (vm, el, props) {
163162
* @return {Function}
164163
*/
165164

166-
exports.compileAndLinkRoot = function (vm, el, options) {
165+
exports.compileAndLinkRoot = function (vm, el, options) {
167166
var containerAttrs = options._containerAttrs
168167
var replacerAttrs = options._replacerAttrs
169168
var contextLinkFn, replacerLinkFn
@@ -608,7 +607,6 @@ function checkTerminalDirectives (el, options) {
608607
return skip
609608
}
610609
var value, dirName
611-
/* jshint boss: true */
612610
for (var i = 0, l = terminalDirectives.length; i < l; i++) {
613611
dirName = terminalDirectives[i]
614612
if ((value = _.attr(el, dirName)) !== null) {

src/compiler/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var _ = require('../util')
22

33
_.extend(exports, require('./compile'))
4-
_.extend(exports, require('./transclude'))
4+
_.extend(exports, require('./transclude'))

src/directive.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,4 @@ p._withLock = function (fn) {
217217
})
218218
}
219219

220-
module.exports = Directive
220+
module.exports = Directive

src/directives/class.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var addClass = _.addClass
33
var removeClass = _.removeClass
44

55
module.exports = {
6-
6+
77
update: function (value) {
88
if (this.arg) {
99
// single toggle
@@ -42,4 +42,4 @@ module.exports = {
4242
}
4343
}
4444
}
45-
}
45+
}

src/directives/cloak.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
var config = require('../config')
22

33
module.exports = {
4-
54
bind: function () {
65
var el = this.el
76
this.vm.$once('hook:compiled', function () {
87
el.removeAttribute(config.prefix + 'cloak')
98
})
109
}
11-
12-
}
10+
}

src/directives/component.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ module.exports = {
257257
/**
258258
* Set childVM and parent ref
259259
*/
260-
260+
261261
setCurrent: function (child) {
262262
this.childVM = child
263263
var refID = child._refID || this.refID

0 commit comments

Comments
 (0)