npm-package-json-lint icon indicating copy to clipboard operation
npm-package-json-lint copied to clipboard

Require name scope

Open piranna opened this issue 5 years ago • 7 comments

Add new rule to require name to have defined a scope. Ideally It should be a three state field (always, never or don't café).

piranna avatar Jan 26 '20 12:01 piranna

Maybe valid-name-scope would do the job with a regexp, in that case an example is needed un the docs.

piranna avatar Jan 26 '20 12:01 piranna

Thank you, @piranna! I take a look at this tomorrow and get back to you.

tclindner avatar Jan 29 '20 03:01 tclindner

Thank you! :-)

piranna avatar Jan 29 '20 08:01 piranna

@piranna do you think valid-values-name-scope will meet your needs? error covers always. off covers don't care. never is a gap.

btw - I've got time this weekend to get caught up on some tickets 🤓

tclindner avatar Jan 30 '20 03:01 tclindner

@piranna do you think valid-values-name-scope will meet your needs? error covers always. off covers don't care. never is a gap.

Didn't test it, but as I've told you in https://github.com/tclindner/npm-package-json-lint/issues/200#issuecomment-578499019, reviewing the code maybe it could work by defining a regular expression instead of a full scope, just only it would need to be tested :-)

By the way, why dows it requires the @ to be defined in the name scope? Is it for generity in case there's another registry don't use that pattern for scopes?

piranna avatar Jan 30 '20 09:01 piranna

@piranna - yes, re: @. Do you have any concerns with that approach?

I'm going to focus on adding plugin support next. Do you have an immediate use case for never right now? If so, I can focus on this first.

tclindner avatar Feb 18 '20 00:02 tclindner

@piranna - yes, re: @. Do you have any concerns with that approach?

Not at all, just only would be nice to have that in the documentation :-)

Do you have an immediate use case for never right now?

Not at all :-)

piranna avatar Feb 18 '20 09:02 piranna