File tree Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ import { RuleConverter , ConvertedRuleChanges } from "../converter" ;
2+
3+ export const JSDocNoticeMsg =
4+ "ESLint does not support enforcing the first line of multiline JSDoc comments be empty." ;
5+
6+ export const convertJSDocFormat : RuleConverter = ( ) => {
7+ const ruleNames = [
8+ "jsdoc/check-alignment" ,
9+ "jsdoc/check-indentation" ,
10+ "jsdoc/newline-after-description" ,
11+ ] ;
12+
13+ const mappedRuleNames : ConvertedRuleChanges [ ] = ruleNames . map ( ruleName => {
14+ return { ruleName } ;
15+ } ) ;
16+
17+ return {
18+ rules : [ ...mappedRuleNames ] ,
19+ notices : [ JSDocNoticeMsg ] ,
20+ plugins : [ "eslint-plugin-jsdoc" ] ,
21+ } ;
22+ } ;
Original file line number Diff line number Diff line change 1+ import { convertJSDocFormat , JSDocNoticeMsg } from "../jsdoc-format" ;
2+
3+ describe ( convertJSDocFormat , ( ) => {
4+ test ( "conversion without arguments" , ( ) => {
5+ const result = convertJSDocFormat ( {
6+ ruleArguments : [ ] ,
7+ } ) ;
8+
9+ expect ( result ) . toEqual ( {
10+ rules : [
11+ {
12+ ruleName : "jsdoc/check-alignment" ,
13+ } ,
14+ {
15+ ruleName : "jsdoc/check-indentation" ,
16+ } ,
17+ {
18+ ruleName : "jsdoc/newline-after-description" ,
19+ } ,
20+ ] ,
21+ notices : [ JSDocNoticeMsg ] ,
22+ plugins : [ "eslint-plugin-jsdoc" ] ,
23+ } ) ;
24+ } ) ;
25+ } ) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import { convertIncrementDecrement } from "./converters/increment-decrement";
2323import { convertIndent } from "./converters/indent" ;
2424import { convertInterfaceName } from "./converters/interface-name" ;
2525import { convertInterfaceOverTypeLiteral } from "./converters/interface-over-type-literal" ;
26+ import { convertJSDocFormat } from "./converters/jsdoc-format" ;
2627import { convertLabelPosition } from "./converters/label-position" ;
2728import { convertLinebreakStyle } from "./converters/linebreak-style" ;
2829import { convertMaxClassesPerFile } from "./converters/max-classes-per-file" ;
@@ -162,6 +163,7 @@ export const rulesConverters = new Map([
162163 [ "indent" , convertIndent ] ,
163164 [ "interface-name" , convertInterfaceName ] ,
164165 [ "interface-over-type-literal" , convertInterfaceOverTypeLiteral ] ,
166+ [ "jsdoc-format" , convertJSDocFormat ] ,
165167 [ "label-position" , convertLabelPosition ] ,
166168 [ "linebreak-style" , convertLinebreakStyle ] ,
167169 [ "max-classes-per-file" , convertMaxClassesPerFile ] ,
You can’t perform that action at this time.
0 commit comments