Skip to content

Commit 6a4837b

Browse files
author
Nicolas RAIBAUD
committed
Initial commit
0 parents  commit 6a4837b

File tree

9 files changed

+843
-0
lines changed

9 files changed

+843
-0
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
end_of_line = lf
10+
# editorconfig-tools is unable to ignore longs strings or urls
11+
max_line_length = null

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/coverage
2+
/node_modules

.eslintrc

Lines changed: 340 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,340 @@
1+
/* Based on https://github.com/FreeCodeCamp/freecodecamp/blob/staging/.eslintrc */
2+
{
3+
"env": {
4+
// http://eslint.org/docs/user-guide/configuring.html#specifying-environments
5+
"browser": true,
6+
// browser global variables
7+
"node": true
8+
// Node.js global variables and Node.js-specific rules
9+
},
10+
"rules": {
11+
/**
12+
* Strict mode
13+
*/
14+
"strict": 2,
15+
// http://eslint.org/docs/rules/strict
16+
17+
/**
18+
* Variables
19+
*/
20+
"no-shadow": 2,
21+
// http://eslint.org/docs/rules/no-shadow
22+
"no-shadow-restricted-names": 2,
23+
// http://eslint.org/docs/rules/no-shadow-restricted-names
24+
"no-unused-vars": [
25+
2,
26+
{
27+
// http://eslint.org/docs/rules/no-unused-vars
28+
"vars": "local",
29+
"args": "after-used"
30+
}
31+
],
32+
/**
33+
* Possible errors
34+
*/
35+
"comma-dangle": [
36+
2,
37+
"never"
38+
],
39+
// http://eslint.org/docs/rules/comma-dangle
40+
"no-cond-assign": [
41+
2,
42+
"always"
43+
],
44+
// http://eslint.org/docs/rules/no-cond-assign
45+
"no-console": 1,
46+
// http://eslint.org/docs/rules/no-console
47+
"no-debugger": 1,
48+
// http://eslint.org/docs/rules/no-debugger
49+
"no-alert": 1,
50+
// http://eslint.org/docs/rules/no-alert
51+
"no-constant-condition": 1,
52+
// http://eslint.org/docs/rules/no-constant-condition
53+
"no-dupe-keys": 2,
54+
// http://eslint.org/docs/rules/no-dupe-keys
55+
"no-duplicate-case": 2,
56+
// http://eslint.org/docs/rules/no-duplicate-case
57+
"no-empty": 2,
58+
// http://eslint.org/docs/rules/no-empty
59+
"no-empty-character-class": 2,
60+
// http://eslint.org/docs/rules/no-empty-character-class
61+
"no-ex-assign": 2,
62+
// http://eslint.org/docs/rules/no-ex-assign
63+
"no-extra-semi": 2,
64+
// http://eslint.org/docs/rules/no-extra-semi
65+
"no-func-assign": 2,
66+
// http://eslint.org/docs/rules/no-func-assign
67+
"no-inner-declarations": 2,
68+
// http://eslint.org/docs/rules/no-inner-declarations
69+
"no-invalid-regexp": 2,
70+
// http://eslint.org/docs/rules/no-invalid-regexp
71+
"no-irregular-whitespace": 2,
72+
// http://eslint.org/docs/rules/no-irregular-whitespace
73+
"no-negated-in-lhs": 2,
74+
// http://eslint.org/docs/rules/no-negated-in-lhs
75+
"no-new-require": 2,
76+
// http://eslint.org/docs/rules/no-new-require
77+
"no-obj-calls": 2,
78+
// http://eslint.org/docs/rules/no-obj-calls
79+
"no-path-concat": 2,
80+
// http://eslint.org/docs/rules/no-path-concat
81+
"no-regex-spaces": 2,
82+
// http://eslint.org/docs/rules/no-regex-spaces
83+
"no-sparse-arrays": 2,
84+
// http://eslint.org/docs/rules/no-sparse-arrays
85+
"no-unreachable": 2,
86+
// http://eslint.org/docs/rules/no-unreachable
87+
"use-isnan": 2,
88+
// http://eslint.org/docs/rules/use-isnan
89+
"valid-jsdoc": 2,
90+
// http://eslint.org/docs/rules/valid-jsdoc
91+
"valid-typeof": 2,
92+
// http://eslint.org/docs/rules/valid-typeof
93+
94+
/**
95+
* Best practices
96+
*/
97+
"consistent-return": 2,
98+
// http://eslint.org/docs/rules/consistent-return
99+
"curly": [
100+
2,
101+
"multi-line"
102+
],
103+
// http://eslint.org/docs/rules/curly
104+
"default-case": 2,
105+
// http://eslint.org/docs/rules/default-case
106+
"dot-notation": [
107+
2,
108+
{
109+
// http://eslint.org/docs/rules/dot-notation
110+
"allowKeywords": true
111+
}
112+
],
113+
"eqeqeq": 2,
114+
// http://eslint.org/docs/rules/eqeqeq
115+
"guard-for-in": 2,
116+
// http://eslint.org/docs/rules/guard-for-in
117+
"no-caller": 2,
118+
// http://eslint.org/docs/rules/no-caller
119+
"no-div-regex": 2,
120+
// http://eslint.org/docs/rules/no-div-regex
121+
"no-else-return": 2,
122+
// http://eslint.org/docs/rules/no-else-return
123+
"no-labels": 2,
124+
// http://eslint.org/docs/rules/no-labels
125+
"no-eq-null": 2,
126+
// http://eslint.org/docs/rules/no-eq-null
127+
"no-eval": 2,
128+
// http://eslint.org/docs/rules/no-eval
129+
"no-extend-native": 2,
130+
// http://eslint.org/docs/rules/no-extend-native
131+
"no-extra-bind": 2,
132+
// http://eslint.org/docs/rules/no-extra-bind
133+
"no-fallthrough": 2,
134+
// http://eslint.org/docs/rules/no-fallthrough
135+
"no-floating-decimal": 2,
136+
// http://eslint.org/docs/rules/no-floating-decimal
137+
"no-implied-eval": 2,
138+
// http://eslint.org/docs/rules/no-implied-eval
139+
"no-lone-blocks": 2,
140+
// http://eslint.org/docs/rules/no-lone-blocks
141+
"no-loop-func": 2,
142+
// http://eslint.org/docs/rules/no-loop-func
143+
"no-multi-str": 2,
144+
// http://eslint.org/docs/rules/no-multi-str
145+
"no-native-reassign": 2,
146+
// http://eslint.org/docs/rules/no-native-reassign
147+
"no-new": 2,
148+
// http://eslint.org/docs/rules/no-new
149+
"no-new-func": 2,
150+
// http://eslint.org/docs/rules/no-new-func
151+
"no-new-wrappers": 2,
152+
// http://eslint.org/docs/rules/no-new-wrappers
153+
"no-octal": 2,
154+
// http://eslint.org/docs/rules/no-octal
155+
"no-octal-escape": 2,
156+
// http://eslint.org/docs/rules/no-octal-escape
157+
"no-param-reassign": 1,
158+
// http://eslint.org/docs/rules/no-param-reassign
159+
"no-process-exit": 2,
160+
// http://eslint.org/docs/rules/no-process-exit
161+
"no-proto": 2,
162+
// http://eslint.org/docs/rules/no-proto
163+
"no-redeclare": 2,
164+
// http://eslint.org/docs/rules/no-redeclare
165+
"no-return-assign": 2,
166+
// http://eslint.org/docs/rules/no-return-assign
167+
"no-script-url": 2,
168+
// http://eslint.org/docs/rules/no-script-url
169+
"no-self-compare": 2,
170+
// http://eslint.org/docs/rules/no-self-compare
171+
"no-sequences": 2,
172+
// http://eslint.org/docs/rules/no-sequences
173+
"no-throw-literal": 2,
174+
// http://eslint.org/docs/rules/no-throw-literal
175+
"no-undef": 2,
176+
// http://eslint.org/docs/rules/no-undef
177+
"no-undef-init": 2,
178+
// http://eslint.org/docs/rules/no-undef-init
179+
"no-undefined": 1,
180+
// http://eslint.org/docs/rules/no-undefined
181+
"no-with": 2,
182+
// http://eslint.org/docs/rules/no-with
183+
"handle-callback-err": 1,
184+
// http://eslint.org/docs/rules/handle-callback-err
185+
"radix": 2,
186+
// http://eslint.org/docs/rules/radix
187+
"wrap-iife": [
188+
2,
189+
"any"
190+
],
191+
// http://eslint.org/docs/rules/wrap-iife
192+
"yoda": 2,
193+
// http://eslint.org/docs/rules/yoda
194+
195+
/**
196+
* Style
197+
*/
198+
"indent": [
199+
2,
200+
2
201+
],
202+
// http://eslint.org/docs/rules/indent
203+
"brace-style": [
204+
2,
205+
// http://eslint.org/docs/rules/brace-style
206+
"1tbs",
207+
{
208+
"allowSingleLine": true
209+
}
210+
],
211+
"quotes": [
212+
// http://eslint.org/docs/rules/quotes
213+
2,
214+
"single",
215+
"avoid-escape"
216+
],
217+
"camelcase": [
218+
2,
219+
{
220+
// http://eslint.org/docs/rules/camelcase
221+
"properties": "never"
222+
}
223+
],
224+
"comma-spacing": [
225+
2,
226+
{
227+
// http://eslint.org/docs/rules/comma-spacing
228+
"before": false,
229+
"after": true
230+
}
231+
],
232+
"comma-style": [
233+
2,
234+
"last"
235+
],
236+
// http://eslint.org/docs/rules/comma-style
237+
"eol-last": 2,
238+
// http://eslint.org/docs/rules/eol-last
239+
"func-names": 0,
240+
// http://eslint.org/docs/rules/func-names
241+
"key-spacing": [
242+
2,
243+
{
244+
// http://eslint.org/docs/rules/key-spacing
245+
"beforeColon": false,
246+
"afterColon": true
247+
}
248+
],
249+
"new-cap": [
250+
2,
251+
{
252+
// http://eslint.org/docs/rules/new-cap
253+
"newIsCap": true
254+
}
255+
],
256+
"new-parens": 2,
257+
// http://eslint.org/docs/rules/new-parens
258+
"no-array-constructor": 2,
259+
// http://eslint.org/docs/rules/no-array-constructor
260+
"no-lonely-if": 1,
261+
// http://eslint.org/docs/rules/no-lonely-if
262+
"no-mixed-spaces-and-tabs": 1,
263+
// http://eslint.org/docs/rules/no-mixed-spaces-and-tabs
264+
"no-multiple-empty-lines": [
265+
2,
266+
{
267+
// http://eslint.org/docs/rules/no-multiple-empty-lines
268+
"max": 2
269+
}
270+
],
271+
"no-nested-ternary": 2,
272+
// http://eslint.org/docs/rules/no-nested-ternary
273+
"no-new-object": 2,
274+
// http://eslint.org/docs/rules/no-new-object
275+
"no-spaced-func": 2,
276+
// http://eslint.org/docs/rules/no-spaced-func
277+
"no-trailing-spaces": 2,
278+
// http://eslint.org/docs/rules/no-trailing-spaces
279+
"no-extra-parens": [
280+
2,
281+
"functions"
282+
],
283+
// http://eslint.org/docs/rules/no-extra-params
284+
"one-var": [
285+
2,
286+
"never"
287+
],
288+
// http://eslint.org/docs/rules/one-var
289+
"padded-blocks": [
290+
2,
291+
"never"
292+
],
293+
// http://eslint.org/docs/rules/padded-blocks
294+
"semi": [
295+
2,
296+
"always"
297+
],
298+
// http://eslint.org/docs/rules/semi
299+
"semi-spacing": [
300+
2,
301+
{
302+
// http://eslint.org/docs/rules/semi-spacing
303+
"before": false,
304+
"after": true
305+
}
306+
],
307+
"keyword-spacing": 2,
308+
// http://eslint.org/docs/rules/keyword-spacing
309+
"space-before-blocks": 2,
310+
// http://eslint.org/docs/rules/space-before-blocks
311+
"space-before-function-paren": [
312+
2,
313+
{
314+
"anonymous": "always",
315+
"named": "never"
316+
}
317+
],
318+
// http://eslint.org/docs/rules/space-before-function-paren
319+
"space-infix-ops": 2,
320+
// http://eslint.org/docs/rules/space-infix-ops
321+
"space-unary-ops": 2,
322+
// http://eslint.org/docs/rules/space-unary-ops
323+
"spaced-comment": [
324+
2,
325+
"always",
326+
{
327+
// http://eslint.org/docs/rules/spaced-comment
328+
"exceptions": [
329+
"-",
330+
"+"
331+
],
332+
"markers": [
333+
"=",
334+
"!"
335+
]
336+
// space here to support sprockets directives
337+
}
338+
]
339+
}
340+
}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage
2+
/node_modules
3+
npm-debug.log
4+
.DS_Store
5+
.eslintcache
6+
.idea

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Nicolas RAIBAUD
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)