diff --git a/package.json b/package.json
index e02e445..e683e6c 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,7 @@
"private": false,
"repository": {
"type": "git",
- "url": "https://github.com/Shuunen/repo-checker.git"
+ "url": "git+https://github.com/Shuunen/repo-checker.git"
},
"scripts": {
"build": "pnpm build:app && pnpm mark && echo build success",
diff --git a/src/__snapshots__/check.test.ts.snap b/src/__snapshots__/check.test.ts.snap
index 3a6dd50..f2bdf60 100644
--- a/src/__snapshots__/check.test.ts.snap
+++ b/src/__snapshots__/check.test.ts.snap
@@ -50,6 +50,7 @@ exports[`check B repo-checker folder succeed 1`] = `
"package-json-has-a-keywords-property",
"package-json-has-a-private-property",
"package-json-has-a-repository-property",
+ "package-json-has-a-repository-url-starting-with-git-plus",
"package-json-has-a-author-property",
"package-json-has-a-name-property",
"package-json-has-a-version-property",
diff --git a/src/files/__snapshots__/package.test.ts.snap b/src/files/__snapshots__/package.test.ts.snap
index 72a0468..71fa01e 100644
--- a/src/files/__snapshots__/package.test.ts.snap
+++ b/src/files/__snapshots__/package.test.ts.snap
@@ -46,6 +46,7 @@ exports[`package A on repo checker 1`] = `
"package-json-has-a-keywords-property",
"package-json-has-a-private-property",
"package-json-has-a-repository-property",
+ "package-json-has-a-repository-url-starting-with-git-plus",
"package-json-has-a-author-property",
"package-json-has-a-name-property",
"package-json-has-a-version-property",
diff --git a/src/files/package.file.ts b/src/files/package.file.ts
index e3db693..2ad4033 100644
--- a/src/files/package.file.ts
+++ b/src/files/package.file.ts
@@ -138,7 +138,12 @@ export class PackageJsonFile extends FileBase {
this.couldContains('a "homepage" property', this.regexForStringProp('homepage'))
this.couldContains('a "keywords" property', this.regexForArrayProp('keywords'))
this.couldContains('a "private" property', this.regexForBooleanProp('private'))
- this.couldContains('a "repository" property', this.regexForObjectProp('repository'))
+ const hasRepository = this.couldContains('a "repository" property', this.regexForObjectProp('repository'))
+ if (hasRepository) {
+ const hasPlus = this.couldContains('a repository url starting with git plus', /"repository": [^u]+url": "git\+https/gu, 1, 'like "repository": "git+https..."', true)
+ /* c8 ignore next */
+ if (!hasPlus && this.canFix) this.fileContent = this.fileContent.replace(/(?"repository": [^u]+url": ")(?[^"]+")/gu, '$git+$')
+ }
this.shouldContains('a "author" property', this.regexForStringProp('author'))
this.shouldContains('a "name" property', this.regexForStringProp('name'))
this.shouldContains('a "version" property', this.regexForStringProp('version'))