Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Apr 2, 2020
1 parent 0a97853 commit c030d80
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/init/autoconfig.js
Expand Up @@ -301,7 +301,7 @@ class Registry {
ruleSetIdx += 1;

if (cb) {
cb(totalFilesLinting); // eslint-disable-line callback-return
cb(totalFilesLinting); // eslint-disable-line node/callback-return
}
});

Expand Down
2 changes: 1 addition & 1 deletion lib/init/source-code-utils.js
Expand Up @@ -97,7 +97,7 @@ function getSourceCodeOfFiles(patterns, options, callback) {
sourceCodes[filename] = sourceCode;
}
if (callback) {
callback(filenames.length); // eslint-disable-line callback-return
callback(filenames.length); // eslint-disable-line node/callback-return
}
});

Expand Down
10 changes: 6 additions & 4 deletions tests/bin/eslint.js
Expand Up @@ -8,7 +8,9 @@
const childProcess = require("child_process");
const fs = require("fs");
const assert = require("chai").assert;
const EXECUTABLE_PATH = require("path").resolve(`${__dirname}/../../bin/eslint.js`);
const path = require("path");

const EXECUTABLE_PATH = path.resolve(path.join(__dirname, "../../bin/eslint.js"));

/**
* Returns a Promise for when a child process exits
Expand Down Expand Up @@ -166,7 +168,7 @@ describe("bin/eslint.js", () => {

it("successfully handles more than 4k data via stdin", () => {
const child = runESLint(["--stdin", "--no-eslintrc"]);
const large = fs.createReadStream(`${__dirname}/../bench/large.js`, "utf8");
const large = fs.createReadStream(path.join(__dirname, "../bench/large.js"), "utf8");

large.pipe(child.stdin);

Expand All @@ -182,7 +184,7 @@ describe("bin/eslint.js", () => {
});

describe("automatically fixing files", () => {
const fixturesPath = `${__dirname}/../fixtures/autofix-integration`;
const fixturesPath = path.join(__dirname, "../fixtures/autofix-integration");
const tempFilePath = `${fixturesPath}/temp.js`;
const startingText = fs.readFileSync(`${fixturesPath}/left-pad.js`).toString();
const expectedFixedText = fs.readFileSync(`${fixturesPath}/left-pad-expected.js`).toString();
Expand Down Expand Up @@ -359,7 +361,7 @@ describe("bin/eslint.js", () => {
});

it("prints the error message pointing to line of code", () => {
const invalidConfig = `${__dirname}/../fixtures/bin/.eslintrc.yml`;
const invalidConfig = path.join(__dirname, "../fixtures/bin/.eslintrc.yml");
const child = runESLint(["--no-ignore", invalidConfig]);
const exitCodeAssertion = assertExitCode(child, 2);
const outputAssertion = getOutput(child).then(output => {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/linter/code-path-analysis/code-path.js
Expand Up @@ -50,7 +50,7 @@ function getOrderOfTraversing(codePath, options, callback) {
codePath.traverseSegments(options, (segment, controller) => {
retv.push(segment.id);
if (callback) {
callback(segment, controller); // eslint-disable-line callback-return
callback(segment, controller); // eslint-disable-line node/callback-return
}
});

Expand Down

0 comments on commit c030d80

Please sign in to comment.