Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions src/rules/converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { convertIncrementDecrement } from "./converters/increment-decrement";
import { convertIndent } from "./converters/indent";
import { convertInterfaceName } from "./converters/interface-name";
import { convertInterfaceOverTypeLiteral } from "./converters/interface-over-type-literal";
import { convertJSDocFormat } from "./converters/jsdoc-format";
import { convertLabelPosition } from "./converters/label-position";
import { convertLinebreakStyle } from "./converters/linebreak-style";
import { convertMaxClassesPerFile } from "./converters/max-classes-per-file";
Expand Down Expand Up @@ -149,6 +150,7 @@ export const converters = new Map([
["indent", convertIndent],
["interface-name", convertInterfaceName],
["interface-over-type-literal", convertInterfaceOverTypeLiteral],
["jsdoc-format", convertJSDocFormat],
["label-position", convertLabelPosition],
["linebreak-style", convertLinebreakStyle],
["max-classes-per-file", convertMaxClassesPerFile],
Expand Down
18 changes: 18 additions & 0 deletions src/rules/converters/jsdoc-format.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RuleConverter, ConvertedRuleChanges } from "../converter";

export const convertJSDocFormat: RuleConverter = () => {
const ruleNames: string[] = [
"jsdoc/check-alignment",
"jsdoc/require-jsdoc",
"jsdoc/newline-after-description",
];

const mappedRuleNames: ConvertedRuleChanges[] = ruleNames.map(ruleName => {
return { ruleName };
});

return {
rules: [...mappedRuleNames],
plugins: ["eslint-plugin-jsdoc"],
};
};
24 changes: 24 additions & 0 deletions src/rules/converters/tests/jsdoc-format.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { convertJSDocFormat } from "../jsdoc-format";

describe(convertJSDocFormat, () => {
test("conversion without arguments", () => {
const result = convertJSDocFormat({
ruleArguments: [],
});

expect(result).toEqual({
rules: [
{
ruleName: "jsdoc/check-alignment",
},
{
ruleName: "jsdoc/require-jsdoc",
},
{
ruleName: "jsdoc/newline-after-description",
},
],
plugins: ["eslint-plugin-jsdoc"],
});
});
});