npm-package-json-lint
npm-package-json-lint copied to clipboard
Feature request: `no-main` Rule
When reporting a bug, please include:
It would be handy for projects that are not libraries to enforce that main is not set in package manager.
Use case
When using GatsbyJS, if the projects 'package.json' includes main then it will throw a Compilation error.
package.json snippet
{
"main": "n/a",
}
GatsbyJS CLI output
ERROR #11901 COMPILATION
Failed to compile Gatsby files (@parcel/core):
Unexpected output file type in target "main". File extension must be .js, .mjs, or .cjs
Hints:
- The "main" field is meant for libraries. If you meant to output a file, either remove the "main" field or choose a different target name.