rev-dep 2.5.0 → 2.6.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 +19 -3
- package/package.json +4 -4
package/Readme.md
CHANGED
|
@@ -303,7 +303,7 @@ Rev-dep provides a configuration system for orchestrating project checks. The co
|
|
|
303
303
|
Available checks are:
|
|
304
304
|
|
|
305
305
|
- **module boundaries** - check if imports respect module boundaries
|
|
306
|
-
- **import conventions** - enforce syntactic consistency for imports
|
|
306
|
+
- **import conventions** - enforce syntactic consistency for imports (includes autofix capability)
|
|
307
307
|
- **circular imports** - check if there are circular imports
|
|
308
308
|
- **orphan files** - check if there are orphan/dead files
|
|
309
309
|
- **unused node modules** - check against unused node modules
|
|
@@ -332,6 +332,19 @@ Run all configured checks:
|
|
|
332
332
|
rev-dep config run
|
|
333
333
|
```
|
|
334
334
|
|
|
335
|
+
List all detected issues:
|
|
336
|
+
```bash
|
|
337
|
+
# Lists all detected issues, by default lists first five issues for each check
|
|
338
|
+
rev-dep config run --list-all-issues
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Fix all fixable checks:
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
# Fix checks configured with autofix
|
|
345
|
+
rev-dep config run --fix
|
|
346
|
+
```
|
|
347
|
+
|
|
335
348
|
### Configuration Structure
|
|
336
349
|
|
|
337
350
|
The configuration file (`rev-dep.config.json(c)` or `.rev-dep.config.json(c)`) allows you to define multiple rules, each targeting different parts of your codebase with specific checks enabled.
|
|
@@ -340,8 +353,8 @@ Here's a comprehensive example showing all available properties:
|
|
|
340
353
|
|
|
341
354
|
```jsonc
|
|
342
355
|
{
|
|
343
|
-
"configVersion": "1.
|
|
344
|
-
"$schema": "https://github.com/jayu/rev-dep/blob/master/config-schema/1.
|
|
356
|
+
"configVersion": "1.2",
|
|
357
|
+
"$schema": "https://github.com/jayu/rev-dep/blob/master/config-schema/1.2.schema.json?raw=true", // enables json autocompletion
|
|
345
358
|
"conditionNames": ["import", "default"],
|
|
346
359
|
"ignoreFiles": ["**/*.test.*"],
|
|
347
360
|
"rules": [
|
|
@@ -365,6 +378,7 @@ Here's a comprehensive example showing all available properties:
|
|
|
365
378
|
"importConventions": [
|
|
366
379
|
{
|
|
367
380
|
"rule": "relative-internal-absolute-external",
|
|
381
|
+
"autofix": true,
|
|
368
382
|
"domains": [
|
|
369
383
|
{
|
|
370
384
|
"path": "src/features/auth",
|
|
@@ -438,6 +452,7 @@ Each rule can contain the following properties:
|
|
|
438
452
|
|
|
439
453
|
#### Import Convention Properties
|
|
440
454
|
- **`rule`** (required): Type of the rule, currently only `relative-internal-absolute-external`
|
|
455
|
+
- **`autofix`** (optional): Whether to automatically fix import convention violations (default: false)
|
|
441
456
|
- **`domains`** (required): Array of domain definitions. Can be a string (glob pattern) or an object with:
|
|
442
457
|
- **`path`** (required): Directory with the domain files
|
|
443
458
|
- **`alias`** (optional): Alias to be used for absolute imports of code from this domain
|
|
@@ -638,6 +653,7 @@ rev-dep config run [flags]
|
|
|
638
653
|
```
|
|
639
654
|
--condition-names strings List of conditions for package.json imports resolution (e.g. node, imports, default)
|
|
640
655
|
-c, --cwd string Working directory (default "$PWD")
|
|
656
|
+
--fix Automatically fix fixable issues
|
|
641
657
|
--follow-monorepo-packages Enable resolution of imports from monorepo workspace packages
|
|
642
658
|
-h, --help help for run
|
|
643
659
|
--list-all-issues List all issues instead of limiting output
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rev-dep",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Trace imports, detect unused code, clean dependencies — all with a super-fast CLI",
|
|
5
5
|
"bin": "bin.js",
|
|
6
6
|
"files": [
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"node": ">=18"
|
|
18
18
|
},
|
|
19
19
|
"optionalDependencies": {
|
|
20
|
-
"@rev-dep/darwin-arm64": "2.
|
|
21
|
-
"@rev-dep/linux-x64": "2.
|
|
22
|
-
"@rev-dep/win32-x64": "2.
|
|
20
|
+
"@rev-dep/darwin-arm64": "2.6.0",
|
|
21
|
+
"@rev-dep/linux-x64": "2.6.0",
|
|
22
|
+
"@rev-dep/win32-x64": "2.6.0"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
25
|
"dependency-analysis",
|