We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
your package seems to fail resolution with eslint because it lacks a main field in package.json.
For example, on @tinyhttp/content-disposition, package.json should include "main": "./dist/index.js",
@tinyhttp/content-disposition
package.json
"main": "./dist/index.js",
without the main field, normal imports do not work:
main
import { contentDisposition } from "@tinyhttp/content-disposition"; //eslint cannot find the module
but the following works:
import { contentDisposition } from "@tinyhttp/content-disposition/dist";
The text was updated successfully, but these errors were encountered:
see import-js/eslint-plugin-import#2132 for eslint point of view:
A package just for the browser still needs node behavior, even if that’s “nothing”, so having it lack a main is a bug.
Sorry, something went wrong.
"main" field is for CommonJS
tinyhttp is ESM-only and uses "exports" instead.
so not planning on returning "main" back, it's an eslint-plugin-import issue not tinyhttp's, sorry :c
eslint-plugin-import
for future reference (I adhere to your point of view), there are issues on eslint-plugin-import to support exports:
exports
no-unresolved
imports
No branches or pull requests
your package seems to fail resolution with eslint because it lacks a main field in package.json.
For example, on
@tinyhttp/content-disposition
,package.json
should include"main": "./dist/index.js",
without the
main
field, normal imports do not work:but the following works:
The text was updated successfully, but these errors were encountered: