Skip to content

Commit e79a94b

Browse files
committed
Added .eslint and linted. Formatting, etc
1 parent fdfc04d commit e79a94b

16 files changed

+403
-246
lines changed

.eslintrc

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"browser": true,
5+
"builtin": true
6+
},
7+
"rules": {
8+
9+
10+
/**
11+
* Possible Errors
12+
*/
13+
"comma-dangle": [ 2, "always-multiline" ],
14+
"no-cond-assign": [ 2, "except-parens" ],
15+
"no-debugger": 2,
16+
"no-dupe-args": 2,
17+
"no-dupe-keys": 2,
18+
"no-duplicate-case": 2,
19+
"no-empty": 2,
20+
"no-empty-character-class": 2,
21+
"no-ex-assign": 2,
22+
"no-extra-boolean-cast": 2,
23+
// "no-extra-parens": 2,
24+
"no-extra-semi": 2,
25+
"no-irregular-whitespace": 2,
26+
"no-obj-calls": 2,
27+
"no-unexpected-multiline": 2,
28+
"no-unreachable": 2,
29+
// "valid-jsdoc": 2,
30+
"valid-typeof": 2,
31+
32+
33+
/**
34+
* Best Practices
35+
*/
36+
"block-scoped-var": 2,
37+
"curly": [ 2, "multi-line" ],
38+
"dot-location": [ 2, "property" ],
39+
"dot-notation": 2,
40+
"eqeqeq": [ 2, "allow-null" ],
41+
"guard-for-in": 2,
42+
"no-alert": 2,
43+
"no-caller": 2,
44+
"no-div-regex": 2,
45+
"no-else-return": 2,
46+
"no-eq-null": 2,
47+
"no-eval": 2,
48+
"no-extend-native": 2,
49+
"no-extra-bind": 2,
50+
"no-floating-decimal": 2,
51+
"no-iterator": 2,
52+
"no-labels": 2,
53+
"no-lone-blocks": 2,
54+
// "no-loop-func": 2,
55+
"no-multi-spaces": 2,
56+
"no-multi-str": 2,
57+
"no-native-reassign": 2,
58+
"no-new": 2,
59+
"no-new-func": 2,
60+
"no-new-wrappers": 2,
61+
"no-octal": 2,
62+
"no-octal-escape": 2,
63+
"no-proto": 2,
64+
"no-return-assign": [ 1, "except-parens" ],
65+
"no-script-url": 2,
66+
"no-self-compare": 2,
67+
"no-sequences": 2,
68+
"no-throw-literal": 2,
69+
"no-useless-concat": 2,
70+
"no-warning-comments": [ 1, { "location": "anywhere" }],
71+
"no-with": 2,
72+
"wrap-iife": [ 2, "inside" ],
73+
74+
75+
/**
76+
* Stylistic Issues
77+
*/
78+
"block-spacing": 2,
79+
"brace-style": [ 2, "1tbs", { "allowSingleLine": true }],
80+
"camelcase": [ 2, { "properties": "never" }],
81+
"comma-spacing": [ 2, { "before": false, "after": true }],
82+
"comma-style": [
83+
2,
84+
"first",
85+
{
86+
"exceptions": {
87+
"ArrayExpression": true,
88+
"ObjectExpression": true
89+
}
90+
}
91+
],
92+
"computed-property-spacing": [ 2, "never" ],
93+
"eol-last": 2,
94+
"indent": [2, 2, { "SwitchCase": 1 }],
95+
"key-spacing": 2,
96+
"keyword-spacing": [
97+
2
98+
],
99+
"lines-around-comment": [ 2, {
100+
"beforeBlockComment": true,
101+
"beforeLineComment": false,
102+
"allowBlockStart": true,
103+
"allowBlockEnd": true
104+
}],
105+
"linebreak-style": [ 2, "unix" ],
106+
"new-cap": 2,
107+
"new-parens": 2,
108+
"no-array-constructor": 2,
109+
"no-lonely-if": 2,
110+
"no-mixed-spaces-and-tabs": 2,
111+
"no-multiple-empty-lines": [ 2, { "max": 3 }],
112+
"no-nested-ternary": 2,
113+
"no-new-object": 2,
114+
"no-spaced-func": 2,
115+
"no-trailing-spaces": 2,
116+
"no-unneeded-ternary": 2,
117+
"operator-linebreak": [ 2, "before" ],
118+
"quotes": [ 2, "single" ],
119+
"semi": [ 2, "always" ],
120+
"semi-spacing": 2,
121+
"space-infix-ops": 2,
122+
"space-unary-ops": 2,
123+
124+
125+
/**
126+
* Variables
127+
*/
128+
"no-catch-shadow": 2,
129+
"no-delete-var": 2,
130+
"no-shadow-restricted-names": 2,
131+
"no-undef-init": 2,
132+
"no-undef": 2,
133+
"no-unused-vars": 2,
134+
"no-use-before-define": [ 2, "nofunc" ],
135+
136+
137+
/**
138+
* Node / CommonJS
139+
*/
140+
"handle-callback-err": 2,
141+
"no-mixed-requires": [ 1, true ],
142+
"no-path-concat": 2,
143+
"no-process-exit": 2
144+
}
145+
}

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ It's still pretty early on, as it doesn't support a whole lot of use-cases, but
1717

1818
### Dependency
1919
Notice: this plugin requires:
20-
- the [Angular Recursion](https://github.com/marklagendijk/angular-recursion) module.
21-
- the [Angular directives for Bootstrap](https://github.com/angular-ui/bootstrap) module to display the Calendar (ui.bootstrap.datepicker)
20+
- the [Angular Recursion](https://github.com/marklagendijk/angular-recursion) module.
21+
- the [Angular directives for Bootstrap](https://github.com/angular-ui/bootstrap) module to display the Calendar (ui.bootstrap.datepicker)
2222

2323
### Installation
2424
First you'll need to download the [dist](https://github.com/dncrews/angular-elastic-builder/tree/master/dist) files and include this JS file to your app (don't forget to substitute `x.x.x` with the current version number), along with the RecursionHelper, if you're not already using it.
@@ -66,7 +66,7 @@ $scope.elasticBuilderData.fields = {
6666

6767
The above elasticFields would allow you create the following form:
6868
![Screenshot][screenshot-image]
69-
69+
7070
Which represents the following Elasticsearch Query:
7171
```json
7272
[
@@ -159,5 +159,5 @@ To work on this module locally, you will need to clone it and run `gulp watch`.
159159
[downloads-url]: https://www.npmjs.org/package/angular-elastic-builder
160160
[gratipay-image]: https://img.shields.io/gratipay/dncrews.svg
161161
[gratipay-url]: https://www.gratipay.com/dncrews/
162-
[screenshot-image]: https://cloud.githubusercontent.com/assets/6723310/14424743/c5701566-ffda-11e5-8204-9f4d46c5aec4.png
162+
[screenshot-image]: ./screenshot.png
163163

0 commit comments

Comments
 (0)