Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 9096dc9

Browse files
committed
Use airbnb style guide and provide jsnext (es) build
1 parent acedc32 commit 9096dc9

File tree

6 files changed

+653
-475
lines changed

6 files changed

+653
-475
lines changed

.eslintrc.json

Lines changed: 32 additions & 298 deletions
Original file line numberDiff line numberDiff line change
@@ -6,304 +6,38 @@
66
"globals": {
77
"Promise": true
88
},
9-
"parserOptions": {
10-
"ecmaVersion": 6,
11-
"sourceType": "module"
12-
},
13-
"ecmaFeatures": {
14-
"arrowFunctions": true,
15-
"destructuring": true,
16-
"classes": true,
17-
"defaultParams": true,
18-
"blockBindings": true,
19-
"modules": true,
20-
"objectLiteralComputedProperties": true,
21-
"objectLiteralShorthandMethods": true,
22-
"objectLiteralShorthandProperties": true,
23-
"restParams": true,
24-
"spread": true,
25-
"forOf": true,
26-
"generators": true,
27-
"templateStrings": true,
28-
"superInFunctions": true,
29-
"experimentalObjectRestSpread": true
30-
},
9+
"extends": "airbnb",
10+
"plugins": [ "html" ],
11+
"parser": "babel-eslint",
3112
"rules": {
32-
"accessor-pairs": 2,
33-
"array-bracket-spacing": 0,
34-
"block-scoped-var": 0,
35-
"brace-style": [
36-
2,
37-
"1tbs",
38-
{
39-
"allowSingleLine": true
40-
}
41-
],
42-
"camelcase": 0,
43-
"comma-dangle": [
44-
2,
45-
"never"
46-
],
47-
"comma-spacing": [
48-
2,
49-
{
50-
"before": false,
51-
"after": true
52-
}
53-
],
54-
"comma-style": [
55-
2,
56-
"last"
57-
],
58-
"complexity": 0,
59-
"computed-property-spacing": 0,
60-
"consistent-return": 0,
61-
"consistent-this": 0,
62-
"constructor-super": 2,
63-
"curly": [
64-
2,
65-
"multi-line"
66-
],
67-
"default-case": 0,
68-
"dot-location": [
69-
2,
70-
"property"
71-
],
72-
"dot-notation": 0,
73-
"eol-last": 2,
74-
"eqeqeq": [
75-
2,
76-
"allow-null"
77-
],
78-
"func-names": 0,
79-
"func-style": 0,
80-
"generator-star-spacing": [
81-
2,
82-
{
83-
"before": true,
84-
"after": true
85-
}
86-
],
87-
"guard-for-in": 0,
88-
"handle-callback-err": [
89-
2,
90-
"^(err|error)$"
91-
],
92-
"indent": [
93-
2,
94-
2,
95-
{
96-
"SwitchCase": 1
97-
}
98-
],
99-
"key-spacing": [
100-
2,
101-
{
102-
"beforeColon": false,
103-
"afterColon": true
104-
}
105-
],
106-
"linebreak-style": 0,
107-
"lines-around-comment": 0,
108-
"max-nested-callbacks": 0,
109-
"new-cap": [
110-
2,
111-
{
112-
"newIsCap": true,
113-
"capIsNew": false
114-
}
115-
],
116-
"new-parens": 2,
117-
"newline-after-var": 0,
118-
"no-alert": 0,
119-
"no-array-constructor": 2,
120-
"no-caller": 2,
121-
"no-catch-shadow": 0,
122-
"no-cond-assign": 2,
123-
"no-console": 0,
124-
"no-constant-condition": 0,
125-
"no-continue": 0,
126-
"no-control-regex": 2,
127-
"no-debugger": 2,
128-
"no-delete-var": 2,
129-
"no-div-regex": 0,
130-
"no-dupe-args": 2,
131-
"no-dupe-keys": 2,
132-
"no-duplicate-case": 2,
133-
"no-else-return": 0,
134-
"no-empty": 0,
135-
"no-empty-character-class": 2,
136-
"no-eq-null": 0,
137-
"no-eval": 2,
138-
"no-ex-assign": 2,
139-
"no-extend-native": 2,
140-
"no-extra-bind": 2,
141-
"no-extra-boolean-cast": 2,
142-
"no-extra-parens": 0,
143-
"no-extra-semi": 0,
144-
"no-fallthrough": 2,
145-
"no-floating-decimal": 2,
146-
"no-func-assign": 2,
147-
"no-implied-eval": 2,
148-
"no-inline-comments": 0,
149-
"no-inner-declarations": [
150-
2,
151-
"functions"
152-
],
153-
"no-invalid-regexp": 2,
154-
"no-irregular-whitespace": 2,
155-
"no-iterator": 2,
156-
"no-label-var": 2,
157-
"no-labels": 2,
158-
"no-lone-blocks": 2,
159-
"no-lonely-if": 0,
160-
"no-loop-func": 0,
161-
"no-mixed-requires": 0,
162-
"no-mixed-spaces-and-tabs": 2,
163-
"no-multi-spaces": 2,
164-
"no-multi-str": 2,
165-
"no-multiple-empty-lines": [
166-
2,
167-
{
168-
"max": 1
169-
}
170-
],
171-
"no-native-reassign": 2,
172-
"no-negated-in-lhs": 2,
173-
"no-nested-ternary": 0,
174-
"no-new": 2,
175-
"no-new-func": 0,
176-
"no-new-object": 2,
177-
"no-new-require": 2,
178-
"no-new-wrappers": 2,
179-
"no-obj-calls": 2,
180-
"no-octal": 2,
181-
"no-octal-escape": 2,
182-
"no-param-reassign": 0,
183-
"no-path-concat": 0,
184-
"no-process-env": 0,
185-
"no-process-exit": 0,
186-
"no-proto": 0,
187-
"no-redeclare": 2,
188-
"no-regex-spaces": 2,
189-
"no-restricted-modules": 0,
190-
"no-return-assign": 2,
191-
"no-script-url": 0,
192-
"no-self-compare": 2,
193-
"no-sequences": 2,
194-
"no-shadow": 0,
195-
"no-shadow-restricted-names": 2,
196-
"no-spaced-func": 2,
197-
"no-sparse-arrays": 2,
198-
"no-sync": 0,
199-
"no-ternary": 0,
200-
"no-this-before-super": 2,
201-
"no-throw-literal": 2,
202-
"no-trailing-spaces": 2,
203-
"no-undef": 2,
204-
"no-undef-init": 2,
205-
"no-undefined": 0,
206-
"no-underscore-dangle": 0,
207-
"no-unexpected-multiline": 2,
208-
"no-unneeded-ternary": 2,
209-
"no-unreachable": 2,
210-
"no-unused-expressions": 0,
211-
"no-unused-vars": [
212-
2,
213-
{
214-
"vars": "all",
215-
"args": "none"
216-
}
217-
],
218-
"no-use-before-define": 0,
219-
"no-var": 0,
220-
"no-void": 0,
221-
"no-warning-comments": 0,
222-
"no-with": 2,
223-
"object-curly-spacing": 0,
224-
"object-shorthand": 0,
225-
"one-var": [
226-
2,
227-
{
228-
"initialized": "never"
229-
}
230-
],
231-
"operator-assignment": 0,
232-
"operator-linebreak": [
233-
2,
234-
"after",
235-
{
236-
"overrides": {
237-
"?": "before",
238-
":": "before"
239-
}
240-
}
241-
],
242-
"padded-blocks": 0,
243-
"prefer-const": 0,
244-
"quote-props": 0,
245-
"quotes": [
246-
2,
247-
"single",
248-
"avoid-escape"
249-
],
250-
"radix": 2,
251-
"semi": [
252-
2,
253-
"never"
254-
],
255-
"semi-spacing": 0,
256-
"sort-vars": 0,
257-
"keyword-spacing": [
258-
2
259-
],
260-
"space-before-blocks": [
261-
2,
262-
"always"
263-
],
264-
"space-before-function-paren": [
265-
2,
266-
"always"
267-
],
268-
"space-in-parens": [
269-
2,
270-
"never"
271-
],
272-
"space-infix-ops": 2,
273-
"space-unary-ops": [
274-
2,
275-
{
276-
"words": true,
277-
"nonwords": false
278-
}
279-
],
280-
"spaced-comment": [
281-
2,
282-
"always",
283-
{
284-
"markers": [
285-
"global",
286-
"globals",
287-
"eslint",
288-
"eslint-disable",
289-
"*package",
290-
"!"
291-
]
292-
}
293-
],
294-
"strict": 0,
295-
"use-isnan": 2,
296-
"valid-jsdoc": 0,
297-
"valid-typeof": 2,
298-
"vars-on-top": 0,
299-
"wrap-iife": [
300-
2,
301-
"any"
302-
],
303-
"wrap-regex": 0,
304-
"yoda": [
305-
2,
306-
"never"
307-
]
13+
// indentation
14+
"indent": [ 2, 4 ],
15+
16+
// spacing
17+
"space-in-parens": [ 2, "always" ],
18+
"template-curly-spacing": [ 2, "always" ],
19+
"array-bracket-spacing": [ 2, "always" ],
20+
"object-curly-spacing": [ 2, "always" ],
21+
"computed-property-spacing": [ 2, "always" ],
22+
"no-multiple-empty-lines": [ 2, { "max": 1, "maxEOF": 0, "maxBOF": 0 } ],
23+
24+
// strings
25+
"quotes": [ 2, "single", "avoid-escape" ],
26+
27+
// code arrangement matter
28+
"no-use-before-define": [ 2, { "functions": false } ],
29+
30+
// make it meaningful
31+
"prefer-const": 1,
32+
33+
// keep it simple
34+
"complexity": [ 1, 5 ],
35+
36+
//
37+
"react/require-extension": "off"
38+
},
39+
"settings": {
40+
"html/indent": "0",
41+
"html/report-bad-indent": 2
30842
}
30943
}

config/banner.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use strict";
22

3-
let pack = require('../package.json')
3+
let pack = require('../package.json');
44

5-
const VERSION = process.env.VERSION || pack.version
5+
const VERSION = process.env.VERSION || pack.version;
66
const YEAR = new Date().getFullYear();
77

88
const BANNER = `/*!
@@ -11,5 +11,4 @@ const BANNER = `/*!
1111
* Release under the ${pack.license} License.
1212
*/`;
1313

14-
15-
module.exports = BANNER;
14+
module.exports = BANNER;

0 commit comments

Comments
 (0)