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

Better solution for configs & plugins in dependencies #646

Closed
jonahsnider opened this issue Jan 9, 2022 · 6 comments
Closed

Better solution for configs & plugins in dependencies #646

jonahsnider opened this issue Jan 9, 2022 · 6 comments

Comments

@jonahsnider
Copy link
Contributor

It's been nearly 6.5 years since eslint/eslint#3458 was opened and very little progress has been made on their side.
What can we do to improve the XO user experience while we wait for a fix from ESLint?

The best solution seems to be using Microsoft's @rushstack/eslint-patch to patch ESLint's module resolver.

Another solution which worked for TypeScript + XO users is using bundledDependencies in package.json.

Related:

Most issues are for XO + Prettier.

@sindresorhus
Copy link
Member

It's been nearly 6.5 years since eslint/eslint#3458 was opened and very little progress has been made on their side.

I wouldn't say that. They're working on a new config format which will enable this: eslint/eslint#13481 It's likely it will happen this year: eslint/eslint#15383 (comment)

@sindresorhus
Copy link
Member

The best solution seems to be using Microsoft's @rushstack/eslint-patch to patch ESLint's module resolver.

This patches ESLint and could break at any time. It might also break certain cases. I don't think I want to risk that.

Another solution which worked for TypeScript + XO users is using bundledDependencies in package.json.

I'm unlikely to bundle dependencies in XO.

@jonahsnider
Copy link
Contributor Author

This patches ESLint and could break at any time. It might also break certain cases. I don't think I want to risk that.

Could enabling the patch be done via a CLI flag so it's explicitly opt-in?

@sindresorhus
Copy link
Member

It technically could, but I'm still the one that has to deal with any issues that occur with the CLI flag specified. I would personally prefer to just wait it out.

@mmkal
Copy link
Contributor

mmkal commented Jan 14, 2022

I wrote a wrapper plugin that requires no patching, plays by the rules of eslint and nodejs, and allows plugins and configs to act pretty much like normal dependencies. As a bonus, it lets you locally define rules for your project that don’t need to be published in a separate package. It’s also pretty simple, just a single file with no dependencies itself. (There is a trade off - it prefixes the rules it wraps, and requires using a JavaScript, not json/yaml, config file)

We’ve been using it at my work for a while and it works well enough, while we wait for the proper solution.

@fregante
Copy link
Member

fregante commented Feb 20, 2023

The flat config has landed in ESLint. This is the way to go now:

@fregante fregante closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants