diff --git a/packages/dtslint/README.md b/packages/dtslint/README.md index 592135eb02..24755bebf8 100644 --- a/packages/dtslint/README.md +++ b/packages/dtslint/README.md @@ -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 an npm package but it is unrelated. 2. `"nonNpmDescription"`, a human-readable name for the project that is being typed. #### `types/.eslintrc.json` diff --git a/packages/dtslint/src/checks.ts b/packages/dtslint/src/checks.ts index 91d5fb9073..c7a7c68c88 100644 --- a/packages/dtslint/src/checks.ts +++ b/packages/dtslint/src/checks.ts @@ -262,7 +262,10 @@ 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"\`. See `+ + `https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#naming for ` + + `for more information., ); } else if (!packageJson.nonNpm) { if (!satisfies(packageVersion, typesPackageVersion)) { @@ -279,7 +282,8 @@ export async function checkNpmVersionAndGetMatchingImplementationPackage( `If these types are for the existing npm package ${packageName}, change the ${packageDirectoryNameWithVersion}/package.json ` + `major and minor version to match an existing version of the npm package. If these types are unrelated to ` + `the npm package ${packageName}, add \`"nonNpm": true\` to the package.json and choose a different name ` + - `that does not conflict with an existing npm package.`, + `that does not conflict with an existing npm package. See https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#naming ` + + `for more information.`, ); } else { try { @@ -295,7 +299,7 @@ export async function checkNpmVersionAndGetMatchingImplementationPackage( } else if (packageJson.nonNpm === "conflict") { errors.push( `Package ${packageJson.name} is marked as \`"nonNpm": "conflict"\`, but no conflicting package name was ` + - `found on npm. These non-npm types can be makred as \`"nonNpm": true\` instead.`, + `found on npm. These non-npm types can be marked as \`"nonNpm": true\` instead.`, ); } else if (!packageJson.nonNpm) { errors.push(