Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions javascript/packages/linter/src/cli/file-url.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { resolve } from "node:path"

export function fileUrl(filePath: string): string {
const absolutePath = resolve(filePath)
return `file://${absolutePath}`
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { colorize, Highlighter, type ThemeInput, DEFAULT_THEME } from "@herb-too

import { BaseFormatter } from "./base-formatter.js"
import { LineWrapper } from "@herb-tools/highlighter"
import { ruleDocumentationUrl, fileUrl } from "../../urls.js"
import { ruleDocumentationUrl } from "../../urls.js"
import { fileUrl } from "../file-url.js"

import type { Diagnostic } from "@herb-tools/core"
import type { ProcessedFile } from "../file-processor.js"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { colorize, hyperlink, TextFormatter } from "@herb-tools/highlighter"

import { BaseFormatter } from "./base-formatter.js"
import { ruleDocumentationUrl, fileUrl } from "../../urls.js"
import { ruleDocumentationUrl } from "../../urls.js"
import { fileUrl } from "../file-url.js"

import type { Diagnostic } from "@herb-tools/core"
import type { ProcessedFile } from "../file-processor.js"
Expand Down
7 changes: 0 additions & 7 deletions javascript/packages/linter/src/urls.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { resolve } from "node:path"

const DOCS_BASE_URL = "https://herb-tools.dev/linter/rules"

export function ruleDocumentationUrl(ruleId: string): string {
return `${DOCS_BASE_URL}/${ruleId}`
}

export function fileUrl(filePath: string): string {
const absolutePath = resolve(filePath)
return `file://${absolutePath}`
}
Loading