You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// package.json{"exports": {".": {// Entry-point for TypeScript resolution - must occur first!"types": "./types/index.d.ts",// Entry-point for `import "my-package"` in ESM"import": "./esm/index.js",// Entry-point for `require("my-package") in CJS"require": "./commonjs/index.cjs",},}}
Would you be open to a config option allowing to exclude certain object property paths? Maybe:
Thanks for the quick response! That's close and probably usable for my use case. But it still enforces an ordering. Is there a way to ignore that particular pathPattern altogether? It'd be nice to not have to specify the order, in case there are other types of exports defined.
There is currently no way to explicitly set it to be ignored.
I think it's probably a good idea to add a order: { type: "ignore" } option to the rule to achieve that.
The current rule ignores ordering for keys that are not defined, so by using a pattern that doesn't match anything, you can also use a hack like this to ignore ordering: "order": [ { "keyPattern": "(?=a)b" } ]
👋 I'm a big fan of this plugin and use it in http://github.com/JoshuaKGoldberg/template-typescript-node-package to sort
package.json
contents. Thanks for making it!Turns out sometimes
package.json
content ordering does matter. Per https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing, thetypes
resolution under"exports"
>"."
must come first:Would you be open to a config option allowing to exclude certain object property paths? Maybe:
...I'm not confident in that
ignore: string[]
format. But can't think of a better option right now. 🤔Potentially relevant: typescript-eslint/typescript-eslint#6017
The text was updated successfully, but these errors were encountered: