Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Put type-only packages in devDependencies
Place type packages according to build and published declaration needs; they are not universally dev-only.
Bad example
| 1 | "dependencies": { |
| 2 | "@types/lodash": "^4.14.198" |
| 3 | } |
Explanation (EN)
An application runtime-only installation need not carry unused development type packages.
Objašnjenje (HR)
Good example
| 1 | "devDependencies": { |
| 2 | "@types/lodash": "^4.14.198" |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
For an application, keep build/test-only type packages in devDependencies when the build stage installs them and runtime output does not need them.
Exceptions / Tradeoffs (EN)
Published libraries whose emitted declarations reference another type package must make those declarations resolvable for consumers, often through dependencies. A production image building source may also require build dependencies.