-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Suggestion on slimming down dependencies #2151
Comments
How many will left if we remove |
I believe there are 8 overlapping with other dependencies, so it would drop from 63 down to 32. |
We can switch to |
That's a common fallacy. If you reinvent the code, you'll likely also reinvent the same bugs and unhandled edge-cases as a package initially had and later resolved. |
Don't even need function findUpSync(filename, dir) {
const path = join(dir, filename);
try {
accessSync(path);
return path;
} catch {}
const parent = dirname(dir);
if (parent === dir) {
return null;
} else {
return findUpSync(filename, parent);
}
} |
Any update on this? Would you be open to accept a PR that replaces the package with either of the aforementioned suggestions? |
@pndewit We are waiting for ESLint to support ESM. We'll probably switch to https://github.com/sindresorhus/find-up-simple |
Going to lock this for now until we can actually do something about it. |
eslint-plugin-unicorn
has 63 transitive dependencies: https://npm.anvaka.com/#/view/2d/eslint-plugin-unicorn39 of them come from
read-pkg-up
: https://npm.anvaka.com/#/view/2d/read-pkg-upThis functionality isn't super complicated and could probably be done without any dependencies. E.g. here's Vite's implementation, which resides in a single file and is more complicated than than the current implementation in some ways since it has caching built-in: https://github.com/vitejs/vite/blob/ff3ce312a572ec126808afb97b5d3f0a6f9adcb1/packages/vite/src/node/packages.ts#L117
As an example of why we could do this with less code,
read-pkg-up
pulls in some dependencies to normalize the package data, but this plugin uses the{normalize: false}
option, so that functionality would not be necessary.The text was updated successfully, but these errors were encountered: