Calcite typings are using types from the Sortablejs library, for example in this file:
// node_modules/@esri/calcite-components/dist/types/components/value-list/value-list.d.ts
import Sortable from "sortablejs";
...
Yet, @types/sortablejs is not included as a "dependency" (it's as devDependency instead, and in the root monorepo package.json rather than calcite-components's package.json)
This cause TypeScript errors for consumer of calcite package when they try to typecheck their app if they have "skipLibCheck":false in their tsconfig.json (otherwise, the type would get silently resolved to any - not ideal)
> npx tsc --noEmit
../../../node_modules/@esri/calcite-components/dist/types/components/value-list/value-list.d.ts:2:22 - error TS7016: Could not find a declaration file for module 'sortablejs'. '/Users/mak13180/site/esri/arcgis-web-components/node_modules/sortablejs/Sortable.min.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/sortablejs` if it exists or add a new declaration (.d.ts) file containing `declare module 'sortablejs';`
2 import Sortable from "sortablejs";
~~~~~~~~~~~~
../../../node_modules/@esri/calcite-components/dist/types/utils/sortableComponent.d.ts:1:22 - error TS7016: Could not find a declaration file for module 'sortablejs'. '/Users/mak13180/site/esri/arcgis-web-components/node_modules/sortablejs/Sortable.min.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/sortablejs` if it exists or add a new declaration (.d.ts) file containing `declare module 'sortablejs';`
1 import Sortable from "sortablejs";
Expected Behavior
Since Calcite's types rely on Sortablejs types, @types/sortablejs must be made into a dependency
Check existing issues
Actual Behavior
Calcite typings are using types from the Sortablejs library, for example in this file:
Yet,
@types/sortablejs
is not included as a "dependency" (it's as devDependency instead, and in the root monorepo package.json rather than calcite-components's package.json)This cause TypeScript errors for consumer of calcite package when they try to typecheck their app if they have
"skipLibCheck":false
in their tsconfig.json (otherwise, the type would get silently resolved toany
- not ideal)Expected Behavior
Since Calcite's types rely on Sortablejs types,
@types/sortablejs
must be made into a dependencyReproduction Sample
https://github.com/maxpatiiuk/calcite-missing-dependency
Reproduction Steps
git clone https://github.com/maxpatiiuk/calcite-missing-dependency
npm install
npx tsc
Reproduction Version
2.0.0
Relevant Info
See relevant articles:
Regression?
No response
Priority impact
impact - p3 - not time sensitive
Impact
No response
Calcite package
Esri team
ArcGIS Maps SDK for JavaScript