This repository has been archived by the owner on Sep 28, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02c1e76
commit b6c3938
Showing
8 changed files
with
76 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ language: node_js | |
node_js: | ||
- 10 | ||
- 8 | ||
- 6 | ||
|
||
env: | ||
- WEBPACK_VERSION=4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,56 @@ | ||
function CLIEngine() { | ||
|
||
} | ||
function CLIEngine() {} | ||
|
||
CLIEngine.prototype.executeOnText = function() { | ||
return { | ||
results: [{ | ||
filePath: "", | ||
messages: [{ | ||
ruleId: "no-undef", | ||
severity: 2, | ||
message: "Fake error", | ||
line: 1, | ||
column: 11, | ||
nodeType: "Identifier", | ||
source: "var foo = stuff", | ||
}], | ||
errorCount: 2, | ||
warningCount: 0, | ||
fixableErrorCount: 0, | ||
fixableWarningCount: 0, | ||
source: "", | ||
}], | ||
results: [ | ||
{ | ||
filePath: "", | ||
messages: [ | ||
{ | ||
ruleId: "no-undef", | ||
severity: 2, | ||
message: "Fake error", | ||
line: 1, | ||
column: 11, | ||
nodeType: "Identifier", | ||
source: "var foo = stuff" | ||
} | ||
], | ||
errorCount: 2, | ||
warningCount: 0, | ||
fixableErrorCount: 0, | ||
fixableWarningCount: 0, | ||
source: "" | ||
} | ||
], | ||
errorCount: 2, | ||
warningCount: 0, | ||
fixableErrorCount: 0, | ||
fixableWarningCount: 0, | ||
fixableWarningCount: 0 | ||
}; | ||
}; | ||
|
||
CLIEngine.prototype.getFormatter = function(format) { | ||
const resolvedFormatName = format || "stylish"; | ||
|
||
if (typeof resolvedFormatName !== "string") { | ||
return null; | ||
} | ||
|
||
const eslintVersion = require("./package.json").version; | ||
const formatterPath = | ||
eslintVersion >= "6.0.0" | ||
? "./lib/cli-engine/formatters/stylish" | ||
: "./lib/formatters/stylish"; | ||
|
||
try { | ||
return require(formatterPath); | ||
} catch (ex) { | ||
ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`; | ||
throw ex; | ||
} | ||
} | ||
}; | ||
|
||
module.exports = { | ||
CLIEngine: CLIEngine, | ||
} | ||
CLIEngine: CLIEngine | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = function(result) { | ||
return JSON.stringify(result); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "eslint", | ||
"version": "5.16.0" | ||
} |