Grsmto / simplebar

Custom scrollbars vanilla javascript library with native scroll, done simple, lightweight, easy to use and cross-browser.
http://grsmto.github.io/simplebar/
MIT License
6.02k stars 535 forks source link

Add types field to package.json #661

Closed andersk closed 1 year ago

andersk commented 1 year ago

https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package

Fixes this error:

$ npm i simplebar
$ tsc --init
$ echo 'import SimpleBar from "simplebar"' > test.ts
$ tsc
test.ts:1:23 - error TS7016: Could not find a declaration file for module 'simplebar'. '/tmp/test/node_modules/simplebar/dist/index.cjs' implicitly has an 'any' type.
  Try `npm i --save-dev @types/simplebar` if it exists or add a new declaration (.d.ts) file containing `declare module 'simplebar';`

1 import SimpleBar from "simplebar"
                        ~~~~~~~~~~~

Found 1 error in test.ts:1
Grsmto commented 1 year ago

Thanks @andersk 🙏

Grsmto commented 1 year ago

Published 6.2.3.