Skip to content

Commit 8c0a2cc

Browse files
DingoEatingFuzzscagood
andauthoredSep 26, 2024··
docs: Explain the transitive dependency case for no-extraneous-* (#347)
Co-authored-by: Sebastian Good <2230835+scagood@users.noreply.github.com>
1 parent 85b7945 commit 8c0a2cc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎docs/rules/no-extraneous-import.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
<!-- end auto-generated rule header -->
66

7-
If an `import` declaration's source is extraneous (it's not written in `package.json`), the program works in local, but will not work after dependencies are re-installed. It will cause troubles to your team/contributors.
7+
If an `import` declaration's source is extraneous (it's not listed in your `package.json`), the program may work locally but can break after dependencies are re-installed. This can cause issues for your team/contributors. If a declaration source is extraneous yet consistently works for you and your team, it might be a transitive dependency (a dependency of another dependency). Transitive dependencies should still be added as an explicit dependency in your `package.json` to avoid the risk of a dependency potentially changing or removing the transitive dependency.
8+
9+
Additionally, the transitive dependency could be a dev dependency, meaning your code could work in development but not in production.
10+
811
This rule disallows `import` declarations of extraneous modules.
912

1013
## 📖 Rule Details

‎docs/rules/no-extraneous-require.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
<!-- end auto-generated rule header -->
66

7-
If a `require()`'s target is extraneous (it's not written in `package.json`), the program works in local, but will not work after dependencies are re-installed. It will cause troubles to your team/contributors.
7+
If a `require()`'s target is extraneous (it's not listed in your `package.json`), the program may work locally but can break after dependencies are re-installed. This can cause issues for your team/contributors. If a declaration source is extraneous yet consistently works for you and your team, it might be a transitive dependency (a dependency of another dependency). Transitive dependencies should still be added as an explicit dependency in your `package.json` to avoid the risk of a dependency potentially changing or removing the transitive dependency.
8+
9+
Additionally, the transitive dependency could be a dev dependency, meaning your code could work in development but not in production.
10+
811
This rule disallows `require()` of extraneous modules.
912

1013
## 📖 Rule Details

0 commit comments

Comments
 (0)
Please sign in to comment.