license-checker
license-checker copied to clipboard
feat: Implement --excludeScopes=@scope1;@scope2 option
This option makes the license-checker ignore all packages that are in one of the semicolon-separated list of scopes.
Any chance to get this merged? This is very useful.
Yes, we need this.
@davglass it would be really great to have this feature merged. Can you accept this merge please?
@davglass this would be very helpful. Are you able to look at PRs these days?
In the meantime I'm using the license checker with my own custom typescript script and wrote this little set of helper functions that does basically what I needed:
const formatDependencyList = (packages: Record<string, string>, orgPrefix: string) =>
Object.entries(packages)
.filter(([name]) => name.startsWith(orgPrefix))
.map(([name, version]) => `${name}@${version}`, []);
const extractOrgPackageExclusion = (prefix: string) =>
[
...formatDependencyList(packageJson.dependencies, prefix),
...formatDependencyList(packageJson.devDependencies, prefix),
].join(";");
const excludePackages = extractOrgPackageExclusion("@myorganization");
Then you simply pass in excludePackages
as one of the checker options and it does the trick. Pretty nifty!
The major benefit of this approach is that it's resilient to version number changes or any package addition and simply looks for a scope. 🎉