From 40d1e22c7a4ca107657b8de38bb7d6f8b924b75a Mon Sep 17 00:00:00 2001 From: James May Date: Mon, 9 Dec 2024 16:42:19 +1100 Subject: [PATCH 1/5] Update README.md --- packages/dtslint/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dtslint/README.md b/packages/dtslint/README.md index 592135eb02..e7607caffa 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 a NPM package but it is unrelated. 2. `"nonNpmDescription"`, a human-readable name for the project that is being typed. #### `types/.eslintrc.json` From c02c985ae78c23d17a95a2c6ff18d2a3d2cf54af Mon Sep 17 00:00:00 2001 From: James May Date: Mon, 9 Dec 2024 16:45:40 +1100 Subject: [PATCH 2/5] Update checks.ts (#1) --- packages/dtslint/src/checks.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/dtslint/src/checks.ts b/packages/dtslint/src/checks.ts index 91d5fb9073..fd96311468 100644 --- a/packages/dtslint/src/checks.ts +++ b/packages/dtslint/src/checks.ts @@ -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)) { From 41a6e830b178cdf9ebda248bee14d2964d959b12 Mon Sep 17 00:00:00 2001 From: James May Date: Mon, 9 Dec 2024 16:48:42 +1100 Subject: [PATCH 3/5] Update checks.ts --- packages/dtslint/src/checks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dtslint/src/checks.ts b/packages/dtslint/src/checks.ts index fd96311468..20aa1687bb 100644 --- a/packages/dtslint/src/checks.ts +++ b/packages/dtslint/src/checks.ts @@ -263,7 +263,7 @@ export async function checkNpmVersionAndGetMatchingImplementationPackage( `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. If this is an ` + - `existing conflict, mark these types as \`"nonNpm": "conflict"\`. `, + `existing conflict, mark these types as \`"nonNpm": "conflict"\`.`, ); } else if (!packageJson.nonNpm) { if (!satisfies(packageVersion, typesPackageVersion)) { From a4e6270f5f92edce371d4cff6de2ce5b52355b78 Mon Sep 17 00:00:00 2001 From: James May Date: Tue, 10 Dec 2024 22:15:56 +1100 Subject: [PATCH 4/5] Update packages/dtslint/README.md Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com> --- packages/dtslint/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dtslint/README.md b/packages/dtslint/README.md index e7607caffa..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`, or `"nonNpm": "conflict"` if there is a NPM package but it is unrelated. +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` From 8d0e926cdbaa75b376ec8efd27a9cadddd67a681 Mon Sep 17 00:00:00 2001 From: James May Date: Tue, 10 Dec 2024 22:22:34 +1100 Subject: [PATCH 5/5] Update checks.ts --- packages/dtslint/src/checks.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/dtslint/src/checks.ts b/packages/dtslint/src/checks.ts index 20aa1687bb..c7a7c68c88 100644 --- a/packages/dtslint/src/checks.ts +++ b/packages/dtslint/src/checks.ts @@ -263,7 +263,9 @@ export async function checkNpmVersionAndGetMatchingImplementationPackage( `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. If this is an ` + - `existing conflict, mark these types as \`"nonNpm": "conflict"\`.`, + `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)) { @@ -280,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 { @@ -296,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(