Skip to content

Commit

Permalink
Chore: Use object-shorthand batch 1 (refs #6407)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Aug 12, 2016
1 parent c66bcfe commit ff073fe
Show file tree
Hide file tree
Showing 31 changed files with 252 additions and 252 deletions.
4 changes: 2 additions & 2 deletions Makefile.js
Expand Up @@ -398,8 +398,8 @@ function lintMarkdown(files) {
MD041: false // First line in file should be a top level header
},
result = markdownlint.sync({
files: files,
config: config
files,
config
}),
resultString = result.toString(),
returnCode = resultString ? 1 : 0;
Expand Down
28 changes: 14 additions & 14 deletions tests/lib/cli-engine.js
Expand Up @@ -910,7 +910,7 @@ describe("CLIEngine", function() {

engine = new CLIEngine({
ignore: false,
cwd: cwd,
cwd,
rulePaths: ["./"],
configFile: "eslint.json"
});
Expand Down Expand Up @@ -1629,7 +1629,7 @@ describe("CLIEngine", function() {
engine = new CLIEngine({
useEslintrc: false,
cache: true,
cwd: cwd,
cwd,
rules: {
"no-console": 0
},
Expand Down Expand Up @@ -1761,7 +1761,7 @@ describe("CLIEngine", function() {

// specifying cache true the cache will be created
cache: true,
cacheFile: cacheFile,
cacheFile,
rules: {
"no-console": 0,
"no-unused-vars": 2
Expand Down Expand Up @@ -1802,7 +1802,7 @@ describe("CLIEngine", function() {

// specifying cache true the cache will be created
cache: true,
cacheFile: cacheFile,
cacheFile,
rules: {
"no-console": 0,
"no-unused-vars": 2
Expand Down Expand Up @@ -1834,7 +1834,7 @@ describe("CLIEngine", function() {
engine = new CLIEngine({
cwd: path.join(fixtureDir, ".."),
useEslintrc: false,
cacheFile: cacheFile,
cacheFile,
rules: {
"no-console": 0,
"no-unused-vars": 2
Expand All @@ -1855,7 +1855,7 @@ describe("CLIEngine", function() {
engine = new CLIEngine({
cwd: path.join(fixtureDir, ".."),
useEslintrc: false,
cacheFile: cacheFile,
cacheFile,
rules: {
"no-console": 0,
"no-unused-vars": 2
Expand All @@ -1877,7 +1877,7 @@ describe("CLIEngine", function() {
cwd: path.join(fixtureDir, ".."),
useEslintrc: false,
cache: true,
cacheFile: cacheFile,
cacheFile,
rules: {
"no-console": 0,
"no-unused-vars": 2
Expand All @@ -1900,7 +1900,7 @@ describe("CLIEngine", function() {
engine = new CLIEngine({
cwd: path.join(fixtureDir, ".."),
useEslintrc: false,
cacheFile: cacheFile,
cacheFile,
rules: {
"no-console": 0,
"no-unused-vars": 2
Expand Down Expand Up @@ -1988,10 +1988,10 @@ describe("CLIEngine", function() {
engine.addPlugin("test-processor", {
processors: {
".txt": {
preprocess: function(text) {
preprocess(text) {
return [text];
},
postprocess: function(messages) {
postprocess(messages) {
return messages[0];
}
}
Expand Down Expand Up @@ -2031,10 +2031,10 @@ describe("CLIEngine", function() {
engine.addPlugin("test-processor", {
processors: {
".txt": {
preprocess: function(text) {
preprocess(text) {
return [text.replace("a()", "b()")];
},
postprocess: function(messages) {
postprocess(messages) {
messages[0][0].ruleId = "post-processed";
return messages[0];
}
Expand Down Expand Up @@ -2075,10 +2075,10 @@ describe("CLIEngine", function() {
engine.addPlugin("test-processor", {
processors: {
".txt": {
preprocess: function(text) {
preprocess(text) {
return [text.replace("a()", "b()")];
},
postprocess: function(messages) {
postprocess(messages) {
messages[0][0].ruleId = "post-processed";
return messages[0];
}
Expand Down
62 changes: 31 additions & 31 deletions tests/lib/code-path-analysis/code-path-analyzer.js
Expand Up @@ -69,7 +69,7 @@ describe("CodePathAnalyzer", function() {
actual = [];
eslint.defineRule("test", function() {
return {
onCodePathStart: function(codePath) {
onCodePathStart(codePath) {
actual.push(codePath);
}
};
Expand Down Expand Up @@ -149,14 +149,14 @@ describe("CodePathAnalyzer", function() {
let codePath = null;

return {
onCodePathStart: function(cp) {
onCodePathStart(cp) {
codePath = cp;
},
ReturnStatement: function() {
ReturnStatement() {
assert(codePath.currentSegments.length === 1);
assert(codePath.currentSegments[0] instanceof CodePathSegment);
},
ThrowStatement: function() {
ThrowStatement() {
assert(codePath.currentSegments.length === 1);
assert(codePath.currentSegments[0] instanceof CodePathSegment);
}
Expand All @@ -176,7 +176,7 @@ describe("CodePathAnalyzer", function() {
actual = [];
eslint.defineRule("test", function() {
return {
onCodePathSegmentStart: function(segment) {
onCodePathSegmentStart(segment) {
actual.push(segment);
}
};
Expand Down Expand Up @@ -265,7 +265,7 @@ describe("CodePathAnalyzer", function() {

eslint.defineRule("test", function() {
return {
onCodePathStart: function(cp, node) {
onCodePathStart(cp, node) {
count += 1;
lastCodePathNodeType = node.type;

Expand All @@ -280,16 +280,16 @@ describe("CodePathAnalyzer", function() {
assert(node.type === "ArrowFunctionExpression");
}
},
Program: function() {
Program() {
assert(lastCodePathNodeType === "Program");
},
FunctionDeclaration: function() {
FunctionDeclaration() {
assert(lastCodePathNodeType === "FunctionDeclaration");
},
FunctionExpression: function() {
FunctionExpression() {
assert(lastCodePathNodeType === "FunctionExpression");
},
ArrowFunctionExpression: function() {
ArrowFunctionExpression() {
assert(lastCodePathNodeType === "ArrowFunctionExpression");
}
};
Expand All @@ -310,7 +310,7 @@ describe("CodePathAnalyzer", function() {

eslint.defineRule("test", function() {
return {
onCodePathEnd: function(cp, node) {
onCodePathEnd(cp, node) {
count += 1;

assert(cp instanceof CodePath);
Expand All @@ -325,16 +325,16 @@ describe("CodePathAnalyzer", function() {
}
assert(node.type === lastNodeType);
},
"Program:exit": function() {
"Program:exit"() {
lastNodeType = "Program";
},
"FunctionDeclaration:exit": function() {
"FunctionDeclaration:exit"() {
lastNodeType = "FunctionDeclaration";
},
"FunctionExpression:exit": function() {
"FunctionExpression:exit"() {
lastNodeType = "FunctionExpression";
},
"ArrowFunctionExpression:exit": function() {
"ArrowFunctionExpression:exit"() {
lastNodeType = "ArrowFunctionExpression";
}
};
Expand All @@ -355,7 +355,7 @@ describe("CodePathAnalyzer", function() {

eslint.defineRule("test", function() {
return {
onCodePathSegmentStart: function(segment, node) {
onCodePathSegmentStart(segment, node) {
count += 1;
lastCodePathNodeType = node.type;

Expand All @@ -370,16 +370,16 @@ describe("CodePathAnalyzer", function() {
assert(node.type === "ArrowFunctionExpression");
}
},
Program: function() {
Program() {
assert(lastCodePathNodeType === "Program");
},
FunctionDeclaration: function() {
FunctionDeclaration() {
assert(lastCodePathNodeType === "FunctionDeclaration");
},
FunctionExpression: function() {
FunctionExpression() {
assert(lastCodePathNodeType === "FunctionExpression");
},
ArrowFunctionExpression: function() {
ArrowFunctionExpression() {
assert(lastCodePathNodeType === "ArrowFunctionExpression");
}
};
Expand All @@ -400,7 +400,7 @@ describe("CodePathAnalyzer", function() {

eslint.defineRule("test", function() {
return {
onCodePathSegmentEnd: function(cp, node) {
onCodePathSegmentEnd(cp, node) {
count += 1;

assert(cp instanceof CodePathSegment);
Expand All @@ -415,16 +415,16 @@ describe("CodePathAnalyzer", function() {
}
assert(node.type === lastNodeType);
},
"Program:exit": function() {
"Program:exit"() {
lastNodeType = "Program";
},
"FunctionDeclaration:exit": function() {
"FunctionDeclaration:exit"() {
lastNodeType = "FunctionDeclaration";
},
"FunctionExpression:exit": function() {
"FunctionExpression:exit"() {
lastNodeType = "FunctionExpression";
},
"ArrowFunctionExpression:exit": function() {
"ArrowFunctionExpression:exit"() {
lastNodeType = "ArrowFunctionExpression";
}
};
Expand All @@ -444,7 +444,7 @@ describe("CodePathAnalyzer", function() {

eslint.defineRule("test", function() {
return {
onCodePathSegmentLoop: function(fromSegment, toSegment, node) {
onCodePathSegmentLoop(fromSegment, toSegment, node) {
count += 1;
assert(fromSegment instanceof CodePathSegment);
assert(toSegment instanceof CodePathSegment);
Expand All @@ -465,7 +465,7 @@ describe("CodePathAnalyzer", function() {

eslint.defineRule("test", function() {
return {
onCodePathSegmentLoop: function(fromSegment, toSegment, node) {
onCodePathSegmentLoop(fromSegment, toSegment, node) {
count += 1;
assert(fromSegment instanceof CodePathSegment);
assert(toSegment instanceof CodePathSegment);
Expand All @@ -486,7 +486,7 @@ describe("CodePathAnalyzer", function() {

eslint.defineRule("test", function() {
return {
onCodePathSegmentLoop: function(fromSegment, toSegment, node) {
onCodePathSegmentLoop(fromSegment, toSegment, node) {
count += 1;
assert(fromSegment instanceof CodePathSegment);
assert(toSegment instanceof CodePathSegment);
Expand Down Expand Up @@ -514,7 +514,7 @@ describe("CodePathAnalyzer", function() {

eslint.defineRule("test", function() {
return {
onCodePathSegmentLoop: function(fromSegment, toSegment, node) {
onCodePathSegmentLoop(fromSegment, toSegment, node) {
count += 1;
assert(fromSegment instanceof CodePathSegment);
assert(toSegment instanceof CodePathSegment);
Expand Down Expand Up @@ -542,7 +542,7 @@ describe("CodePathAnalyzer", function() {

eslint.defineRule("test", function() {
return {
onCodePathSegmentLoop: function(fromSegment, toSegment, node) {
onCodePathSegmentLoop(fromSegment, toSegment, node) {
count += 1;
assert(fromSegment instanceof CodePathSegment);
assert(toSegment instanceof CodePathSegment);
Expand Down Expand Up @@ -580,7 +580,7 @@ describe("CodePathAnalyzer", function() {

eslint.defineRule("test", function() {
return {
onCodePathEnd: function(codePath) {
onCodePathEnd(codePath) {
actual.push(debug.makeDotArrows(codePath));
}
};
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/code-path-analysis/code-path.js
Expand Up @@ -28,7 +28,7 @@ function parseCodePaths(code) {
eslint.reset();
eslint.defineRule("test", function() {
return {
onCodePathStart: function(codePath) {
onCodePathStart(codePath) {
retv.push(codePath);
}
};
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/config/config-file.js
Expand Up @@ -158,7 +158,7 @@ describe("ConfigFile", function() {

// Hacky: need to override isFile for each call for testing
"../util/module-resolver": createStubModuleResolver({ "eslint-config-foo": resolvedPath }),
"require-uncached": function(filename) {
"require-uncached"(filename) {
return configDeps[filename];
}
};
Expand Down Expand Up @@ -229,7 +229,7 @@ describe("ConfigFile", function() {
"eslint-config-foo": resolvedPaths[0],
"eslint-config-bar": resolvedPaths[1]
}),
"require-uncached": function(filename) {
"require-uncached"(filename) {
return configDeps[filename];
}
};
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/config/config-initializer.js
Expand Up @@ -227,7 +227,7 @@ describe("configInitializer", function() {

answers = {
source: "auto",
patterns: patterns,
patterns,
es6: false,
env: ["browser"],
jsx: false,
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/config/config-ops.js
Expand Up @@ -97,7 +97,7 @@ describe("ConfigOps", function() {
it("should return correct config for env with no globals", function() {
const StubbedConfigOps = proxyquire("../../../lib/config/config-ops", {
"./environments": {
get: function() {
get() {
return {
parserOptions: {
sourceType: "module"
Expand Down

0 comments on commit ff073fe

Please sign in to comment.