Skip to content

Commit 0948ea1

Browse files
committed
feat(#15): fix after review
1 parent e3ed951 commit 0948ea1

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

src/main/java/org/eolang/lints/Defect.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ public Default(
166166
* @param text Description of the defect
167167
* @checkstyle ParameterNumberCheck (5 lines)
168168
*/
169-
public Default(
169+
Default(
170170
final String rule, final Severity severity,
171171
final int line, final String text
172172
) {
173-
this(rule, severity, null, line, text);
173+
this(rule, severity, "", line, text);
174174
}
175175

176176
/**

src/main/java/org/eolang/lints/MarkdownLinter.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* @since 0.0.47
2121
*/
22-
public final class MarkdownLinter implements Closeable {
22+
final class MarkdownLinter implements Closeable {
2323
/**
2424
* JavaScript code of markdownlint with function, that run markdownlint on single string.
2525
*/
@@ -46,7 +46,7 @@ public final class MarkdownLinter implements Closeable {
4646
private final Value mdlint;
4747

4848
@SuppressWarnings("PMD.ConstructorOnlyInitializesOrCallOtherConstructors")
49-
public MarkdownLinter() {
49+
MarkdownLinter() {
5050
this.context = Context.newBuilder("js")
5151
.option("engine.WarnInterpreterOnly", "false")
5252
.build();
@@ -84,6 +84,13 @@ public void close() {
8484
this.context.close();
8585
}
8686

87+
/**
88+
* Get the first name starting with MD from the name array.
89+
*
90+
* @param names Java scrit array of names.
91+
* @return The first name starting with MD.
92+
* @throws IllegalStateException If no name starting with MD is found.
93+
*/
8794
private static String getName(final Value names) {
8895
for (int idx = 0; idx < names.getArraySize(); idx += 1) {
8996
final String name = names.getArrayElement(idx).asString();

src/main/javascript/markdownlint.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
* SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com
33
* SPDX-License-Identifier: MIT
44
*/
5-
5+
/**
6+
* @todo #15:45min Add eslint to repository https://github.com/eslint/eslint.
7+
* We should integrate eslint into the eslint repository to monitor the quality of code written in java script.
8+
*/
69
import { lint as lintSync } from "markdownlint/sync";
710

811
globalThis.lint = function(text) {

src/test/java/org/eolang/lints/LtInvalidMarkdownCommentTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com
33
* SPDX-License-Identifier: MIT
44
*/
5-
65
package org.eolang.lints;
76

87
import java.io.IOException;

0 commit comments

Comments
 (0)