Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Remove typescript files from build #105

Open
what1s1ove opened this issue Oct 28, 2023 · 1 comment
Open

[Bug]: Remove typescript files from build #105

what1s1ove opened this issue Oct 28, 2023 · 1 comment

Comments

@what1s1ove
Copy link

what1s1ove commented Oct 28, 2023

Because the package is published together with TypeScript files (which is bad practice), various errors occur depending on the build tool.

image

For example, the problem in this issue #92. Another example is when I want to enable the exactOptionalPropertyTypes option in the TypeScript config, it complains about the use of TS files in the node_modules folder, which we cannot fix.

image
node_modules/csv-writer/src/lib/csv-writer-factory.ts:30:85 - error TS2379: Argument of type '{ header: string[] | undefined; fieldDelimiter: string | undefined; recordDelimiter: string | undefined; alwaysQuote: boolean | undefined; }' is not assignable to parameter of type 'ArrayCsvStringifierParams' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Types of property 'header' are incompatible.
    Type 'string[] | undefined' is not assignable to type 'string[]'.
      Type 'undefined' is not assignable to type 'string[]'.

 30         const csvStringifier = this.csvStringifierFactory.createArrayCsvStringifier({
                                                                                        ~
 31             header: params.header,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
 34             alwaysQuote: params.alwaysQuote
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 35         });
    ~~~~~~~~~

Please consider publishing the package with only JS files, along with type declarations (d.ts files).

@brakmic
Copy link

brakmic commented Jul 16, 2024

Hi @what1s1ove ,

It seems that the original project may have been abandoned, so I decided to fork it. This problem has been resolved in my version, which only publishes the JavaScript files along with the index.d.ts declaration file. I'm also working on fixing other unsolved issues from the old project's list.

You can check out the forked project here:

Feel free to try it out, and I hope it helps!

Best,
Harris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants