Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Feb 19, 2020
1 parent 935de34 commit b109c8b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/eslint/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function processOptions({

/**
* Create rulesMeta object.
* @param {Map<string, Rule>} rules a map of rules from which to generate the object.
* @param {Map<string,Rule>} rules a map of rules from which to generate the object.
* @returns {Object} metadata for all enabled rules.
*/
function createRulesMeta(rules) {
Expand Down Expand Up @@ -290,7 +290,7 @@ class ESLint {
if (typeof plugin === "object" && plugin !== null) {
this._cliEngine.addPlugin(plugin.id, plugin.definition);
} else if (typeof plugin !== "string") {
throw new Error("Invalid plugin. Plugins must be specified as a string (e.g., eslint-plugin-example) or as an object (e.g., { id: string; definition: Object }).");
throw new Error("Invalid plugin. Plugins must be specified as a string (e.g., \"eslint-plugin-example\") or as an object (e.g., { id: string; definition: Object }).");
}
}
}
Expand Down Expand Up @@ -338,8 +338,6 @@ class ESLint {
* @returns {Promise<LintResult[]>} The results of linting the file patterns given.
*/
async lintFiles(patterns) {

// TODO: update caching strategy.
return processCLIEngineLintReport(this._cliEngine.executeOnFiles(patterns));
}

Expand All @@ -362,7 +360,7 @@ class ESLint {
* custom formatter.
* @returns {Promise<Formatter|null>} A promise resolving to the formatter object or null if not found.
*/
async getFormatter(name) {
async loadFormatter(name) {
const formatter = this._cliEngine.getFormatter(name);

if (formatter === null) {
Expand Down Expand Up @@ -401,7 +399,7 @@ class ESLint {
* @param {string} filePath The path of the file to retrieve a config object for.
* @returns {Promise<ConfigData>} A configuration object for the file.
*/
async getConfigForFile(filePath) {
async calculateConfigForFile(filePath) {
return this._cliEngine.getConfigForFile(filePath);
}

Expand Down

0 comments on commit b109c8b

Please sign in to comment.