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: mention "nonNpm": "conflict" in readme and error message #1119

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/dtslint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Also:

For types that do not have a matching NPM package, add two properties:

1. `"nonNpm": true`
1. `"nonNpm": true`, or `"nonNpm": "conflict"` if there is a NPM package but it is unrelated.
fowl2 marked this conversation as resolved.
Show resolved Hide resolved
2. `"nonNpmDescription"`, a human-readable name for the project that is being typed.

#### `types/.eslintrc.json`
Expand Down
3 changes: 2 additions & 1 deletion packages/dtslint/src/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ export async function checkNpmVersionAndGetMatchingImplementationPackage(
errors.push(
`Package ${packageJson.name} is marked as non-npm, but ${packageName} exists on npm. ` +
`If these types are being added to DefinitelyTyped for the first time, please choose ` +
`a different name that does not conflict with an existing npm package.`,
`a different name that does not conflict with an existing npm package. If this is an ` +
`existing conflict, mark these types as \`"nonNpm": "conflict"\`.`,
);
} else if (!packageJson.nonNpm) {
if (!satisfies(packageVersion, typesPackageVersion)) {
Expand Down