prettier-plugin-jsdoc
Version:
Prettier plugin for format jsdoc and convert to standard Match with Visual studio and other IDE which support jsdoc.
101 lines (100 loc) • 3.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultOptions = exports.options = exports.parsers = exports.languages = void 0;
const tags_1 = require("./tags");
const parser_1 = require("./parser");
const { parsers: { "babel-ts": babelTs }, } = require("prettier/parser-babel");
// jsdoc-parser
exports.languages = [
{
name: "JavaScript",
parsers: ["jsdoc-parser"],
},
];
exports.parsers = {
"jsdoc-parser": { ...babelTs, parse: parser_1.jsdocParser },
};
exports.options = {
jsdocSpaces: {
type: "int",
category: "jsdoc",
default: 1,
description: "How many spaces will be used to separate tag elements.",
},
jsdocTagsOrder: {
type: "path",
category: "jsdoc",
array: true,
default: [
{
value: [
tags_1.ASYNC,
tags_1.PRIVATE,
tags_1.MEMBEROF,
tags_1.VERSION,
tags_1.AUTHOR,
tags_1.DEPRECATED,
tags_1.SINCE,
tags_1.CATEGORY,
tags_1.DESCRIPTION,
tags_1.EXAMPLE,
tags_1.ABSTRACT,
tags_1.AUGMENTS,
tags_1.CONSTANT,
tags_1.DEFAULT,
tags_1.EXTERNAL,
tags_1.FILE,
tags_1.FIRES,
tags_1.TEMPLATE,
tags_1.FUNCTION,
tags_1.CLASS,
tags_1.TYPEDEF,
tags_1.TYPE,
tags_1.CALLBACK,
tags_1.PROPERTY,
tags_1.PARAM,
tags_1.EXTENDS,
tags_1.MEMBER,
tags_1.SEE,
"other",
tags_1.THROWS,
tags_1.YIELDS,
tags_1.RETURNS,
tags_1.TODO,
],
},
],
description: "Define order of tags.",
},
jsdocDescriptionWithDot: {
type: "boolean",
category: "jsdoc",
default: false,
description: "Should dot be inserted at the end of description",
},
jsdocDescriptionTag: {
type: "boolean",
category: "jsdoc",
default: false,
description: "Should description tag be used",
},
jsdocVerticalAlignment: {
type: "boolean",
category: "jsdoc",
default: false,
description: "Should tags, types, names and description be aligned",
},
jsdocKeepUnParseAbleExampleIndent: {
type: "boolean",
category: "jsdoc",
default: false,
description: "Should unParseAble example (pseudo code or no js code) keep its indentation",
},
};
exports.defaultOptions = {
jsdocSpaces: 1,
jsdocDescriptionWithDot: false,
jsdocDescriptionTag: false,
jsdocVerticalAlignment: false,
jsdocKeepUnParseAbleExampleIndent: false,
};