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

chore: use 'files' instead of .npmignore #244

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

Conversation

midgleyc
Copy link

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • New rule
  • Changes an existing rule
  • Add autofixing to a rule
  • Other: build simplification

What changes did you make? (Give an overview)

Change build to use files over .npmignore.

.npmignore lists the files that should not be in the build, and can easily go out of date (and has) because it needs updating every time a file is added that shouldn't be in the build.

files in package.json lists the files that should be in the build, and can be kept up to date more easily.

I include the rules folder, and the files which are always included automatically.

@brettz9
Copy link
Member

brettz9 commented Jul 19, 2024

This looks good to me if you want to first resolve the conflicts, however.

@brettz9 brettz9 added the chore label Jul 19, 2024
package.json Outdated
@@ -16,6 +16,10 @@
"repository": "https://github.com/xjamundx/eslint-plugin-promise",
"homepage": "https://github.com/xjamundx/eslint-plugin-promise",
"bugs": "https://github.com/xjamundx/eslint-plugin-promise/issues",
"main": "index.js",
"files": [
"rules"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"rules"
"rules/**/*.js",
"index.js"

I would go with this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would miss rules/lib/is-member-call-with-object-name which perhaps does want to end with .js?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry, that does want to end with .js. Addressed in the TypeScript PR, but I can supply a separate PR to address.

@voxpelli voxpelli changed the title use 'files' instead of .npmignore chore: use 'files' instead of .npmignore Jul 24, 2024
@voxpelli voxpelli removed the chore label Jul 24, 2024
@midgleyc midgleyc force-pushed the files-over-npmignore branch from c9c7922 to 5ced6af Compare July 27, 2024 09:13
@midgleyc
Copy link
Author

midgleyc commented Jul 27, 2024

I've redone the changes on the tip of main.

If you add TypeScript types, you'll also want to add index.d.ts and rules/**/*.d.ts to the array.

Except the previously mentioned file lacking .js, the only files removed (compared to a previous npm pack) are .eslint-doc-generatorrc.js and CHANGELOG.md.

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.

3 participants