taplo icon indicating copy to clipboard operation
taplo copied to clipboard

No/incorrect documentation for @taplo/lib

Open uncenter opened this issue 2 years ago • 4 comments

There is just no documentation for the JS packages on the websites, and the JSDoc comments are incorrect when they exist (i.e. https://github.com/tamasfe/taplo/blob/5c8ad75a5c80a9275e9fab2f0842ad35d61e01e7/js/lib/src/index.ts#L73C1-L73C1 the package should be under @taplo/lib not taplo).

uncenter avatar Oct 19 '23 00:10 uncenter

I forgot to mention that the @taplo/lib package is just not even an ESM package - just published as CJS.

import { Taplo } from "@taplo/lib";
         ^^^^^
SyntaxError: Named export 'Taplo' not found. The requested module '@taplo/lib' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@taplo/lib';
const { Taplo } = pkg;

It should either be ESM only or publish both ESM and CJS.

uncenter avatar Oct 19 '23 00:10 uncenter

This isn't a VSCode issue though? Just the npm package.

uncenter avatar Oct 19 '23 12:10 uncenter

Yes, but we don't really have that distinction in the labels. So for me anything related to javascript or VScode is just vscode and I don't look at it because I don't use VSCode and don't know javascript.

ia0 avatar Oct 19 '23 12:10 ia0

Okay aha. No worries.

uncenter avatar Oct 19 '23 12:10 uncenter