Skip to content

Commit

Permalink
Convert var to let/const
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Dec 9, 2020
1 parent 2591527 commit 620ce2b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/applyFixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function applyFixes(fixes) {

const fixedSourceTextByFileName = {};
for (const fileName of Object.keys(fixesByFileName)) {
var fixResult = SourceCodeFixer.applyFixes(
const fixResult = SourceCodeFixer.applyFixes(
getSourceCodeMemoized(fileName).text,
fixesByFileName[fileName].map((fix) => ({ fix }))
);
Expand Down
4 changes: 2 additions & 2 deletions lib/createInspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ const createInspector = (expect) => {
return this.baseType.identify(obj);
},
inspect(value, depth, output, inspect) {
var obj = {};
const obj = {};
Object.keys(value).forEach((key) => {
obj[key] = value[key];
});

var keys = Object.keys(obj);
const keys = Object.keys(obj);
if (keys.length === 0) {
output
.text('new Error(')
Expand Down
2 changes: 1 addition & 1 deletion lib/getSourceCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function getSourceCode(fileName) {
fileName
);

var ast;
let ast;
if (parseResult && parseResult.ast) {
ast = parseResult.ast;
} else {
Expand Down
8 changes: 4 additions & 4 deletions lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ module.exports = function run(command, args, options) {
args = [];
}
options = options || {};
var proc = childProcess.spawn(command, args, options);
const proc = childProcess.spawn(command, args, options);

var commandLine = command + (args.length > 0 ? ` ${args.join(' ')}` : '');
const commandLine = command + (args.length > 0 ? ` ${args.join(' ')}` : '');

var bufferedLinesByStreamName = {};
const bufferedLinesByStreamName = {};

proc.commandLine = commandLine;

Expand All @@ -20,7 +20,7 @@ module.exports = function run(command, args, options) {
bufferedLinesByStreamName[streamName] = [];
}
byLine(proc[streamName]).on('data', function (chunk) {
var line = chunk.toString('utf-8');
const line = chunk.toString('utf-8');
if (options.bufferLines) {
bufferedLinesByStreamName[streamName].push(line);
}
Expand Down

0 comments on commit 620ce2b

Please sign in to comment.