npm-package-json-lint
npm-package-json-lint copied to clipboard
feat: Check order of sub-properties
Check order of sub-properties with prefer-property-order. Example with sub-properties of exports to check that types comes first and default comes last (I had a problem because I had positioned types after default):
{
"rules": {
"prefer-property-order": ["error", [
"...",
"files",
"exports",
"exports.types",
"exports.deno",
"exports.browser",
"exports.react-native",
"exports.node-addons",
"exports.node",
"exports.import",
"exports.require",
"exports.default",
"main",
"..."
]]
}
}
Other sub-properties:
[
"bugs.url",
"bugs.email",
"license.type",
"license.url",
"author.name",
"author.email",
"author.url",
"funding.type",
"funding.url",
"repository.type",
"repository.url",
"repository.directory"
]