Skip to content

Commit d435763

Browse files
committed
Fixed auto fixable eslint issues
1 parent 2042a69 commit d435763

39 files changed

+1353
-1355
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
"eslint-config-standard-react": "^4.0.0",
174174
"eslint-plugin-babel": "^4.0.0",
175175
"eslint-plugin-promise": "^3.0.0",
176-
"eslint-plugin-react": "~6.10.3",
176+
"eslint-plugin-react": "^6.10.3",
177177
"eslint-plugin-standard": "^2.0.0",
178178
"karma": "^1.0.0",
179179
"karma-coverage": "^1.0.0",

src/compilers/babel5.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
import Base from './base'
1+
import Base from './base';
22

3-
import $script from 'scriptjs'
3+
import $script from 'scriptjs';
44

55
export default class Babel5 extends Base {
6-
loadCompiler() {
7-
$script(['/dist/compilers/browser.js'],() => {
8-
this.compiler = window.babel;
9-
this.resolveFuture();
10-
});
11-
}
6+
loadCompiler() {
7+
$script(['/dist/compilers/browser.js'],() => {
8+
this.compiler = window.babel;
9+
this.resolveFuture();
10+
});
11+
}
1212

13-
compile( input, options = {} ) {
14-
this._checkIfCompilerIsLoaded();
13+
compile( input, options = {} ) {
14+
this._checkIfCompilerIsLoaded();
1515

16-
let code = "",
17-
errors = [];
18-
try {
19-
code = this.compiler.transform( input, {
20-
babelrc: false,
21-
filename: 'repl',
22-
}).code;
23-
} catch( e ) {
24-
errors = [e];
25-
}
26-
27-
return {
28-
code,
29-
errors
30-
};
16+
let code = '',
17+
errors = [];
18+
try {
19+
code = this.compiler.transform( input, {
20+
babelrc: false,
21+
filename: 'repl',
22+
}).code;
23+
} catch( e ) {
24+
errors = [e];
3125
}
26+
27+
return {
28+
code,
29+
errors
30+
};
31+
}
3232
}

src/compilers/babel6.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
import Base from './base'
1+
import Base from './base';
22

3-
import $script from 'scriptjs'
3+
import $script from 'scriptjs';
44

55
export default class Babel extends Base {
6-
loadCompiler() {
7-
$script(['https://unpkg.com/babel-standalone@6.15.0/babel.min.js'],() => {
8-
this.compiler = window.Babel;
9-
this.resolveFuture();
10-
});
11-
}
6+
loadCompiler() {
7+
$script(['https://unpkg.com/babel-standalone@6.15.0/babel.min.js'],() => {
8+
this.compiler = window.Babel;
9+
this.resolveFuture();
10+
});
11+
}
1212

13-
compile( input, options ) {
14-
this._checkIfCompilerIsLoaded();
13+
compile( input, options ) {
14+
this._checkIfCompilerIsLoaded();
1515

16-
let code = "",
17-
errors = [];
18-
try {
19-
code = this.compiler.transform( input, {
20-
babelrc: false,
21-
filename: 'repl',
22-
...options
23-
} ).code;
24-
} catch( e ) {
25-
errors = [e];
26-
}
27-
28-
return {
29-
code,
30-
errors
31-
};
16+
let code = '',
17+
errors = [];
18+
try {
19+
code = this.compiler.transform( input, {
20+
babelrc: false,
21+
filename: 'repl',
22+
...options
23+
} ).code;
24+
} catch( e ) {
25+
errors = [e];
3226
}
27+
28+
return {
29+
code,
30+
errors
31+
};
32+
}
3333
}

src/compilers/base.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ export default class Base {
22
constructor() {
33
this.compiler = undefined;
44
this.future = new Promise(resolve => {
5-
this.resolveFuture = resolve
5+
this.resolveFuture = resolve;
66
});
77
}
88

99
_checkIfCompilerIsLoaded() {
1010
if( ! this.compiler ) {
1111
throw new Error([
12-
'Compiler is not initialized call',
13-
'`loadCompiler` before invoking this function.',
12+
'Compiler is not initialized call',
13+
'`loadCompiler` before invoking this function.',
1414
].join(' '));
1515
}
1616
}
1717

1818
initCompiler() {
1919
if (! this.isInitialized()) {
20-
this.loadCompiler();
20+
this.loadCompiler();
2121
}
2222

2323
return this.future;

src/compilers/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import Babel from './babel6'
2-
import Babel5 from './babel5'
3-
import Traceur from './traceur'
4-
import TypeScript from './typescript'
5-
import Regenerator from './regenerator'
6-
import Prepack from './prepack'
1+
import Babel from './babel6';
2+
import Babel5 from './babel5';
3+
import Traceur from './traceur';
4+
import TypeScript from './typescript';
5+
import Regenerator from './regenerator';
6+
import Prepack from './prepack';
77

88

99
export const DEFAULT_COMPILER = 'Babel (6)';

src/compilers/prepack.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class Prepack extends Base {
88
loc : {
99
line : l,
1010
column : column,
11-
offset : () => { return { line: l,column:endColumn} }
11+
offset : () => { return { line: l,column:endColumn}; }
1212
},
1313
message : description
1414
};
@@ -24,11 +24,11 @@ export default class Prepack extends Base {
2424
compile( input ) {
2525
this._checkIfCompilerIsLoaded();
2626

27-
let code = "",
28-
errors = [];
27+
let code = '',
28+
errors = [];
2929

3030
try {
31-
code = this.compiler.prepack(input).code;
31+
code = this.compiler.prepack(input).code;
3232
} catch (e) {
3333
// errors = [e];
3434
}

src/compilers/regenerator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class Regenerator extends Base {
88
loc : {
99
line : l,
1010
column : column,
11-
offset : () => { return { line: l,column:endColumn} }
11+
offset : () => { return { line: l,column:endColumn}; }
1212
},
1313
message : description
1414
};
@@ -24,8 +24,8 @@ export default class Regenerator extends Base {
2424
compile( input ) {
2525
this._checkIfCompilerIsLoaded();
2626

27-
let code = "",
28-
errors = [];
27+
let code = '',
28+
errors = [];
2929

3030
try {
3131
code = this.compiler.compile( input ).code;

src/compilers/traceur.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import Base from './base'
1+
import Base from './base';
22

3-
import $script from 'scriptjs'
3+
import $script from 'scriptjs';
44

55
export default class Traceur extends Base {
66
constructor() {
@@ -17,15 +17,15 @@ export default class Traceur extends Base {
1717
}
1818

1919
static makeErrorFromMsg( msg ) {
20-
let sm = msg.split(":"),
21-
line = parseInt( sm[1], 10 ),
22-
column = parseInt( sm[2], 10 ) - 1;
20+
let sm = msg.split(':'),
21+
line = parseInt( sm[1], 10 ),
22+
column = parseInt( sm[2], 10 ) - 1;
2323

2424
return {
2525
loc : {
2626
line,
2727
column,
28-
offset : () => { return { line:line,column:NaN } }
28+
offset : () => { return { line:line,column:NaN }; }
2929
},
3030
message : msg
3131
};
@@ -34,8 +34,8 @@ export default class Traceur extends Base {
3434
compile( input ) {
3535
this._checkIfCompilerIsLoaded();
3636

37-
let code = "",
38-
errors = [];
37+
let code = '',
38+
errors = [];
3939

4040
try {
4141
code = this.compiler.compile( input );

src/compilers/typescript.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Base from './base'
1+
import Base from './base';
22

33
export default class TypeScript extends Base {
44
loadCompiler() {
@@ -9,16 +9,16 @@ export default class TypeScript extends Base {
99
}
1010

1111
compile( input ) {
12-
this._checkIfCompilerIsLoaded();
12+
this._checkIfCompilerIsLoaded();
1313

14-
let code = '',
15-
errors = [];
14+
let code = '',
15+
errors = [];
1616

17-
code = this.compiler.transpile( input, { module: this.compiler.ModuleKind.CommonJS });
17+
code = this.compiler.transpile( input, { module: this.compiler.ModuleKind.CommonJS });
1818

19-
return {
20-
code,
21-
errors
22-
};
19+
return {
20+
code,
21+
errors
22+
};
2323
}
2424
}

0 commit comments

Comments
 (0)