Skip to content

Commit 3357fbb

Browse files
committed
lint
1 parent 3df376d commit 3357fbb

File tree

4 files changed

+183
-9
lines changed

4 files changed

+183
-9
lines changed

.eslintrc

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

examples/todoApp/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424

2525
<script>
26-
var app = new Vue({
26+
new Vue({
2727
el: '#app',
2828
data: {
2929
newTodo: ''

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Firebase bindings for Vue.js",
55
"main": "src/vuefire.js",
66
"scripts": {
7+
"lint": "eslint src tests examples --ext js,html",
78
"test": "echo \"Error: no test specified\" && exit 1"
89
},
910
"repository": {
@@ -21,5 +22,9 @@
2122
"bugs": {
2223
"url": "https://github.com/firebase/vuefire/issues"
2324
},
24-
"homepage": "https://github.com/firebase/vuefire#readme"
25+
"homepage": "https://github.com/firebase/vuefire#readme",
26+
"devDependencies": {
27+
"eslint": "^1.10.3",
28+
"eslint-plugin-html": "^1.1.0"
29+
}
2530
}

src/vuefire.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
(function (root, factory) {
2-
if (typeof exports === 'object' && typeof module === 'object')
2+
if (typeof exports === 'object' && typeof module === 'object') {
33
module.exports = factory()
4-
else if (typeof define === 'function' && define.amd)
4+
} else if (typeof define === 'function' && define.amd) {
55
define([], factory)
6-
else if (typeof exports === 'object')
7-
exports["VueFire"] = factory()
8-
else
9-
root["VueFire"] = factory()
6+
} else if (typeof exports === 'object') {
7+
exports.VueFire = factory()
8+
} else {
9+
root.VueFire = factory()
10+
}
1011
})(this, function () {
1112

1213
/**
@@ -60,7 +61,7 @@
6061
*/
6162
function bind (vm, data, key, source) {
6263
if (!isObject(source)) {
63-
throw new Error('Invalid Firebase binding source');
64+
throw new Error('Invalid Firebase binding source')
6465
}
6566
var asArray = false
6667
var cancelCallback = null

0 commit comments

Comments
 (0)