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

improvement: possibility to use glob #74

Closed
dnepro opened this issue Mar 2, 2018 · 5 comments
Closed

improvement: possibility to use glob #74

dnepro opened this issue Mar 2, 2018 · 5 comments
Assignees
Labels
enhancement 👑 New feature or request
Milestone

Comments

@dnepro
Copy link

dnepro commented Mar 2, 2018

Hello everybody :)
first of thanks for your work, i just found it and its awesome!

I want to ask if there is a possibility to add a glob pattern option, because i got a lerna-monorepo, like babel does.

Or for the beginning maybe the possibility to add multiple -f {path}-arguments to a single command.

But of course globbing would make it a lot more useful in scenarios like:

  • scan whole project repo
  • lerna setup (my scenario)
  • usage of lint-staged (also my scenario)
  • usage with CI tools
@dnepro dnepro changed the title Improvement: possibility to use glob improvement: possibility to use glob Mar 2, 2018
@tclindner
Copy link
Owner

Hi @dnepro, thank you for using the project! I really like your suggestion 👍 I'll try to get to this soon.

@tclindner tclindner added the enhancement 👑 New feature or request label Mar 4, 2018
@tclindner tclindner added this to the v3.0.0 milestone Apr 16, 2018
@ntwb
Copy link
Contributor

ntwb commented Apr 29, 2018

I've just started creating a npm-package-json-lint-config myself and arrived here as I was trying to find how I'd support the ~20 packages in my Lerna repo myself.

Looks like writing ~21 npm run pjl-cli <glob> commands in the root package.json is the only available option which for obvious reasons is not ideal.

I'll look forward to being able not do that 😃

@ntwb
Copy link
Contributor

ntwb commented Apr 29, 2018

As an interim workaround, a single script leveraging the Lerna exec command:

npx lerna exec 'npx -p npm-package-json-lint -p npm-package-json-lint-config-default -c "pjl-cli -c ../../.npmpackagejsonlintrc"'

The above uses a .npmpackagejsonlintrc in the root of the Lerna repo extends the npm-package-json-lint-config-default config with a handful of rule tweaks

tclindner added a commit that referenced this issue Apr 29, 2018
Summary of changes:
- Create new JS api for easy programmatic use
- Update cli to use meow instead of commander. Abstract logic in to CLI Engine #76
- Add support for glob based package.json file detection.  #74
- Add support for recursive config file detection #75
-
@tclindner tclindner mentioned this issue Apr 29, 2018
Merged
@tclindner
Copy link
Owner

Hi @dnepro and @ntwb - a pre-release of v3.0.0 has been published to npm. The documentation is still a little sparse (that will change by the stable release). You can try it out by installing npm-package-json-lint@beta. Here is a link to the start of the migration guide. The way you specify your globs should be pretty flexible. You don't have to specifically say you are looking for package.json files (It doesn't hurt anything if you do). The globbing process also automatically ignores all package.json files found in subdirectories of node_modules directories. As as result, you can simply add a . to start the scan at the current working directory if you want.

Let me know what you think!

@tclindner tclindner self-assigned this May 10, 2018
@tclindner
Copy link
Owner

v3.0.0 has been released! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 👑 New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants