What It Does
The license check verifies that your project includes aLICENSE file, which is essential for open-source projects to define usage rights and legal protections.
Key Features:
- Checks for common LICENSE file names
- Detects license type (MIT, Apache, GPL, BSD, ISC)
- Warns if no license is found
- Passes with license details if found
Source:
/src/checks/license.tsWhat It Checks
The check searches for these file names (case-sensitive):/src/checks/license.ts:5-12
- MIT License →
/MIT License/i - Apache 2.0 →
/Apache License/i - GPL →
/GNU GENERAL PUBLIC LICENSE/i - ISC →
/ISC License/i - BSD →
/BSD/i
View Source Code
View Source Code
/src/checks/license.ts:14-58
Example Output
Why It Matters
Fun Fact: GitHub shows “No license” on repos without a LICENSE file, which can hurt adoption.
How to Fix
1. Choose a License
Visit choosealicense.com to find the right license for your project:MIT
PermissiveMost popular. Allows commercial use with minimal restrictions.
Apache 2.0
Permissive + PatentLike MIT but includes explicit patent grant.
GPL v3
CopyleftRequires derivatives to be open-source too.
2. Add the LICENSE File
3. Update Copyright Info
Most licenses require you to fill in:- Year: Current year (e.g., 2024)
- Copyright holder: Your name or organization
LICENSE (MIT example)
4. Verify
Supported License Types
The check automatically detects these common licenses:| License | Pattern Matched | Use Case |
|---|---|---|
| MIT | MIT License | Most permissive, widely used |
| Apache 2.0 | Apache License | Includes patent protection |
| GPL | GNU GENERAL PUBLIC LICENSE | Strong copyleft |
| ISC | ISC License | Similar to MIT, simpler wording |
| BSD | BSD | Permissive with attribution |
Adding License to package.json
While not checked by this tool, it’s good practice to also specify the license inpackage.json:
package.json
FAQ
What if I don't want to open-source my code?
What if I don't want to open-source my code?
Use a proprietary license or add:Or set in package.json:
LICENSE
Can I change the license later?
Can I change the license later?
Yes, but:
- Previous versions remain under the old license
- Contributors may need to agree to the change
- Use semantic versioning for major license changes (e.g., v2.0.0)
What about dual licensing?
What about dual licensing?
You can offer multiple licenses:
LICENSE
Do I need a license for private repos?
Do I need a license for private repos?
Not strictly required, but recommended:
- Clarifies usage rights for team members
- Simplifies future open-sourcing
- Helps if the repo becomes public later
Configuration
To disable this check:stackprobe.config.json
Next Steps
Engine Check
Verify Node.js version requirements
Environment Check
Validate .env file synchronization