Permalink
Browse files

Fix lint errors 1/n

Reviewed By: davidaurelio

Differential Revision: D4627645

fbshipit-source-id: 3cf368c6a24a555b7d0a39045f6ba6fd92ae34e1
  • Loading branch information...
cpojer authored and facebook-github-bot committed Feb 28, 2017
1 parent 05c36b4 commit 5403946f098cc72c3d33ea5cee263fb3dd03891d
Showing with 532 additions and 533 deletions.
  1. +17 −17 packager/src/AssetServer/__tests__/AssetServer-test.js
  2. +3 −3 packager/src/AssetServer/index.js
  3. +4 −4 packager/src/Bundler/Bundle.js
  4. +1 −1 packager/src/Bundler/BundleBase.js
  5. +1 −1 packager/src/Bundler/HMRBundle.js
  6. +14 −14 packager/src/Bundler/__tests__/Bundle-test.js
  7. +47 −47 packager/src/Bundler/__tests__/Bundler-test.js
  8. +10 −10 packager/src/Bundler/index.js
  9. +2 −2 packager/src/Bundler/source-map/__tests__/source-map-test.js
  10. +2 −2 packager/src/Bundler/source-map/encode.js
  11. +1 −1 packager/src/Bundler/source-map/source-map.js
  12. +1 −1 packager/src/JSTransformer/__mocks__/worker.js
  13. +1 −1 packager/src/JSTransformer/index.js
  14. +20 −20 packager/src/JSTransformer/worker/__tests__/worker-test.js
  15. +2 −2 packager/src/JSTransformer/worker/constant-folding.js
  16. +1 −1 packager/src/JSTransformer/worker/extract-dependencies.js
  17. +2 −2 packager/src/JSTransformer/worker/inline.js
  18. +1 −1 packager/src/JSTransformer/worker/worker.js
  19. +7 −7 packager/src/ModuleGraph/__tests__/Graph-test.js
  20. +3 −3 packager/src/ModuleGraph/node-haste/Package.js
  21. +51 −51 packager/src/ModuleGraph/node-haste/node-haste.js
  22. +1 −1 packager/src/ModuleGraph/output/as-plain-bundle.js
  23. +1 −1 packager/src/ModuleGraph/output/util.js
  24. +1 −1 packager/src/ModuleGraph/worker/__tests__/optimize-module-test.js
  25. +1 −1 packager/src/ModuleGraph/worker/__tests__/transform-module-test.js
  26. +23 −23 packager/src/Resolver/__tests__/Resolver-test.js
  27. +2 −2 packager/src/Resolver/index.js
  28. +9 −9 packager/src/Resolver/polyfills/error-guard.js
  29. +179 −179 packager/src/Resolver/polyfills/require.js
  30. +1 −1 packager/src/Server/MultipartResponse.js
  31. +3 −4 packager/src/Server/__tests__/MultipartResponse-test.js
  32. +13 −13 packager/src/Server/__tests__/Server-test.js
  33. +12 −12 packager/src/Server/index.js
  34. +1 −1 packager/src/Server/symbolicate/symbolicate.js
  35. +17 −17 packager/src/Server/symbolicate/worker.js
  36. +1 −1 packager/src/lib/TerminalReporter.js
  37. +3 −3 packager/src/lib/TransformCache.js
  38. +1 −1 packager/src/lib/__mocks__/TransformCache.js
  39. +1 −1 packager/src/lib/__mocks__/declareOpts.js
  40. +2 −2 packager/src/lib/__tests__/BatchProcessor-test.js
  41. +1 −1 packager/src/lib/__tests__/TransformCache-test.js
  42. +10 −10 packager/src/lib/__tests__/declareOpts-test.js
  43. +1 −1 packager/src/lib/relativizeSourceMap.js
  44. +1 −1 packager/src/node-haste/AssetModule.js
  45. +1 −1 packager/src/node-haste/Cache/__tests__/Cache-test.js
  46. +1 −1 packager/src/node-haste/DependencyGraph/DependencyGraphHelpers.js
  47. +4 −4 packager/src/node-haste/DependencyGraph/ResolutionRequest.js
  48. +3 −3 packager/src/node-haste/Package.js
  49. +5 −5 packager/src/node-haste/__mocks__/graceful-fs.js
  50. +32 −32 packager/src/node-haste/__tests__/DependencyGraph-test.js
  51. +6 −6 packager/src/node-haste/__tests__/Module-test.js
  52. +1 −1 packager/src/node-haste/index.js
  53. +1 −1 packager/src/node-haste/lib/__tests__/getInverseDependencies-test.js
  54. +2 −2 packager/src/node-haste/lib/getAssetDataFromName.js
@@ -38,8 +38,8 @@ describe('AssetServer', () => {
imgs: {
'b.png': 'b image',
'b@2x.png': 'b2 image',
}
}
},
},
});
return Promise.all([
@@ -65,8 +65,8 @@ describe('AssetServer', () => {
'b.android.png': 'b android image',
'c.png': 'c general image',
'c.android.png': 'c android image',
}
}
},
},
});
return Promise.all([
@@ -100,8 +100,8 @@ describe('AssetServer', () => {
imgs: {
'b.png': 'png image',
'b.jpg': 'jpeg image',
}
}
},
},
});
return Promise.all([
@@ -128,8 +128,8 @@ describe('AssetServer', () => {
'b@2x.png': 'b2 image',
'b@4x.png': 'b4 image',
'b@4.5x.png': 'b4.5 image',
}
}
},
},
});
return server.get('imgs/b@3x.png').then(data =>
@@ -154,8 +154,8 @@ describe('AssetServer', () => {
'b@2x.ios.png': 'b2 ios image',
'b@4x.ios.png': 'b4 ios image',
'b@4.5x.ios.png': 'b4.5 ios image',
}
}
},
},
});
return Promise.all([
@@ -209,8 +209,8 @@ describe('AssetServer', () => {
'b@2x.png': 'b2 image',
'b@4x.png': 'b4 image',
'b@4.5x.png': 'b4.5 image',
}
}
},
},
});
return server.getAssetData('imgs/b.png').then(data => {
@@ -241,8 +241,8 @@ describe('AssetServer', () => {
'b@2x.jpg': 'b2 image',
'b@4x.jpg': 'b4 image',
'b@4.5x.jpg': 'b4.5 image',
}
}
},
},
});
return server.getAssetData('imgs/b.jpg').then(data => {
@@ -275,11 +275,11 @@ describe('AssetServer', () => {
'b@2x.jpg': 'b2 image',
'b@4x.jpg': 'b4 image',
'b@4.5x.jpg': 'b4.5 image',
}
}
},
},
};
fs.__setMockFilesystem(mockFS);
fs.__setMockFilesystem(mockFS);
});
it('uses the file contents to build the hash', () => {
@@ -15,14 +15,14 @@ const fs = require('fs');
const getAssetDataFromName = require('../node-haste').getAssetDataFromName;
const path = require('path');
const createTimeoutPromise = (timeout) => new Promise((resolve, reject) => {
const createTimeoutPromise = timeout => new Promise((resolve, reject) => {
setTimeout(reject, timeout, 'fs operation timeout');
});
function timeoutableDenodeify(fsFunc, timeout) {
return function raceWrapper(...args) {
return Promise.race([
createTimeoutPromise(timeout),
denodeify(fsFunc).apply(this, args)
denodeify(fsFunc).apply(this, args),
]);
};
}
@@ -134,7 +134,7 @@ class AssetServer {
const map = this._buildAssetMap(dir, files, platform);
let record;
if (platform != null){
if (platform != null) {
record = map[getAssetKey(assetData.assetName, platform)] ||
map[assetData.assetName];
} else {
@@ -229,7 +229,7 @@ class Bundle extends BundleBase {
}
result.sections.push({
offset: { line: line, column: 0 },
offset: {line, column: 0},
map: (map: MixedSourceMap),
});
line += module.code.split('\n').length;
@@ -324,11 +324,11 @@ function generateSourceMapForVirtualModule(module): SourceMap {
return {
version: 3,
sources: [ module.sourcePath ],
sources: [module.sourcePath],
names: [],
mappings: mappings,
mappings,
file: module.sourcePath,
sourcesContent: [ module.sourceCode ],
sourcesContent: [module.sourceCode],
};
}
@@ -94,7 +94,7 @@ class BundleBase {
return this._source;
}
this._source = this._modules.map((module) => module.code).join('\n');
this._source = this._modules.map(module => module.code).join('\n');
return this._source;
}
@@ -14,7 +14,7 @@ const ModuleTransport = require('../lib/ModuleTransport');
class HMRBundle extends BundleBase {
constructor({sourceURLFn, sourceMappingURLFn}) {
super();
this._sourceURLFn = sourceURLFn
this._sourceURLFn = sourceURLFn;
this._sourceMappingURLFn = sourceMappingURLFn;
this._sourceURLs = [];
this._sourceMappingURLs = [];
@@ -46,7 +46,7 @@ describe('Bundle', () => {
expect(bundle.getSource({dev: true})).toBe([
'transformed foo;',
'transformed bar;',
'\/\/# sourceMappingURL=test_url'
'\/\/# sourceMappingURL=test_url',
].join('\n'));
});
});
@@ -118,7 +118,7 @@ describe('Bundle', () => {
const resolver = {
wrapModule({name}) {
return new Promise(resolve => resolves[name] = resolve);
}
},
};
const promise = Promise.all(
@@ -180,49 +180,49 @@ describe('Bundle', () => {
file: 'test_url',
version: 3,
sections: [
{ offset: { line: 0, column: 0 }, map: { name: 'sourcemap foo' } },
{ offset: { line: 2, column: 0 }, map: { name: 'sourcemap bar' } },
{offset: {line: 0, column: 0}, map: {name: 'sourcemap foo'}},
{offset: {line: 2, column: 0}, map: {name: 'sourcemap bar'}},
{
offset: {
column: 0,
line: 4
line: 4,
},
map: {
file: 'image.png',
mappings: 'AAAA;AACA;',
names: [],
sources: [ 'image.png' ],
sources: ['image.png'],
sourcesContent: ['image module;\nimage module;'],
version: 3,
}
},
},
{
offset: {
column: 0,
line: 6
line: 6,
},
map: {
file: 'require-InitializeCore.js',
mappings: 'AAAA;',
names: [],
sources: [ 'require-InitializeCore.js' ],
sources: ['require-InitializeCore.js'],
sourcesContent: [';require("InitializeCore");'],
version: 3,
}
},
},
{
offset: {
column: 0,
line: 7
line: 7,
},
map: {
file: 'require-foo.js',
mappings: 'AAAA;',
names: [],
sources: [ 'require-foo.js' ],
sources: ['require-foo.js'],
sourcesContent: [';require("foo");'],
version: 3,
}
},
},
],
});
@@ -342,7 +342,7 @@ describe('Bundle', () => {
const {groups} = bundle.getUnbundle();
expect(groups).toEqual(new Map([[
idFor('Product1'),
new Set(['React', 'ReactFoo', 'invariant', 'ReactBar', 'cx'].map(idFor))
new Set(['React', 'ReactFoo', 'invariant', 'ReactBar', 'cx'].map(idFor)),
]]));
});
Oops, something went wrong.

0 comments on commit 5403946

Please sign in to comment.