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

Fix default imports #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix default imports #68

wants to merge 1 commit into from

Conversation

dnicolson
Copy link
Contributor

This pull request fixes the following errors when running a Visual Studio Code Extension:

node_modules/simple-plist/dist/index.d.ts:1:21 - error TS1259: Module '"bplist-creator"' can only be default-imported using the 'esModuleInterop' flag

1 export { default as bplistCreator } from "bplist-creator";
                      ~~~~~~~~~~~~~

  node_modules/bplist-creator/bplistCreator.d.ts:7:3
    7   export = BPlistCreator;
        ~~~~~~~~~~~~~~~~~~~~~~~
    This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.

node_modules/simple-plist/dist/index.d.ts:2:21 - error TS1259: Module '"/Users/dave/x/node_modules/bplist-parser/bplistParser"' can only be default-imported using the 'esModuleInterop' flag

2 export { default as bplistParser } from "bplist-parser";
                      ~~~~~~~~~~~~

  node_modules/bplist-parser/bplistParser.d.ts:8:1
    8 export = bPlistParser
      ~~~~~~~~~~~~~~~~~~~~~
    This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.


Found 2 errors in the same file, starting at: node_modules/simple-plist/dist/index.d.ts:1

Fixes changes introduced after #65.

@dnicolson
Copy link
Contributor Author

Hi @wollardj, can you please take a look at this?

@dnicolson
Copy link
Contributor Author

Here is a reduced example:

mkdir simple-plist-test
cd simple-plist-test
npm i typescript @types/node simple-plist@1.4.0
echo "import * as plist from 'simple-plist'; console.log(plist)" > index.ts
tsc index.ts

And applying this fix:

cd ..
git clone git@github.com:wollardj/simple-plist.git
cd simple-plist
git checkout v1.4.0
npm i
curl -OL https://github.com/wollardj/simple-plist/pull/68.diff
git apply 68.diff
npm run build && cp -R dist/* ../simple-plist-test/node_modules/simple-plist/dist/
cd ../simple-plist-test
tsc index.ts
node index.js

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

Successfully merging this pull request may close these issues.

None yet

1 participant