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

feat: Add svelte to the default sortExports option #251

Open
1 task done
melMass opened this issue Nov 15, 2024 · 0 comments
Open
1 task done

feat: Add svelte to the default sortExports option #251

melMass opened this issue Nov 15, 2024 · 0 comments

Comments

@melMass
Copy link

melMass commented Nov 15, 2024

Description

The whole defaults are pretty good I just had to specify sortFirst to fully fit my needs but one small issue is the default sortExports, it's "missing" the svelte one before default which makes publint (rightfully) complain:

@mtb/svelte-core lint results:
Errors:
1. pkg.exports["./inputs"].default should be the last in the object so it doesn't tak
e precedence over the keys following it.
2. pkg.exports["./menus"].default should be the last in the object so it doesn't take
 precedence over the keys following it.
3. pkg.exports["./spinners"].default should be the last in the object so it doesn't t
ake precedence over the keys following it.
4. pkg.exports["./stores"].default should be the last in the object so it doesn't tak
e precedence over the keys following it.
5. pkg.exports["./viz"].default should be the last in the object so it doesn't take p
recedence over the keys following it.

Suggested Solution

Use this as default:

"sortExports": [
  "types",
  "node-addons",
  "node",
  "browser",
  "import",
  "require",
  "svelte",
  "development",
  "production",
  "default"
],

Optional comments

I'm not 100% sure how much of these extra key exist and if it makes sense to add them to defaults if there are many...
A better approach I can think of is a new config like exportDefaultAlwaysLast: true or similar

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant