Skip to content

Commit 9116780

Browse files
committed
Fix linting errors
1 parent 5eb10d3 commit 9116780

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/js/babel.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default class BabelCompiler extends SimpleCompilerBase {
1919
// installed in it. Instead, we try to load from our entry point's node_modules
2020
// directory (i.e. Grunt perhaps), and if it doesn't work, just keep going.
2121
attemptToPreload(names, prefix) {
22-
if (!names.length) return null
22+
if (!names.length) return null;
2323

2424
const fixupModule = (exp) => {
2525
// NB: Some plugins like transform-decorators-legacy, use import/export
@@ -34,7 +34,7 @@ export default class BabelCompiler extends SimpleCompilerBase {
3434
x => fixupModule(require.main.require(x)),
3535
x => fixupModule(require(path.join(nodeModulesAboveUs, x))),
3636
x => fixupModule(require(x))
37-
]
37+
];
3838

3939
const possibleNames = (name) => {
4040
let names = [`babel-${prefix}-${name}`];
@@ -57,20 +57,20 @@ export default class BabelCompiler extends SimpleCompilerBase {
5757

5858
try {
5959
return strategy(possibleName);
60-
} catch(e) {}
60+
} catch(e) {} // eslint-disable-line no-empty
6161

6262
return null;
63-
}, null)
64-
}
63+
}, null);
64+
};
6565

6666
// Pick a loading strategy that finds the first plugin, the same strategy will be
6767
// used to preload all plugins
6868
const selectedStrategy = preloadStrategies.reduce((winner, strategy)=>{
6969
if (winner !== null) return winner;
7070
return preloadPossibleNames(names[0], strategy) === null ? null : strategy;
71-
}, null)
71+
}, null);
7272

73-
return names.map(name => preloadPossibleNames(name, selectedStrategy)).filter((mod) => mod !== null)
73+
return names.map(name => preloadPossibleNames(name, selectedStrategy)).filter((mod) => mod !== null);
7474
}
7575

7676
compileSync(sourceCode, filePath, compilerContext) { // eslint-disable-line no-unused-vars

src/js/typescript.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default class TypeScriptCompiler extends SimpleCompilerBase {
6262
};
6363

6464
if (isTsx && options.builtinOpts.hotModuleReload !== false) {
65-
sourceCode = this.addHotModuleLoadingRegistration(sourceCode, filePath, this.getExportsForFile(sourceCode, filePath, options.typescriptOpts));
65+
sourceCode = this.addHotModuleLoadingRegistration(sourceCode, filePath, this.getExportsForFile(sourceCode, filePath));
6666
}
6767

6868
let output = ts.transpileModule(sourceCode, transpileOptions);
@@ -142,14 +142,14 @@ if (typeof __REACT_HOT_LOADER__ !== 'undefined') {
142142
return tmpl;
143143
}
144144

145-
getExportsForFile(sourceCode, fileName, tsOptions) {
145+
getExportsForFile(sourceCode, fileName) {
146146
let sourceFile = ts.createSourceFile(fileName, sourceCode, ts.ScriptTarget.ES6);
147147
let ret = [];
148148

149149
// Walk the tree to search for classes
150150
let visit = (node) => {
151151
if (!this.isNodeExported(node)) return;
152-
152+
153153
if (node.kind === ts.SyntaxKind.ClassDeclaration || node.kind === ts.SyntaxKind.FunctionDeclaration) {
154154
ret.push(node.name.text);
155155
}

0 commit comments

Comments
 (0)