Skip to content

Commit f5be3a8

Browse files
committed
Only double quoted strings
1 parent 9b61a69 commit f5be3a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+814
-814
lines changed

.jshintrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// JSHint Default Configuration File (as on JSHint website)
33
// See http://jshint.com/docs/ for more details
44

5-
"maxerr": 50, // {int} Maximum error before stopping
5+
"maxerr": false, // {int} Maximum error before stopping
66

77
// Enforcing
88
"bitwise": true, // true: Prohibit bitwise operators (&, |, ^, etc.)
@@ -19,7 +19,7 @@
1919
"nonbsp": true, // true: Prohibit "non-breaking whitespace" characters.
2020
"nonew": false, // true: Prohibit use of constructors for side-effects (without assignment)
2121
"plusplus": false, // true: Prohibit use of `++` and `--`
22-
"quotmark": false, // Quotation mark consistency:
22+
"quotmark": true, // Quotation mark consistency:
2323
// false : do nothing (default)
2424
// true : ensure whatever is used is consistent
2525
// "single" : require single quotes
@@ -32,7 +32,7 @@
3232
"strict": true, // true: Requires all functions run in ES5 Strict Mode
3333
"maxparams": 7, // {int} Max number of formal params allowed per function,false to turn off
3434
"maxdepth": 2, // {int} Max depth of nested blocks (within functions) false to turn off
35-
"maxstatements": false, // {int} Max number statements per function
35+
"maxstatements": 10, // {int} Max number statements per function,false to turn off
3636
"maxcomplexity": 11, // {int} Max cyclomatic complexity per function,false to turn off
3737
"maxlen": false, // {int} Max number of characters per line
3838
"varstmt": true, // true: Disallow any var statements. Only `let` and `const` are allowed.

HelloWorld/HelloWorld.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/* jshint globalstrict: true */
22
/* jshint node: true */
3-
'use strict';
3+
"use strict";
44
function serve (req, res) {
55
res.writeHead(200, {
6-
'Content-Type"+': 'text/plain'
6+
"Content-Type"+": "text/plain"
77
});
8-
res.end('Hello World\n');
8+
res.end("Hello World\n");
99
}
1010

11-
const http = require('http');
11+
const http = require("http");
1212

1313
const server = http.createServer(serve);
1414

15-
server.listen(1337, '127.0.0.1');
15+
server.listen(1337, "127.0.0.1");
1616

17-
console.log('Server running at http://127.0.0.1:1337/');
17+
console.log("Server running at http://127.0.0.1:1337/");

asmodule/find.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ FindPattern.prototype.find =
2828
function() {
2929

3030
this.files.forEach(function(file) {
31-
fs.readFile(file, 'utf8', function(err, content) {
31+
fs.readFile(file, "utf8", function(err, content) {
3232
if (err)
33-
return this.emit('error', err);
34-
this.emit('fileread', file);
33+
return this.emit("error", err);
34+
this.emit("fileread", file);
3535
let match = null;
3636
if (!!(match = content.match(this.regex)))
37-
match.forEach(function(elem) { this.emit('found', file, elem); });
37+
match.forEach(function(elem) { this.emit("found", file, elem); });
3838
});
3939
});
4040
return this;

asmodule/proto.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ if (argc > 2) {
3030
parseArgs(argc);
3131

3232
const fs = require("fs");
33-
const finder = require('./find.js');
33+
const finder = require("./find.js");
3434

3535
fs.readdir(".", function(err, files) {
3636
if (err)
3737
console.log("Error reading directory: " + err.message);
3838
else {
3939
let findPatternObject = new finder(expression);
4040
findPatternObject.setFiles(files);
41-
findPatternObject.addFile('nonexistentfile.txt');
41+
findPatternObject.addFile("nonexistentfile.txt");
4242
findPatternObject.find()
43-
.on('found',
43+
.on("found",
4444
function(file, match) {
45-
console.log('Matched "' + match + '" in file ' + file);
45+
console.log("Matched <" + match + "> in file " + file);
4646
})
47-
.on('fileread', function(file) { console.log('Read file ' + file); })
48-
.on('error',
49-
function(err) { console.log('Error emitted ' + err.message); });
47+
.on("fileread", function(file) { console.log("Read file " + file); })
48+
.on("error",
49+
function(err) { console.log("Error emitted " + err.message); });
5050
}
5151
});
5252
}

asyncflow/asyncflow.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*jshint globalstrict: true*/
22
/*jshint node: true */
33
/*jshint esversion: 6 */
4-
'use strict';
4+
"use strict";
55

66
function asyncFlow(generatorFunction) {
77
let generator;
@@ -16,13 +16,13 @@ function asyncFlow(generatorFunction) {
1616
generator.next();
1717
}
1818

19-
const fs = require('fs'),
20-
path = require('path');
19+
const fs = require("fs"),
20+
path = require("path");
2121

2222

2323
asyncFlow(function*(callback) {
2424
const fileName = path.basename(__filename);
25-
const myself = yield fs.readFile(fileName, 'utf8', callback);
26-
yield fs.writeFile('clone_of_' + fileName, myself, callback);
27-
console.log('Clone created');
25+
const myself = yield fs.readFile(fileName, "utf8", callback);
26+
yield fs.writeFile("clone_of_" + fileName, myself, callback);
27+
console.log("Clone created");
2828
});

asyncpromise/asyncpromise.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*jshint globalstrict: true*/
22
/*jshint node: true */
33
/*jshint esversion: 6 */
4-
'use strict';
4+
"use strict";
55

66
function asyncFlowWithPromises(generatorFunction) {
77
let generator, promise, next;
@@ -36,12 +36,12 @@ function promisify(callbackBasedApi) {
3636
};
3737
}
3838

39-
const fs = require('fs');
39+
const fs = require("fs");
4040
const readFile = promisify(fs.readFile);
4141
const writeFile = promisify(fs.writeFile);
4242

4343
asyncFlowWithPromises(function*() {
44-
const myself = yield readFile(__filename, 'utf8');
44+
const myself = yield readFile(__filename, "utf8");
4545
yield writeFile("clone_of_asyncpromise.js", myself);
4646
console.log("Clone created");
4747
});

asyncthunk/asyncthunk.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*jshint globalstrict: true*/
22
/*jshint node: true */
33
/*jshint esversion: 6 */
4-
'use strict';
4+
"use strict";
55

66
function asyncFlowWithThunks(generatorFunction) {
77
let generator, thunk;
@@ -19,7 +19,7 @@ function asyncFlowWithThunks(generatorFunction) {
1919
thunk(callback);
2020
}
2121

22-
const fs = require('fs');
22+
const fs = require("fs");
2323

2424
function readFileThunk(filename, options) {
2525
return function(callback) {
@@ -35,7 +35,7 @@ function writeFileThunk(filename, body) {
3535

3636

3737
asyncFlowWithThunks(function*() {
38-
const myself = yield readFileThunk(__filename, 'utf8');
38+
const myself = yield readFileThunk(__filename, "utf8");
3939
yield writeFileThunk("clone_of_asyncthunk.js", myself);
4040
console.log("Clone created");
4141
});

emitter/emitter.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,19 @@ if (argc > 2) {
5858
else
5959
{
6060
/**findPattern(files, /hello \w+/g)***/
61-
files.push('nonexistentfile.txt');
61+
files.push("nonexistentfile.txt");
6262
findPattern(files, expression)
63-
.on('fileread', function(file) {
64-
console.log(file + ' was read');
63+
.on("fileread", function(file) {
64+
console.log(file + " was read");
6565
})
66-
.on('found',
66+
.on("found",
6767
function(file, match) {
68-
console.log('Matched "' + match + '" in file ' + file);
68+
console.log("Matched <" + match + "> in file " + file);
6969
})
70-
.on('error',
70+
.on("error",
7171
function(
7272
err) {
73-
console.log('Error emitted: ' + err.message);
73+
console.log("Error emitted: " + err.message);
7474
});
7575
}
7676
});

emitterproto/proto.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ FindPattern.prototype.setFiles = function(files) {
2929
FindPattern.prototype.find =
3030
function() {
3131
this.files.forEach(function(file) {
32-
fs.readFile(file, 'utf8', function(err, content) {
32+
fs.readFile(file, "utf8", function(err, content) {
3333
if (err)
34-
return this.emit('error', err);
35-
this.emit('fileread', file);
34+
return this.emit("error", err);
35+
this.emit("fileread", file);
3636
let match = null;
3737
if (!!(match = content.match(this.regex)))
3838
match.forEach(function(elem) {
39-
this.emit('found', file, elem);
39+
this.emit("found", file, elem);
4040
});
4141
});
4242
});
@@ -65,27 +65,26 @@ function parseArgs(noOfArgs) {
6565
if (argc > 2) {
6666
parseArgs(argc);
6767
finder = new FindPattern(expression);
68-
finder.on('fileread', function(file) {
69-
console.log(file + ' was read');
68+
finder.on("fileread", function(file) {
69+
console.log(file + " was read");
7070
});
71-
finder.on('found',
71+
finder.on("found",
7272
function(file, match) {
73-
console.log('Matched "' + match + '" in file ' + file);
73+
console.log("Matched <" + match + "> in file " + file);
7474
});
75-
finder.on('error',function(err) {
76-
console.log('Error emitted: ' + err.message);});
75+
finder.on("error",function(err) {
76+
console.log("Error emitted: " + err.message);});
7777
fs.readdir(
7878
".",
7979
function(err, files) {
8080
if (err)
8181
console.log("Error reading directory: " + err.message);
8282
else {
8383
/**findPattern(files, /hello \w+/g)***/
84-
files.push('nonexistentfile.txt');
84+
files.push("nonexistentfile.txt");
8585
finder.setFiles(files);
8686
finder.find();
8787
}
8888
});
8989
} else
9090
exitMessage();
91-

fruitgenerator/fruitgenerator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
function* fruitGenerator()
77
{
8-
yield 'apple';
9-
yield 'orange';
10-
return 'watermelon';
8+
yield "apple";
9+
yield "orange";
10+
return "watermelon";
1111
}
1212

1313
const newFruitGenerator = fruitGenerator();

0 commit comments

Comments
 (0)