aislop 0.2.0 → 0.3.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/README.md +88 -38
- package/dist/cli.js +797 -187
- package/dist/{engine-info-DpU0WTTj.js → engine-info-CXT2Q_Jy.js} +1 -1
- package/dist/{expo-doctor-CGXGLgMJ.js → expo-doctor-Cm5892Y8.js} +76 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2921 -2453
- package/dist/{json-UG8l_sLC.js → json-C52xnH_4.js} +1 -1
- package/package.json +1 -1
- package/dist/expo-doctor-vDz4kh9-.js +0 -127
- package/dist/subprocess-99puEEGl.js +0 -59
package/README.md
CHANGED
|
@@ -10,25 +10,88 @@
|
|
|
10
10
|
|
|
11
11
|
`aislop` is a unified code-quality CLI that catches the lazy patterns AI coding tools leave behind. One command, one score out of 100.
|
|
12
12
|
|
|
13
|
+
`aislop` helps teams review AI-assisted code faster by combining formatting, linting, maintainability, AI-pattern detection, architecture checks, and security checks into a single report.
|
|
14
|
+
|
|
15
|
+
## See it in action
|
|
16
|
+
|
|
17
|
+
### Scan
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
### Fix
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
## Quick start
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# scan your project
|
|
29
|
+
npx aislop scan
|
|
30
|
+
|
|
31
|
+
# auto-fix what can be fixed safely
|
|
32
|
+
npx aislop fix
|
|
33
|
+
|
|
34
|
+
# CI mode (JSON output + quality gate)
|
|
35
|
+
npx aislop ci
|
|
13
36
|
```
|
|
14
|
-
$ npx aislop scan
|
|
15
37
|
|
|
16
|
-
|
|
38
|
+
Sample output:
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
aislop scan v0.2.1
|
|
17
42
|
|
|
18
43
|
✓ Project my-app (typescript)
|
|
19
44
|
Source files: 142
|
|
20
45
|
|
|
21
|
-
✓ Formatting:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
✓ Security:
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
✓ Formatting: done (0 issues)
|
|
47
|
+
! Linting: done (2 warnings)
|
|
48
|
+
! Code Quality: done (1 warning)
|
|
49
|
+
✓ Maintainability: done (0 issues)
|
|
50
|
+
✓ Security: done (0 issues)
|
|
51
|
+
|
|
52
|
+
------------------------------------------------------------
|
|
53
|
+
Summary
|
|
54
|
+
Score: 89/100 (Healthy)
|
|
55
|
+
Issues: 0 errors, 3 warnings
|
|
56
|
+
Auto-fixable: 2
|
|
57
|
+
Files: 142
|
|
58
|
+
Time: 2.3s
|
|
59
|
+
------------------------------------------------------------
|
|
28
60
|
```
|
|
29
61
|
|
|
30
62
|
---
|
|
31
63
|
|
|
64
|
+
## Why aislop
|
|
65
|
+
|
|
66
|
+
AI-generated changes often pass review because problems are spread across many files and many categories.
|
|
67
|
+
`aislop` gives you one view and one score.
|
|
68
|
+
|
|
69
|
+
- **One command, full picture**: formatting + lint + maintainability + AI slop + security (+ architecture)
|
|
70
|
+
- **Score-based quality gate**: use a single 0-100 score in CI and PR checks
|
|
71
|
+
- **AI-slop-first scoring**: defaults weight AI-pattern findings more than generic style noise
|
|
72
|
+
- **Auto-fix support**: remove unused imports, apply lint suggestions, and format in one pass
|
|
73
|
+
- **Duplication visibility**: flag repeated blocks and encourage extraction into shared modules
|
|
74
|
+
- **Software engineering best practices**: enforce function/file size limits, nesting limits, dead code cleanup, and safer patterns
|
|
75
|
+
- **Works across stacks**: TypeScript, JavaScript, Python, Go, Rust, Ruby, PHP, Expo/React Native
|
|
76
|
+
- **Zero-config start**: run `npx aislop scan` and get useful output immediately
|
|
77
|
+
|
|
78
|
+
## What it catches
|
|
79
|
+
|
|
80
|
+
Six engines run in parallel: **Formatting**, **Linting**, **Code Quality**, **AI Slop Detection**, **Security**, and **Architecture** (opt-in).
|
|
81
|
+
|
|
82
|
+
| Engine | Examples |
|
|
83
|
+
|---|---|
|
|
84
|
+
| Formatting | Biome, ruff, gofmt, cargo fmt, rubocop, php-cs-fixer |
|
|
85
|
+
| Linting | oxlint, ruff, golangci-lint, clippy, expo-doctor |
|
|
86
|
+
| Code Quality | Function/file size limits, deep nesting, duplication, dead code, unused dependencies (knip) |
|
|
87
|
+
| AI Slop | Trivial comments, swallowed exceptions, unused imports, console leftovers, type assertion abuse, TODO stubs |
|
|
88
|
+
| Security | Hardcoded secrets, eval, innerHTML, SQL/shell injection, dependency audits |
|
|
89
|
+
| Architecture | Custom import bans, layering rules, required patterns |
|
|
90
|
+
|
|
91
|
+
See the full [rules reference](docs/rules.md).
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
32
95
|
## Installation
|
|
33
96
|
|
|
34
97
|
```bash
|
|
@@ -67,7 +130,8 @@ aislop scan --json # output JSON
|
|
|
67
130
|
### Fix issues automatically
|
|
68
131
|
|
|
69
132
|
```bash
|
|
70
|
-
aislop fix # auto-fix formatting
|
|
133
|
+
aislop fix # auto-fix unused imports, formatting, and lint fixes
|
|
134
|
+
aislop fix --force # aggressive mode: dependency audit + Expo alignment
|
|
71
135
|
```
|
|
72
136
|
|
|
73
137
|
### Use in CI pipelines
|
|
@@ -76,6 +140,19 @@ aislop fix # auto-fix formatting + lint issues
|
|
|
76
140
|
aislop ci # JSON output, exits 1 if score < threshold
|
|
77
141
|
```
|
|
78
142
|
|
|
143
|
+
### Common workflow
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# before commit
|
|
147
|
+
aislop scan --staged
|
|
148
|
+
|
|
149
|
+
# during local cleanup
|
|
150
|
+
aislop fix
|
|
151
|
+
|
|
152
|
+
# full project check
|
|
153
|
+
aislop scan
|
|
154
|
+
```
|
|
155
|
+
|
|
79
156
|
### Other commands
|
|
80
157
|
|
|
81
158
|
```bash
|
|
@@ -103,6 +180,7 @@ npx aislop scan --staged
|
|
|
103
180
|
- uses: actions/setup-node@v6
|
|
104
181
|
with:
|
|
105
182
|
node-version: 20
|
|
183
|
+
- run: npm ci
|
|
106
184
|
- run: npx aislop ci
|
|
107
185
|
```
|
|
108
186
|
|
|
@@ -119,34 +197,6 @@ ci:
|
|
|
119
197
|
|
|
120
198
|
---
|
|
121
199
|
|
|
122
|
-
## Why aislop?
|
|
123
|
-
|
|
124
|
-
AI-generated code passes review because issues are spread across dozens of files. No single linter catches all of them. `aislop` does:
|
|
125
|
-
|
|
126
|
-
- **AI-specific pattern detection** — trivial comments, thin wrappers, generic names, swallowed exceptions, `as any` casts
|
|
127
|
-
- **Multi-language** — TypeScript, JavaScript, Python, Go, Rust, Ruby, PHP, Expo/React Native
|
|
128
|
-
- **Single score** — one number to gate PRs, track in CI, and trend over time
|
|
129
|
-
- **Zero config** — run `npx aislop scan` and get results immediately
|
|
130
|
-
- **Framework-aware** — auto-detects Next.js, React, Expo, Vite, Remix, Django, Flask, FastAPI
|
|
131
|
-
- **Batteries included** — ships with oxlint, biome, knip; downloads ruff and golangci-lint on install
|
|
132
|
-
|
|
133
|
-
## What it catches
|
|
134
|
-
|
|
135
|
-
Six engines run in parallel: **Formatting**, **Linting**, **Code Quality**, **AI Slop Detection**, **Security**, and **Architecture** (opt-in).
|
|
136
|
-
|
|
137
|
-
| Engine | Examples |
|
|
138
|
-
|---|---|
|
|
139
|
-
| Formatting | Biome, ruff, gofmt, cargo fmt, rubocop, php-cs-fixer |
|
|
140
|
-
| Linting | oxlint, ruff, golangci-lint, clippy, expo-doctor |
|
|
141
|
-
| Code Quality | Function/file size limits, deep nesting, duplication, dead code, unused dependencies (knip) |
|
|
142
|
-
| AI Slop | Trivial comments, swallowed exceptions, unused imports, console leftovers, type assertion abuse, TODO stubs |
|
|
143
|
-
| Security | Hardcoded secrets, eval, innerHTML, SQL/shell injection, dependency audits |
|
|
144
|
-
| Architecture | Custom import bans, layering rules, required patterns |
|
|
145
|
-
|
|
146
|
-
See the full [rules reference](docs/rules.md) for all 30+ built-in rules.
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
200
|
## Documentation
|
|
151
201
|
|
|
152
202
|
| Topic | Link |
|