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

remove unnecessary files from npm package #6

Closed
PopGoesTheWza opened this issue Jan 28, 2020 · 1 comment
Closed

remove unnecessary files from npm package #6

PopGoesTheWza opened this issue Jan 28, 2020 · 1 comment

Comments

@PopGoesTheWza
Copy link
Contributor

PopGoesTheWza commented Jan 28, 2020

Under some obscure ambiguous ava/eslint/lerna/typescript configuration, the tsconfig.json from this package ends up being parsed by the vscode eslint extensions.

This triggers a puzzling eslint parsing error (within vscode only) because of the rightfully missing dependency @sindresorhus/tsconfig

Possible workaround is to include @sindresorhus/tsconfig as a devDependency of the project where the issue occurs.

Another option could be to have the defer-to-connect npm package to only include the necessary files:

~/ref/defer-to-connect$ npm publish --dry-run

> defer-to-connect@1.1.1 prepublishOnly .
> npm run build


> defer-to-connect@1.1.1 build /Users/xxx/ref/defer-to-connect
> del-cli dist && tsc

npm notice
npm notice 📦  defer-to-connect@1.1.1
npm notice === Tarball Contents ===
npm notice 175B  .editorconfig
npm notice 1.1kB LICENSE
npm notice 1.5kB dist/index.js
npm notice 1.5kB package.json
npm notice 148B  tsconfig.json
npm notice 951B  README.md
npm notice 346B  dist/index.d.ts
npm notice 1.4kB source/index.ts
npm notice 3.8kB test.ts
npm notice 95B   .travis.yml
npm notice === Tarball Details ===
npm notice name:          defer-to-connect
npm notice version:       1.1.1
npm notice package size:  3.7 kB
npm notice unpacked size: 11.1 kB
npm notice shasum:        8fe78c004a940928c450b778563518d38b655a41
npm notice integrity:     sha512-aFmg/ZU3VEECH[...]O+NGxsXNrv9Lg==
npm notice total files:   10
npm notice
+ defer-to-connect@1.1.1

Possible options are:

  • blacklisting through .npmignore
  • whitelisting by adding "files": ["dist"] in package.json
@PopGoesTheWza
Copy link
Contributor Author

A quick follow up in order to document/share the correct solution to the original issue ( parsing error in vscode eslint extension.)

When working on a mono-repo, the vscode eslint extension may find it difficult to determine the correct working directory for each package. This is why the setting eslint.workingDirectories exists.

In my specific case, adding the following .vscode/settings.json to my project ensure vscode eslint extension doesn't mess up:

{
  "eslint.workingDirectories": [{ "pattern": "packages/*/src" }]
}

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