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

Fix ESLint plugin load error #589

Closed
wants to merge 4 commits into from
Closed

Conversation

fisker
Copy link
Contributor

@fisker fisker commented Aug 8, 2021

Fixes #546

I think the only problem is, user can override plugins before, but now can't, ESLint will always load the plugins xo installed.

I saw a comment from #546, but I'm not sure what the problem is.

@fisker fisker marked this pull request as ready for review August 9, 2021 00:28
@@ -289,6 +290,9 @@ const buildESLintConfig = options => config => {
};
}

// Resolve plugins from XO root directory
config.resolvePluginsRelativeTo = MODULE_DIRECTORY;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this make it impossible for users to add ESLint plugins themselves?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested in eslint-plugin-unicorn, it can load eslint-plugin-eslint-plugin.

@sindresorhus
Copy link
Member

I saw a comment from #546, but I'm not sure what the problem is.

@Richienb Would you be able to comment on this? And review the PR.

@Richienb
Copy link
Contributor

Does this also fix #555?

@fisker
Copy link
Contributor Author

fisker commented Aug 26, 2021

Does this also fix #555?

I'm not sure, but I don't think this will fix that, the typescript can be installed in a location that @typescript-eslint/parser can't find it. The resolvePluginsRelativeTo won't affect resolve logic in @typescript-eslint/parser.

@fisker
Copy link
Contributor Author

fisker commented Aug 26, 2021

I feel this PR is not a good solution now, I think this may break monorepo. I'm going to convert it to draft.

@fisker fisker marked this pull request as draft August 26, 2021 05:48
@fisker
Copy link
Contributor Author

fisker commented Sep 18, 2021

I thought I found a better solution, but it didn't work.

I've opened an issue in ESLint, if it get fixed, maybe we can pass plugins that xo installed, so ESLint won't try to load them.

@fregante
Copy link
Member

fregante commented Aug 6, 2022

The issue you opened upstream has been fixed 🚀

@fisker
Copy link
Contributor Author

fisker commented Aug 6, 2022

In that case this can be fixed by load plugins ourselves. I don't have time to work on this. It will be great if someone want give this a shot. BTW, ESLint have a new FlatESLint haven't play with it yet.

@fregante
Copy link
Member

I'm going to close this since it's old. The flat config will eventually fix this issue anyway:

@fregante fregante closed this Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: Failed to load plugin '*' declared in 'BaseConfig...
4 participants