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: Add 'main' and 'types' entries to package.json #48

Merged
merged 1 commit into from
Jun 7, 2024
Merged

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented Jun 6, 2024

Prerequisites checklist

What is the purpose of this pull request?

Add main and types entries to package.json files. Even though we have exports specified, some tools still rely on these old, top-level entries.

What changes did you make? (Give an overview)

  • Added main and types entries to package.json files in compat, config-array, and object-schema.

Related Issues

fixes #46

Is there anything you'd like reviewers to focus on?

@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Jun 6, 2024
@@ -3,6 +3,8 @@
"version": "1.0.3",
"description": "Compatibility utilities for ESLint",
"type": "module",
"main": "dist/esm/index.js",
Copy link
Member

Choose a reason for hiding this comment

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

I noticed that for @eslint/eslintrc alone we are exposing cjs as main and at rest of the places its esm. Is there some reason behind it?

https://github.com/eslint/eslintrc/blob/fc9837d3c4eb6c8c97bd5594fb72ea95b6e32ab8/package.json#L6

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. @eslint/eslintrc was made primarily for a CJS environment. Going forward, we are targeting primarily ESM. Everything in this repo is ESM-first.

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

I've verified that this doesn't break ESLint Playground build. (it will still use CJS exports)

Leaving open for a couple of days if anyone else would like to review.

Copy link
Contributor

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

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

LGTM

@snitin315 snitin315 merged commit 16ee1fa into main Jun 7, 2024
14 checks passed
@snitin315 snitin315 deleted the issue46 branch June 7, 2024 02:13
@github-actions github-actions bot mentioned this pull request Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Bug: (Unable to resolve path to module '@eslint/compat.'.eslintimport/no-unresolved)
4 participants