gajus / eslint-plugin-jsdoc

JSDoc specific linting rules for ESLint.
Other
1.09k stars 157 forks source link

fix: exclude unused files from publish process #1141

Closed falsepopsky closed 1 year ago

falsepopsky commented 1 year ago

Issue

This pull request addresses the issue of including unused files in the publish process. ex: tsconfig.json and tsconfig-prod.json

Solution

With this pull request, when adding the src and docs folders to the files section in package.json, the build process will automatically exclude other unused files. Note that readme and license files are always included (for documentation purposes please refer to this link).

Before

filesbefore

After

  1. run npm pack
  2. To visually identify which files are packaged, you have two options:
    • Check the log for added files.
    • Extract the tarball to see the files.

after

Additional Comments:

Fdawgs commented 1 year ago

Could save a few more bytes by using an .npmignore file instead, as package.json (and in turn the files key and its contents) are published.

brettz9 commented 1 year ago

Thanks for the PR. I submitted another one which makes some fixes to tsconfig. However, that raises another question. While #1130 is seeking for the bundling of types, I'm not sure we want to add to the package size to do so, especially since an ESLint config file may have a different import approach then the rest of the package containing it.

I'm also wondering whether we should exclude /docs.

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 46.5.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: