Skip to content

Commit cbca183

Browse files
committed
add tests
1 parent 8c0e208 commit cbca183

File tree

5 files changed

+393
-181
lines changed

5 files changed

+393
-181
lines changed

.eslintrc.js

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
module.exports = {
2+
"env": {
3+
"node": true
4+
},
5+
"extends": "eslint:recommended",
6+
"rules": {
7+
"accessor-pairs": "error",
8+
"array-bracket-spacing": "error",
9+
"array-callback-return": "error",
10+
"arrow-body-style": "error",
11+
"arrow-parens": "error",
12+
"arrow-spacing": "error",
13+
"block-scoped-var": "error",
14+
"block-spacing": "error",
15+
"brace-style": [
16+
"error",
17+
"1tbs"
18+
],
19+
"callback-return": "off",
20+
"camelcase": "off",
21+
"capitalized-comments": [
22+
"error",
23+
"never"
24+
],
25+
"class-methods-use-this": "error",
26+
"comma-dangle": "error",
27+
"comma-spacing": [
28+
"error",
29+
{
30+
"after": true,
31+
"before": false
32+
}
33+
],
34+
"comma-style": [
35+
"error",
36+
"last"
37+
],
38+
"complexity": "error",
39+
"computed-property-spacing": [
40+
"error",
41+
"never"
42+
],
43+
"consistent-return": "error",
44+
"consistent-this": "off",
45+
"curly": "error",
46+
"default-case": "error",
47+
"dot-location": "error",
48+
"dot-notation": "error",
49+
"eol-last": "error",
50+
"eqeqeq": "off",
51+
"func-call-spacing": "error",
52+
"func-name-matching": "error",
53+
"func-names": [
54+
"error",
55+
"never"
56+
],
57+
"func-style": [
58+
"error",
59+
"declaration"
60+
],
61+
"generator-star-spacing": "error",
62+
"global-require": "off",
63+
"guard-for-in": "error",
64+
"handle-callback-err": "error",
65+
"id-blacklist": "error",
66+
"id-length": "off",
67+
"id-match": "error",
68+
"indent": "off",
69+
"init-declarations": "error",
70+
"jsx-quotes": "error",
71+
"key-spacing": "error",
72+
"keyword-spacing": [
73+
"error",
74+
{
75+
"after": true,
76+
"before": true
77+
}
78+
],
79+
"line-comment-position": "error",
80+
"linebreak-style": [
81+
"error",
82+
"unix"
83+
],
84+
"lines-around-comment": "error",
85+
"lines-around-directive": "error",
86+
"max-depth": "error",
87+
"max-len": "off",
88+
"max-lines": "error",
89+
"max-nested-callbacks": "error",
90+
"max-params": "error",
91+
"max-statements": "off",
92+
"max-statements-per-line": "error",
93+
"multiline-ternary": [
94+
"error",
95+
"never"
96+
],
97+
"new-cap": "error",
98+
"new-parens": "error",
99+
"newline-after-var": "off",
100+
"newline-before-return": "error",
101+
"newline-per-chained-call": "off",
102+
"no-alert": "error",
103+
"no-array-constructor": "error",
104+
"no-await-in-loop": "error",
105+
"no-bitwise": "error",
106+
"no-caller": "error",
107+
"no-catch-shadow": "error",
108+
"no-confusing-arrow": "error",
109+
"no-continue": "error",
110+
"no-div-regex": "error",
111+
"no-duplicate-imports": "error",
112+
"no-else-return": "error",
113+
"no-empty": [
114+
"error",
115+
{
116+
"allowEmptyCatch": true
117+
}
118+
],
119+
"no-empty-function": "error",
120+
"no-eq-null": "error",
121+
"no-eval": "error",
122+
"no-extend-native": "error",
123+
"no-extra-bind": "error",
124+
"no-extra-label": "error",
125+
"no-extra-parens": "off",
126+
"no-floating-decimal": "error",
127+
"no-implicit-globals": "error",
128+
"no-implied-eval": "error",
129+
"no-inline-comments": "error",
130+
"no-inner-declarations": [
131+
"error",
132+
"functions"
133+
],
134+
"no-invalid-this": "error",
135+
"no-iterator": "error",
136+
"no-label-var": "error",
137+
"no-labels": "error",
138+
"no-lone-blocks": "error",
139+
"no-lonely-if": "error",
140+
"no-loop-func": "error",
141+
"no-magic-numbers": "off",
142+
"no-mixed-operators": "error",
143+
"no-mixed-requires": "error",
144+
"no-multi-assign": "error",
145+
"no-multi-spaces": "error",
146+
"no-multi-str": "error",
147+
"no-multiple-empty-lines": "error",
148+
"no-native-reassign": "error",
149+
"no-negated-condition": "error",
150+
"no-negated-in-lhs": "error",
151+
"no-nested-ternary": "error",
152+
"no-new": "error",
153+
"no-new-func": "error",
154+
"no-new-object": "error",
155+
"no-new-require": "error",
156+
"no-new-wrappers": "error",
157+
"no-octal-escape": "error",
158+
"no-param-reassign": "off",
159+
"no-path-concat": "error",
160+
"no-plusplus": "error",
161+
"no-process-env": "off",
162+
"no-process-exit": "error",
163+
"no-proto": "error",
164+
"no-prototype-builtins": "error",
165+
"no-restricted-globals": "error",
166+
"no-restricted-imports": "error",
167+
"no-restricted-modules": "error",
168+
"no-restricted-properties": "error",
169+
"no-restricted-syntax": "error",
170+
"no-return-assign": "error",
171+
"no-return-await": "error",
172+
"no-script-url": "error",
173+
"no-self-compare": "error",
174+
"no-sequences": "error",
175+
"no-shadow": "error",
176+
"no-shadow-restricted-names": "error",
177+
"no-spaced-func": "error",
178+
"no-sync": "off",
179+
"no-tabs": "error",
180+
"no-template-curly-in-string": "error",
181+
"no-ternary": "off",
182+
"no-throw-literal": "error",
183+
"no-trailing-spaces": "error",
184+
"no-undef-init": "error",
185+
"no-undefined": "error",
186+
"no-underscore-dangle": "error",
187+
"no-unmodified-loop-condition": "error",
188+
"no-unneeded-ternary": "error",
189+
"no-unused-expressions": "error",
190+
"no-use-before-define": "off",
191+
"no-useless-call": "error",
192+
"no-useless-computed-key": "error",
193+
"no-useless-concat": "error",
194+
"no-useless-constructor": "error",
195+
"no-useless-escape": "error",
196+
"no-useless-rename": "error",
197+
"no-useless-return": "error",
198+
"no-var": "off",
199+
"no-void": "error",
200+
"no-warning-comments": "error",
201+
"no-whitespace-before-property": "error",
202+
"no-with": "error",
203+
"object-curly-newline": "error",
204+
"object-curly-spacing": [
205+
"error",
206+
"always"
207+
],
208+
"object-property-newline": [
209+
"error",
210+
{
211+
"allowMultiplePropertiesPerLine": true
212+
}
213+
],
214+
"object-shorthand": "off",
215+
"one-var": "off",
216+
"one-var-declaration-per-line": "error",
217+
"operator-assignment": [
218+
"error",
219+
"always"
220+
],
221+
"operator-linebreak": "error",
222+
"padded-blocks": "off",
223+
"prefer-arrow-callback": "off",
224+
"prefer-const": "error",
225+
"prefer-destructuring": [
226+
"error",
227+
{
228+
"array": false,
229+
"object": false
230+
}
231+
],
232+
"prefer-numeric-literals": "error",
233+
"prefer-promise-reject-errors": "error",
234+
"prefer-reflect": "error",
235+
"prefer-rest-params": "error",
236+
"prefer-spread": "error",
237+
"prefer-template": "off",
238+
"quote-props": "off",
239+
"quotes": [
240+
"error",
241+
"single"
242+
],
243+
"radix": "error",
244+
"require-await": "error",
245+
"require-jsdoc": "off",
246+
"rest-spread-spacing": "error",
247+
"semi": "error",
248+
"semi-spacing": "error",
249+
"sort-imports": "error",
250+
"sort-keys": "off",
251+
"sort-vars": "error",
252+
"space-before-blocks": "error",
253+
"space-before-function-paren": "off",
254+
"space-in-parens": [
255+
"error",
256+
"never"
257+
],
258+
"space-infix-ops": "error",
259+
"space-unary-ops": "off",
260+
"spaced-comment": [
261+
"error",
262+
"always"
263+
],
264+
"strict": "error",
265+
"symbol-description": "error",
266+
"template-curly-spacing": "error",
267+
"template-tag-spacing": "error",
268+
"unicode-bom": [
269+
"error",
270+
"never"
271+
],
272+
"valid-jsdoc": "error",
273+
"vars-on-top": "off",
274+
"wrap-iife": "error",
275+
"wrap-regex": "error",
276+
"yield-star-spacing": "error",
277+
"yoda": [
278+
"error",
279+
"never"
280+
]
281+
}
282+
};

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
SHELL = /bin/bash
2+
export PATH := ./node_modules/.bin/:${PATH}
3+
4+
MAKEFLAGS += --no-print-directory --silent
5+
6+
clean:
7+
rm -rf build/ \
8+
npm-debug.log
9+
lint:
10+
eslint lib/
11+
test: clean lint
12+
mocha --reporter spec test/ $(MOCHAFLAGS)

0 commit comments

Comments
 (0)