@salesforcedevs/sfdocs-no-relative-link
Advanced tools
Comparing version 0.0.1-alphav4 to 0.0.1-alphav5
@@ -32,3 +32,4 @@ "use strict"; | ||
if (isInternalPath(node.url) && denyInternalLinkInFile) { | ||
const errorMessage = new vfile_message_1.default(`Using relative links is not allowed in ${folder.replace('/\//g', '')} files. Please use absolute links (/docs/..) instead of ${node.url}.`, node, "relative-link-not-allowed"); | ||
const trimmedFolder = folder.replace(/^\/?|\/?$/g, ""); | ||
const errorMessage = new vfile_message_1.default(`Using relative links is not allowed in ${trimmedFolder} files. Please use absolute links (/docs/..) instead of ${node.url}.`, node, "relative-link-not-allowed"); | ||
errorMessage.fatal = true; | ||
@@ -35,0 +36,0 @@ file.messages.push(errorMessage); |
{ | ||
"name": "@salesforcedevs/sfdocs-no-relative-link", | ||
"version": "0.0.1-alphav4", | ||
"version": "0.0.1-alphav5", | ||
"description": "Validate the relative links in any folder and throw error/warning after check", | ||
@@ -5,0 +5,0 @@ "author": "SFDocs Team", |
@@ -61,3 +61,3 @@ import dedent from 'dedent'; | ||
const file = vfile({ path: '/test/content/shared/example.md', contents: md }); | ||
const result = processMarkdown(file, ['error', 'shared']); | ||
const result = processMarkdown(file, ['error', '/shared/']); | ||
@@ -64,0 +64,0 @@ expect(result.messages.length).toEqual(1); |
@@ -34,3 +34,4 @@ /** | ||
if (isInternalPath(node.url) && denyInternalLinkInFile) { | ||
const errorMessage: VFileMessage = new VMessage(`Using relative links is not allowed in ${folder.replace('/\//g','')} files. Please use absolute links (/docs/..) instead of ${node.url}.`, node, "relative-link-not-allowed"); | ||
const trimmedFolder = folder.replace(/^\/?|\/?$/g, ""); | ||
const errorMessage: VFileMessage = new VMessage(`Using relative links is not allowed in ${trimmedFolder} files. Please use absolute links (/docs/..) instead of ${node.url}.`, node, "relative-link-not-allowed"); | ||
errorMessage.fatal = true; | ||
@@ -37,0 +38,0 @@ file.messages.push(errorMessage); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80531
750