Skip to content

Commit 3621944

Browse files
silverwindzeripath
authored andcommitted
modernize js and use babel (#8973)
* modernize js and use babel - add babel toolchain to transform modern JS to ES5 - extend eslint config for modern rules - fixes linting issues via `eslint --fix` and manual fixes * run 'make css' to satisfy CI * code style tweaks and set js indendation to 2 in .editorconfig * regenerate js
1 parent 4b5ebb9 commit 3621944

File tree

10 files changed

+5307
-3821
lines changed

10 files changed

+5307
-3821
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ indent_size = 2
2424

2525
[*.js]
2626
indent_style = space
27-
indent_size = 4
27+
indent_size = 2
2828

2929
[Makefile]
3030
indent_style = tab

.eslintrc

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,51 @@
11
root: true
22

33
extends:
4+
- eslint-config-airbnb-base
45
- eslint:recommended
56

67
parserOptions:
7-
ecmaVersion: 2015
8+
ecmaVersion: 2020
89

910
env:
1011
browser: true
11-
jquery: true
1212
es6: true
13+
jquery: true
1314
node: true
1415

1516
globals:
1617
Clipboard: false
1718
CodeMirror: false
19+
Dropzone: false
1820
emojify: false
21+
hljs: false
1922
SimpleMDE: false
20-
Vue: false
21-
Dropzone: false
2223
u2fApi: false
23-
hljs: false
24+
Vue: false
2425

2526
rules:
26-
no-unused-vars: [error, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, ignoreRestSiblings: true}]
27-
prefer-const: [2, {destructuring: all}]
27+
camelcase: [0]
28+
comma-dangle: [2, only-multiline]
29+
consistent-return: [0]
30+
default-case: [0]
31+
func-names: [0]
32+
max-len: [0]
33+
newline-per-chained-call: [0]
34+
arrow-body-style: [0]
35+
no-alert: [0]
36+
no-continue: [0]
37+
no-mixed-operators: [0]
38+
no-multi-assign: [0]
39+
no-new: [0]
40+
no-param-reassign: [0]
41+
no-plusplus: [0]
42+
no-restricted-syntax: [0]
43+
no-shadow: [0]
44+
no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, ignoreRestSiblings: true}]
45+
no-use-before-define: [0]
2846
no-var: [2]
47+
one-var-declaration-per-line: [0]
48+
one-var: [0]
49+
prefer-const: [2, {destructuring: all}]
50+
prefer-destructuring: [0]
51+
radix: [2, as-needed]

0 commit comments

Comments
 (0)