@samitouri / QOS-React-2 / commits / cb49492f88

lint whitespace

- use spaces - remove space before paren in function - remove space before colon in object

Henry Zhu committed Feb 14, 2015 at 11:12 UTC cb49492f88b90b84f4494a11a6dbc6881ccde47a
5 files changed +31 -31
docs/extractCode.js
+23 -23
@@ -5,33 +5,33 @@ var CODE_SAMPLE = /```[\S]+\s*[\s\S]*?```/g;
5 var PARTS = /```[\S]+\s*\/\/\s+(.+?)\n([\s\S]*?)```/;
6
7 function truncate(s, n) {
8 - n = n || 256
9 - if (s.length < n) {
10 - return s;
11 - }
12 - return s.substring(0, n) + '...';
8 + n = n || 256
9 + if (s.length < n) {
10 + return s;
11 + }
12 + return s.substring(0, n) + '...';
13 }
14
15 function main(dest, filenames) {
16 - if (!dest) {
17 - throw new Error('no dest provided');
18 - }
19 - filenames.map(function (filename) {
20 - var content = fs.readFileSync(filename).toString('utf8');
21 - var codeSamples = content.match(CODE_SAMPLE);
16 + if (!dest) {
17 + throw new Error('no dest provided');
18 + }
19 + filenames.map(function(filename) {
20 + var content = fs.readFileSync(filename).toString('utf8');
21 + var codeSamples = content.match(CODE_SAMPLE);
22
23 - codeSamples.map(function (codeSample) {
24 - // Do a little jank preprocessing
25 - codeSample = codeSample.replace('<!--', '//').replace(' -->', '');
26 - var extracted = codeSample.match(PARTS);
27 - if (!extracted) {
28 - throw new Error('Code sample did not match correct format in ' + filename + ': ' + truncate(codeSample));
29 - }
30 - var filename = extracted[1];
31 - var content = extracted[2].replace(/\*\*/g, '');
32 - fs.writeFileSync(argv.dest + '/' + filename, content);
33 - });
23 + codeSamples.map(function(codeSample) {
24 + // Do a little jank preprocessing
25 + codeSample = codeSample.replace('<!--', '//').replace(' -->', '');
26 + var extracted = codeSample.match(PARTS);
27 + if (!extracted) {
28 + throw new Error('Code sample did not match correct format in ' + filename + ': ' + truncate(codeSample));
29 + }
30 + var filename = extracted[1];
31 + var content = extracted[2].replace(/\*\*/g, '');
32 + fs.writeFileSync(argv.dest + '/' + filename, content);
33 });
34 + });
35 }
36
37 -main(argv.dest, argv._);
\ No newline at end of file
37 +main(argv.dest, argv._);
src/test/mocks.js
+3 -3
@@ -116,8 +116,8 @@ function makeComponent(metadata) {
116 f._isMockFunction = true;
117
118 f.mock = {
119 - calls : calls,
120 - instances : instances
119 + calls: calls,
120 + instances: instances
121 };
122
123 f.mockClear = function() {
@@ -218,7 +218,7 @@ function _getMetadata(component, _refs) {
218 return null;
219 }
220
221 - var metadata = {type : type};
221 + var metadata = {type: type};
222 if (type == 'constant') {
223 metadata.value = component;
224 return metadata;
vendor/fbtransform/syntax.js
+2 -2
@@ -57,10 +57,10 @@ function runCli(argv) {
57 var source = '';
58 process.stdin.resume();
59 process.stdin.setEncoding('utf8');
60 - process.stdin.on('data', function (chunk) {
60 + process.stdin.on('data', function(chunk) {
61 source += chunk;
62 });
63 - process.stdin.on('end', function () {
63 + process.stdin.on('end', function() {
64 try {
65 source = transformAll(source, options, excludes);
66 } catch (e) {
vendor/fbtransform/transforms/__tests__/react-test.js
+1 -1
@@ -338,7 +338,7 @@ describe('react jsx', function() {
338
339 it('should not throw for unknown hyphenated tags', function() {
340 var code = '<x-component />;';
341 - expect(function(){transform(code);}).not.toThrow();
341 + expect(function() {transform(code);}).not.toThrow();
342 });
343
344 it('calls assign with a new target object for spreads', function() {
vendor/fbtransform/transforms/xjs.js
+2 -2
@@ -20,13 +20,13 @@ function renderXJSLiteral(object, isLast, state, start, end) {
20
21 var lastNonEmptyLine = 0;
22
23 - lines.forEach(function (line, index) {
23 + lines.forEach(function(line, index) {
24 if (line.match(/[^ \t]/)) {
25 lastNonEmptyLine = index;
26 }
27 });
28
29 - lines.forEach(function (line, index) {
29 + lines.forEach(function(line, index) {
30 var isFirstLine = index === 0;
31 var isLastLine = index === lines.length - 1;
32 var isLastNonEmptyLine = index === lastNonEmptyLine;