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
Allow plugins to be passed in directly #10552
Comments
Hi, thanks for creating an issue. Unfortunately, the solution in #3458 (comment) isn't workable because the user needs to be able to configure the rules in a plugin, which requires the plugin to have a unique name . I'm in agreement with you that the current behavior is not ideal, but there is a significant amount of design work needed to create a better mechanism. No complete, workable solutions to this problem have been proposed so far. (You might also be interested in reading #10125 and the discussion towards the bottom of #3458. I've been working on a draft proposal to solve this issue here, although it's still far from complete.) |
Could an object be passed in? plugins: [
{
name: 'react',
plugin: require('eslint-plugin-react')
}
] |
The problem is that there could be two independent shareable configs which have dependencies on two separate plugins that both happen to be called Another way to state the problem is that ESLint's mechanism for naming rules in a config file ( Since the problem stems from a limitation of ESLint's naming scheme, I think the most straightforward solution to the problem would involve changing the way that rules are named in a config file. For example, one way to solve it would be to have hierarchical naming for rules, where rules would be configured with something that looks like a path. (In other words, a user could refer to a rule like Unfortunately, there are a lot of complications and edge cases that need to be handled (e.g. if configs extend each other with relative paths), and any new config format would need to be backwards-compatible with existing configs (at least in the vast majority of cases). This is why it's a difficult design problem, and why #3458 has been open for almost three years -- no one has proposed a complete design yet that solves the issue. |
Unfortunately, it looks like there wasn't enough interest from the team Thanks for contributing to ESLint and we appreciate your understanding. |
The version of ESLint you are using.
v5.0.1
The problem you want to solve.
I want sharable configs to be able to list their plugins as
dependencies
Your take on the correct solution to problem.
I think that sharable configs should not have to list their plugins as
peerDependencies
. This behavior does not make sense, because it makes it the responsibility of the user to install and update each of the plugins.Would you accept a PR that implements this behavior?
#3458 (comment)
The text was updated successfully, but these errors were encountered: