@aiready/consistency 0.6.5 → 0.6.6
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/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-test.log +3 -3
- package/README.md +35 -5
- package/dist/chunk-WTBDNCEN.mjs +1352 -0
- package/dist/cli.js +29 -2
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +42 -397
- package/dist/index.mjs +6 -395
- package/package.json +1 -1
- package/src/analyzers/naming-ast.ts +4 -47
- package/src/analyzers/naming-constants.ts +107 -0
- package/src/analyzers/naming.ts +5 -95
- package/src/index.ts +2 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/consistency@0.6.
|
|
3
|
+
> @aiready/consistency@0.6.6 build /Users/pengcao/projects/aiready/packages/consistency
|
|
4
4
|
> tsup src/index.ts src/cli.ts --format cjs,esm --dts
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
[34mCLI[39m Target: es2020
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[32mESM[39m [1mdist/chunk-ON73WHHU.mjs [22m[32m34.85 KB[39m
|
|
13
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m14.04 KB[39m
|
|
14
12
|
[32mESM[39m [1mdist/cli.mjs [22m[32m8.55 KB[39m
|
|
15
|
-
[32mESM[39m
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[32mCJS[39m
|
|
13
|
+
[32mESM[39m [1mdist/chunk-WTBDNCEN.mjs [22m[32m36.20 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m9.73 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 17ms
|
|
16
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m45.90 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/index.js [22m[32m46.99 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 17ms
|
|
19
19
|
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in
|
|
20
|
+
DTS ⚡️ Build success in 977ms
|
|
21
21
|
DTS dist/cli.d.ts 20.00 B
|
|
22
|
-
DTS dist/index.d.ts 2.
|
|
22
|
+
DTS dist/index.d.ts 2.77 KB
|
|
23
23
|
DTS dist/cli.d.mts 20.00 B
|
|
24
|
-
DTS dist/index.d.mts 2.
|
|
24
|
+
DTS dist/index.d.mts 2.77 KB
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/consistency@0.6.
|
|
3
|
+
> @aiready/consistency@0.6.6 test /Users/pengcao/projects/aiready/packages/consistency
|
|
4
4
|
> vitest run
|
|
5
5
|
|
|
6
6
|
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
|
|
72
72
|
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
73
73
|
[2m Tests [22m [1m[32m18 passed[39m[22m[90m (18)[39m
|
|
74
|
-
[2m Start at [22m 01:
|
|
75
|
-
[2m Duration [22m
|
|
74
|
+
[2m Start at [22m 01:47:48
|
|
75
|
+
[2m Duration [22m 566ms[2m (transform 56ms, setup 0ms, collect 203ms, tests 128ms, environment 0ms, prepare 44ms)[22m
|
|
76
76
|
|
|
77
77
|
[?25h[?25h
|
package/README.md
CHANGED
|
@@ -6,20 +6,50 @@ Helps teams maintain consistent coding practices across their codebase, making i
|
|
|
6
6
|
|
|
7
7
|
## 🚀 Quick Start
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**Zero config, works out of the box:**
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
13
|
-
aiready
|
|
12
|
+
# Run without installation (recommended)
|
|
13
|
+
npx @aiready/consistency ./src
|
|
14
|
+
|
|
15
|
+
# Or use the unified CLI (includes all AIReady tools)
|
|
16
|
+
npx @aiready/cli scan ./src
|
|
17
|
+
|
|
18
|
+
# Or install globally for faster runs
|
|
19
|
+
npm install -g @aiready/consistency
|
|
20
|
+
aiready-consistency ./src
|
|
14
21
|
```
|
|
15
22
|
|
|
16
|
-
|
|
23
|
+
### 🎯 Input & Output
|
|
17
24
|
|
|
25
|
+
**Input:** Path to your source code directory
|
|
18
26
|
```bash
|
|
19
|
-
npm install -g @aiready/consistency
|
|
20
27
|
aiready-consistency ./src
|
|
21
28
|
```
|
|
22
29
|
|
|
30
|
+
**Output:** Terminal report + optional JSON file (saved to `.aiready/` directory)
|
|
31
|
+
```
|
|
32
|
+
📊 Consistency Analysis
|
|
33
|
+
━━━━━━━━━━━━━━━━━━━━━━━━
|
|
34
|
+
📁 Files analyzed: 47
|
|
35
|
+
⚠️ Issues found: 15 naming + 8 pattern issues
|
|
36
|
+
|
|
37
|
+
CRITICAL (2 files)
|
|
38
|
+
src/utils/helpers.ts:12 - poor-naming: x
|
|
39
|
+
src/api/users.ts:45 - convention-mix: user_name
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### ✨ Smart Defaults (Zero Config)
|
|
43
|
+
|
|
44
|
+
- ✅ **Auto-excludes** test files (`**/*.test.*`, `**/*.spec.*`, `**/__tests__/**`)
|
|
45
|
+
- ✅ **Auto-excludes** build outputs (`dist/`, `build/`, `.next/`)
|
|
46
|
+
- ✅ **Auto-excludes** dependencies (`node_modules/`)
|
|
47
|
+
- ✅ **Context-aware**: Skips common iterators (i, j, k) in loops
|
|
48
|
+
- ✅ **100+ built-in** acceptable abbreviations (env, api, url, ctx, etc.)
|
|
49
|
+
- ✅ **Smart detection**: Recognizes arrow functions, factory patterns, callbacks
|
|
50
|
+
|
|
51
|
+
> Override defaults with `--include-tests` or `--exclude <patterns>` as needed
|
|
52
|
+
|
|
23
53
|
## 🎯 What It Does
|
|
24
54
|
|
|
25
55
|
Inconsistent code patterns confuse AI models and reduce their effectiveness. This tool analyzes:
|