mirror of https://github.com/status-im/metro.git
Minor lint fixes
Reviewed By: jeanlauliac Differential Revision: D5111517 fbshipit-source-id: 5cf8884334b881fb9a2b1b490972faf45c0c569b
This commit is contained in:
parent
926e42c1fc
commit
f2572cf7b5
|
@ -231,7 +231,7 @@ class Bundle extends BundleBase {
|
||||||
|
|
||||||
result.sections.push({
|
result.sections.push({
|
||||||
offset: {line, column: 0},
|
offset: {line, column: 0},
|
||||||
map: map,
|
map,
|
||||||
});
|
});
|
||||||
line += module.code.split('\n').length;
|
line += module.code.split('\n').length;
|
||||||
});
|
});
|
||||||
|
|
|
@ -198,7 +198,7 @@ class Bundler {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const getTransformCacheKey = (options) => {
|
const getTransformCacheKey = options => {
|
||||||
return transformCacheKey + getCacheKey(options);
|
return transformCacheKey + getCacheKey(options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -810,7 +810,7 @@ class Bundler {
|
||||||
inlineRequires: transform.inlineRequires || false,
|
inlineRequires: transform.inlineRequires || false,
|
||||||
platform,
|
platform,
|
||||||
projectRoot: options.projectRoots[0],
|
projectRoot: options.projectRoots[0],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
preloadedModules: extraOptions.preloadedModules,
|
preloadedModules: extraOptions.preloadedModules,
|
||||||
ramGroups: extraOptions.ramGroups,
|
ramGroups: extraOptions.ramGroups,
|
||||||
|
|
|
@ -72,5 +72,5 @@ function filterObject(object, blacklist) {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
generateAssetCodeFileAst,
|
generateAssetCodeFileAst,
|
||||||
generateAssetTransformResult,
|
generateAssetTransformResult,
|
||||||
isAssetTypeAnImage
|
isAssetTypeAnImage,
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,14 +18,15 @@ const {UGLIFY_JS_OUTPUT_OPTIONS} = require('./JsMinification');
|
||||||
import type {MappingsMap} from '../../lib/SourceMap';
|
import type {MappingsMap} from '../../lib/SourceMap';
|
||||||
|
|
||||||
function minify(filename: string, inputCode: string, sourceMap: ?MappingsMap) {
|
function minify(filename: string, inputCode: string, sourceMap: ?MappingsMap) {
|
||||||
let {code, map} = uglify.minify(inputCode, {
|
const result = uglify.minify(inputCode, {
|
||||||
fromString: true,
|
fromString: true,
|
||||||
inSourceMap: sourceMap,
|
inSourceMap: sourceMap,
|
||||||
outSourceMap: true,
|
outSourceMap: true,
|
||||||
output: UGLIFY_JS_OUTPUT_OPTIONS,
|
output: UGLIFY_JS_OUTPUT_OPTIONS,
|
||||||
});
|
});
|
||||||
|
|
||||||
map = JSON.parse(map);
|
const code = result.code;
|
||||||
|
const map = JSON.parse(result.map);
|
||||||
map.sources = [filename];
|
map.sources = [filename];
|
||||||
return {code, map};
|
return {code, map};
|
||||||
}
|
}
|
||||||
|
|
|
@ -386,7 +386,7 @@ class OptionsHasher {
|
||||||
hashTransformOptions(hash: crypto$Hash, options: TransformOptionsStrict): crypto$Hash {
|
hashTransformOptions(hash: crypto$Hash, options: TransformOptionsStrict): crypto$Hash {
|
||||||
const {
|
const {
|
||||||
generateSourceMaps, dev, hot, inlineRequires, platform, projectRoot,
|
generateSourceMaps, dev, hot, inlineRequires, platform, projectRoot,
|
||||||
...unknowns,
|
...unknowns
|
||||||
} = options;
|
} = options;
|
||||||
const unknownKeys = Object.keys(unknowns);
|
const unknownKeys = Object.keys(unknowns);
|
||||||
if (unknownKeys.length > 0) {
|
if (unknownKeys.length > 0) {
|
||||||
|
|
|
@ -61,7 +61,7 @@ function tryParse(
|
||||||
assetName: path.join(dirPath, `${rootName}.${extension}`),
|
assetName: path.join(dirPath, `${rootName}.${extension}`),
|
||||||
name: rootName,
|
name: rootName,
|
||||||
platform,
|
platform,
|
||||||
resolution: resolution,
|
resolution,
|
||||||
type: extension,
|
type: extension,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ function transform({filename, options, src}: Params) {
|
||||||
ast: null,
|
ast: null,
|
||||||
code: src,
|
code: src,
|
||||||
filename,
|
filename,
|
||||||
map: null
|
map: null,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
const result = generate(ast, {
|
const result = generate(ast, {
|
||||||
|
|
Loading…
Reference in New Issue