Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update: Allow eslint:all and eslint:recommended paths to be passed in #11

Merged
merged 4 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 0 additions & 39 deletions conf/category-list.json

This file was deleted.

31 changes: 0 additions & 31 deletions conf/default-cli-options.js

This file was deleted.

32 changes: 0 additions & 32 deletions conf/eslint-all.js

This file was deleted.

72 changes: 0 additions & 72 deletions conf/eslint-recommended.js

This file was deleted.

22 changes: 0 additions & 22 deletions conf/replacements.json

This file was deleted.

8 changes: 6 additions & 2 deletions lib/cascading-config-array-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,18 @@ class CascadingConfigArrayFactory {
useEslintrc = true,
builtInRules = new Map(),
loadRules,
resolver
resolver,
eslintRecommendedPath,
eslintAllPath
} = {}) {
const configArrayFactory = new ConfigArrayFactory({
additionalPluginPool,
cwd,
resolvePluginsRelativeTo,
builtInRules,
resolver
resolver,
eslintRecommendedPath,
eslintAllPath
});

internalSlotsMap.set(this, {
Expand Down
12 changes: 8 additions & 4 deletions lib/config-array-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ const debug = require("debug")("eslintrc:config-array-factory");
// Helpers
//------------------------------------------------------------------------------

const eslintRecommendedPath = path.resolve(__dirname, "../../eslint/conf/eslint-recommended.js");
const eslintAllPath = path.resolve(__dirname, "../../eslint/conf/eslint-all.js");
const configFilenames = [
".eslintrc.js",
".eslintrc.cjs",
Expand Down Expand Up @@ -414,7 +412,9 @@ class ConfigArrayFactory {
cwd = process.cwd(),
resolvePluginsRelativeTo,
builtInRules,
resolver = ModuleResolver
resolver = ModuleResolver,
eslintAllPath,
eslintRecommendedPath
} = {}) {
internalSlotsMap.set(this, {
additionalPluginPool,
Expand All @@ -423,7 +423,9 @@ class ConfigArrayFactory {
resolvePluginsRelativeTo &&
path.resolve(cwd, resolvePluginsRelativeTo),
builtInRules,
resolver
resolver,
eslintAllPath,
eslintRecommendedPath
});
}

Expand Down Expand Up @@ -781,6 +783,8 @@ class ConfigArrayFactory {
* @private
*/
_loadExtendedBuiltInConfig(extendName, ctx) {
const { eslintAllPath, eslintRecommendedPath } = internalSlotsMap.get(this);

if (extendName === "eslint:recommended") {
return this._loadConfigData({
...ctx,
Expand Down