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

[Feature Request] Custom Rule Integration #208

Closed
StephenEsser opened this issue Feb 7, 2020 · 2 comments
Closed

[Feature Request] Custom Rule Integration #208

StephenEsser opened this issue Feb 7, 2020 · 2 comments

Comments

@StephenEsser
Copy link

Summary

I stumbled onto this project after having a similar idea and doing a quick search on the NPM registry. If this functionality already exists please let me know. I didn't see any information on the documentation site regarding custom rules.

There are use cases where certain projects may want to implement custom rule integration. A plugin system similar to adding rules to eslint or stylelint.

Examples of custom rules:

  • Disallow specific packages from being listed in dependencies, devDependencies, or peerDependencies.
  • Require certain dependencies be listed in certain sections. IE: Package A can never be listed in dependencies. It should always be a devDependency.
  • Mutually exclusive dependencies. IE: If dependency A is listed dependency B cannot be.
  • Require certain custom keys be populated in the package.json
  • Versioning restraints. Dependency A should never be hard locked. "1.0.0" vs "^1.0.0"
@tclindner
Copy link
Owner

Hey @StephenEsser, thanks for using this project! We currently don't have that feature, but it is one of two major features on the roadmap (auto-fixing).

I believe the core rules will allow you to achieve the first one. "Disallow specific packages from being listed in dependencies, devDependencies, or peerDependencies."

no-restricted-dependencies, no-restricted-pre-release-dependencies, no-restricted-devdependencies, and no-restricted-pre-release-devdependencies. I'm happy to add additional variants if you would find them useful.

The other rules look like nice core rules too. What are your thoughts on spinning them off as rule requests?

  • Require certain dependencies be listed in certain sections. IE: Package A can never be listed in dependencies. It should always be a devDependency.
  • Mutually exclusive dependencies. IE: If dependency A is listed dependency B cannot be.
  • Require certain custom keys be populated in the package.json
  • Versioning restraints. Dependency A should never be hard locked. "1.0.0" vs "^1.0.0"

Regarding custom rule support, would you be okay consolidating this issue with #108?

@StephenEsser
Copy link
Author

Hey @tclindner, I think adding to the list of core rules is a good idea. Feel free to consolidate the custom rule support issues together. I should have taken a closer look at the issue list.

The projects I work on would greatly benefit from custom rule integration. I'll check in from time to time to see how things are going with the project. Keep up the good work!

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

No branches or pull requests

2 participants