Skip to content

Commit

Permalink
fix: Eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Mar 26, 2024
1 parent 69cb23a commit 3533e11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/linter/html/HtmlReporter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {BaseReporter, ReporterMessage, ReporterCoverageInfo, PositionInfo} from "../../detectors/BaseReporter.js";
import type {BaseReporter, ReporterMessage, ReporterCoverageInfo} from "../../detectors/BaseReporter.js";
import type {LintMessage} from "../../detectors/AbstractDetector.js";
import {Tag as SaxTag} from "sax-wasm";
import {LintMessageSeverity, CoverageInfo} from "../../detectors/AbstractDetector.js";
Expand All @@ -17,10 +17,9 @@ export default class HtmlReporter implements BaseReporter {
throw new Error(`Reports flagged as "fatal" must be of severity "Error"`);
}


let line = 1, column = 1;
if (node instanceof SaxTag) {
({ line, character: column } = node.openStart);
({line, character: column} = node.openStart);
}

this.#messages.push({
Expand All @@ -36,8 +35,8 @@ export default class HtmlReporter implements BaseReporter {
addCoverageInfo({node, message, category}: ReporterCoverageInfo) {
let line = 1, column = 1, endLine = 1, endColumn = 1;
if (node instanceof SaxTag) {
({ line, character: column } = node.openStart);
({ line: endLine, character: endColumn } = node.closeEnd);
({line, character: column} = node.openStart);
({line: endLine, character: endColumn} = node.closeEnd);
}

this.#coverageInfo.push({
Expand Down
2 changes: 1 addition & 1 deletion src/linter/html/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function lintHtml(resourceName: string, contentStream: ReadStream):
jsScriptTags.forEach((tag) => {
const scriptContent = tag.textNodes?.map((tNode) => tNode.value).join("").trim();

if (scriptContent) {
if (scriptContent) {
report.addMessage({
node: tag,
severity: LintMessageSeverity.Error,
Expand Down

0 comments on commit 3533e11

Please sign in to comment.