Skip to content

Bug: ESLint class should not load plugins already defined in plugins #15079

Closed
@fisker

Description

Environment

Node version: v16.9.1
npm version: v7.9.0
Local ESLint version: v7.32.0
Global ESLint version: Not found
Operating System: win32 10.0.19043

What parser are you using?

Default (Espree)

What did you do?

import {ESLint} from 'eslint'

new ESLint({
	baseConfig: {
		extends: [
			'plugin:foo/preset',
		],
	},
	plugins: {
		foo: {
			configs: {
				preset: {}
			}
		}
	}
})

What did you expect to happen?

No errors.

What actually happened?

The config-array-factory is trying to load the plugin that I've set in the plugins.

node:internal/modules/cjs/loader:933
  const err = new Error(message);
              ^

Error: Failed to load plugin 'foo' declared in 'BaseConfig': Cannot find module 'eslint-plugin-foo'
Require stack:
- CWD\__placeholder__.js
Referenced from: BaseConfig
	// ...

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

N/A

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyrepro:yesIssues with a reproducible example

    Type

    No type

    Projects

    • Status

      Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions