adaltas / node-csv

Full featured CSV parser with simple api and tested against large datasets.

Home Page:https://csv.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a filename extension to `from './index'`

rauschma opened this issue · comments

Describe the bug

With some module resolutions, TypeScript complains about csv-parse/dist/esm/sync.d.ts:

Relative import paths need explicit file extensions in EcmaScript imports
when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.js'?

To fix this issue, change https://github.com/adaltas/node-csv/blob/master/packages/csv-parse/lib/sync.d.ts

- import { Options } from './index';
+ import { Options } from './index.js';

  ···

  export {
    CastingContext, CastingFunction, CastingDateFunction,
    ColumnOption, Options, Info, CsvErrorCode, CsvError
- } from './index';
+ } from './index.js';

This was fixed in #368, released in:

  • csv-generate@4.2.1
  • csv-parse@5.3.2
  • csv-stringify@6.2.1
  • csv@6.2.2
  • stream-transform@3.2.1