rev-dep 2.4.0 → 2.5.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.
Files changed (2) hide show
  1. package/Readme.md +29 -2
  2. package/package.json +4 -4
package/Readme.md CHANGED
@@ -303,6 +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
307
  - **circular imports** - check if there are circular imports
307
308
  - **orphan files** - check if there are orphan/dead files
308
309
  - **unused node modules** - check against unused node modules
@@ -339,8 +340,8 @@ Here's a comprehensive example showing all available properties:
339
340
 
340
341
  ```jsonc
341
342
  {
342
- "configVersion": "1.0",
343
- "$schema": "https://github.com/jayu/rev-dep/blob/module-boundaries/config-schema/1.0.schema.json?raw=true", // enables json autocompletion
343
+ "configVersion": "1.1",
344
+ "$schema": "https://github.com/jayu/rev-dep/blob/master/config-schema/1.1.schema.json?raw=true", // enables json autocompletion
344
345
  "conditionNames": ["import", "default"],
345
346
  "ignoreFiles": ["**/*.test.*"],
346
347
  "rules": [
@@ -361,6 +362,23 @@ Here's a comprehensive example showing all available properties:
361
362
  "deny": ["src/components/**/*"]
362
363
  }
363
364
  ],
365
+ "importConventions": [
366
+ {
367
+ "rule": "relative-internal-absolute-external",
368
+ "domains": [
369
+ {
370
+ "path": "src/features/auth",
371
+ "alias": "@auth",
372
+ "enabled": true
373
+ },
374
+ {
375
+ "path": "src/shared/ui",
376
+ "alias": "@ui-kit",
377
+ "enabled": false // checks disabled for this domain, but alias is still used for absolute imports from other domains
378
+ }
379
+ ]
380
+ }
381
+ ],
364
382
  "circularImportsDetection": {
365
383
  "enabled": true,
366
384
  "ignoreTypeImports": true
@@ -410,6 +428,7 @@ Each rule can contain the following properties:
410
428
  - **`orphanFilesDetection`** (optional): Orphan files detection configuration
411
429
  - **`unusedNodeModulesDetection`** (optional): Unused node modules detection configuration
412
430
  - **`missingNodeModulesDetection`** (optional): Missing node modules detection configuration
431
+ - **`importConventions`** (optional): Array of import convention rules
413
432
 
414
433
  #### Module Boundary Properties
415
434
  - **`name`** (required): Name of the boundary
@@ -417,6 +436,13 @@ Each rule can contain the following properties:
417
436
  - **`allow`** (optional): Array of allowed import patterns
418
437
  - **`deny`** (optional): Array of denied import patterns (overrides allow)
419
438
 
439
+ #### Import Convention Properties
440
+ - **`rule`** (required): Type of the rule, currently only `relative-internal-absolute-external`
441
+ - **`domains`** (required): Array of domain definitions. Can be a string (glob pattern) or an object with:
442
+ - **`path`** (required): Directory with the domain files
443
+ - **`alias`** (optional): Alias to be used for absolute imports of code from this domain
444
+ - **`enabled`** (optional): Set to `false` to skip checks for this domain (default: true)
445
+
420
446
  #### Detection Options Properties
421
447
 
422
448
  **CircularImportsDetection:**
@@ -614,6 +640,7 @@ rev-dep config run [flags]
614
640
  -c, --cwd string Working directory (default "$PWD")
615
641
  --follow-monorepo-packages Enable resolution of imports from monorepo workspace packages
616
642
  -h, --help help for run
643
+ --list-all-issues List all issues instead of limiting output
617
644
  --package-json string Path to package.json (default: ./package.json)
618
645
  --tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
619
646
  -v, --verbose Show warnings and verbose output
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rev-dep",
3
- "version": "2.4.0",
3
+ "version": "2.5.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.4.0",
21
- "@rev-dep/linux-x64": "2.4.0",
22
- "@rev-dep/win32-x64": "2.4.0"
20
+ "@rev-dep/darwin-arm64": "2.5.0",
21
+ "@rev-dep/linux-x64": "2.5.0",
22
+ "@rev-dep/win32-x64": "2.5.0"
23
23
  },
24
24
  "keywords": [
25
25
  "dependency-analysis",