prodlint 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +114 -0
- package/dist/cli.js +1173 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +1034 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 prodlint contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# prodlint
|
|
2
|
+
|
|
3
|
+
[](https://github.com/prodlint/prodlint/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/prodlint)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
Scan AI-generated projects for production readiness issues.
|
|
8
|
+
|
|
9
|
+
prodlint is a deterministic, zero-config CLI that checks your codebase for common problems in AI-generated and vibe-coded projects. No LLM required — just pattern matching against known anti-patterns.
|
|
10
|
+
|
|
11
|
+
## Why?
|
|
12
|
+
|
|
13
|
+
AI code generators (Cursor, Copilot, v0, Bolt) ship code that works in demos but breaks in production. Hardcoded secrets, hallucinated packages, missing auth checks, XSS vectors — these issues slip through because they're syntactically valid and pass type-checks.
|
|
14
|
+
|
|
15
|
+
prodlint catches what TypeScript and ESLint miss: **production readiness gaps**.
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx prodlint
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx prodlint # Scan current directory
|
|
27
|
+
npx prodlint ./my-app # Scan specific path
|
|
28
|
+
npx prodlint --json # JSON output
|
|
29
|
+
npx prodlint --ignore "*.test.ts" # Ignore patterns
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## What It Checks
|
|
33
|
+
|
|
34
|
+
prodlint runs **11 rules** across 4 categories:
|
|
35
|
+
|
|
36
|
+
### Security
|
|
37
|
+
| Rule | Severity | What it detects |
|
|
38
|
+
|------|----------|----------------|
|
|
39
|
+
| `secrets` | critical | Hardcoded API keys (Stripe, AWS, Supabase, OpenAI, GitHub, SendGrid) |
|
|
40
|
+
| `env-exposure` | critical | Server env vars in client components, `.env` not in `.gitignore` |
|
|
41
|
+
| `auth-checks` | critical | API routes without authentication (middleware-aware) |
|
|
42
|
+
| `unsafe-html` | critical | `dangerouslySetInnerHTML`, direct `innerHTML` assignment |
|
|
43
|
+
| `sql-injection` | critical | SQL queries built with template literals or string concatenation |
|
|
44
|
+
| `input-validation` | warning | API routes accessing request body without validation |
|
|
45
|
+
| `rate-limiting` | warning | API routes without rate limiting |
|
|
46
|
+
| `cors-config` | warning | `Access-Control-Allow-Origin: *`, `cors()` with no config |
|
|
47
|
+
|
|
48
|
+
### Reliability
|
|
49
|
+
| Rule | Severity | What it detects |
|
|
50
|
+
|------|----------|----------------|
|
|
51
|
+
| `hallucinated-imports` | critical | Imports of packages not in `package.json` and not Node built-ins |
|
|
52
|
+
| `error-handling` | warning | API routes without try/catch, empty catch blocks |
|
|
53
|
+
|
|
54
|
+
### AI Quality
|
|
55
|
+
| Rule | Severity | What it detects |
|
|
56
|
+
|------|----------|----------------|
|
|
57
|
+
| `ai-smells` | mixed | TODOs, placeholder functions, console.log spam, excessive `any`, commented-out code |
|
|
58
|
+
|
|
59
|
+
## Scoring
|
|
60
|
+
|
|
61
|
+
Each category starts at 100 points. Deductions:
|
|
62
|
+
|
|
63
|
+
- **Critical**: -10 points
|
|
64
|
+
- **Warning**: -3 points
|
|
65
|
+
- **Info**: -1 point
|
|
66
|
+
|
|
67
|
+
Overall score = average of all 4 categories (security, reliability, performance, ai-quality).
|
|
68
|
+
|
|
69
|
+
Exit code is `1` if any critical findings exist, `0` otherwise.
|
|
70
|
+
|
|
71
|
+
## Smart Detection
|
|
72
|
+
|
|
73
|
+
prodlint avoids common false positives:
|
|
74
|
+
|
|
75
|
+
- **Block comment awareness** — patterns inside `/* */` comments are ignored
|
|
76
|
+
- **Middleware auth detection** — if your project uses Clerk/NextAuth/Supabase middleware, auth findings are downgraded to info
|
|
77
|
+
- **TypeScript path aliases** — `@/`, `~/`, and custom tsconfig paths aren't flagged as hallucinated imports
|
|
78
|
+
- **Route exemptions** — auth, webhook, health, and cron routes are exempt from auth/rate-limit checks
|
|
79
|
+
|
|
80
|
+
## Suppressing Findings
|
|
81
|
+
|
|
82
|
+
Suppress a single line:
|
|
83
|
+
```ts
|
|
84
|
+
// prodlint-disable-next-line secrets
|
|
85
|
+
const key = "sk_test_example_for_documentation"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Suppress multiple rules:
|
|
89
|
+
```ts
|
|
90
|
+
// prodlint-disable-next-line secrets, auth-checks
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Suppress an entire file (place at top):
|
|
94
|
+
```ts
|
|
95
|
+
// prodlint-disable secrets
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Programmatic API
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { scan } from 'prodlint'
|
|
102
|
+
|
|
103
|
+
const result = await scan({ path: './my-project' })
|
|
104
|
+
console.log(result.overallScore) // 0-100
|
|
105
|
+
console.log(result.findings) // Finding[]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Contributing
|
|
109
|
+
|
|
110
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and how to add new rules.
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT
|