Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: add the "valid-license" rule #786
base: main
Are you sure you want to change the base?
feat: add the "valid-license" rule #786
Changes from all commits
7019c1b
47ccb5a
84289f4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Feature] If this rule is to be enabled in the recommended config -which would be great!- then we're going to need it to not be prescriptive on which of the "valid" license(s) are allowed. Any "valid" license should be allowed unless the user has customized the rule. "Valid" here could mean one of several things, depending on how strict the user wants to be. In increasing order of strictness...
spdx-license-ids
) or SPDX license expression syntax referring to SPDX license IDsI think any of 2 🍌, 3 🌸, 4 🐉, and 5 🥚 would be fine as followup issues (with the caveat that 3 🌸 and 4 🐉 depend on 2 🍌). Most users would be satisfied with just 1 🍏 checking that it's a string.
But, the options right now don't allow 1 🍏. They require 5 🥚, passing in a specific list of IDs. Could you please make the 5 🥚 specific license ID checking optional? As in, if the user doesn't provide any licenses, the rule should only check 1 🍏 that it's a valid string.
Reference: https://docs.npmjs.com/cli/v11/configuring-npm/package-json#license
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Docs] Nit: IMO these comments aren't worth keeping up-to-date. ESLint rule tests tend to get very nuanced and tricky over time. I've seen suits with many dozens or even hundreds of tests that exercise various edge cases on themes. Personally I'd remove this:
If you really want to include a name per test, the proper way would be with a
name
property per https://eslint.org/docs/latest/integrate/nodejs-api#ruletester.Not a blocker, just a preference. 🙂