eslint-doc-generator
Advanced tools
Comparing version 1.5.3 to 1.5.4
import { BEGIN_RULE_OPTIONS_LIST_MARKER, END_RULE_OPTIONS_LIST_MARKER, } from './comment-markers.js'; | ||
import { markdownTable } from 'markdown-table'; | ||
import { getAllNamedOptions } from './rule-options.js'; | ||
import { capitalizeOnlyFirstLetter, sanitizeMarkdownTable } from './string.js'; | ||
import { sanitizeMarkdownTable } from './string.js'; | ||
export var COLUMN_TYPE; | ||
@@ -50,5 +50,3 @@ (function (COLUMN_TYPE) { | ||
[COLUMN_TYPE.REQUIRED]: ruleOption.required ? 'Yes' : undefined, | ||
[COLUMN_TYPE.TYPE]: ruleOption.type | ||
? capitalizeOnlyFirstLetter(ruleOption.type) | ||
: undefined, | ||
[COLUMN_TYPE.TYPE]: ruleOption.type || undefined, | ||
}; | ||
@@ -55,0 +53,0 @@ return columns; |
import traverse from 'json-schema-traverse'; | ||
import { capitalizeOnlyFirstLetter } from './string.js'; | ||
function typeToString(type) { | ||
return Array.isArray(type) | ||
? type.map((item) => capitalizeOnlyFirstLetter(item)).join(', ') | ||
: capitalizeOnlyFirstLetter(type); | ||
} | ||
/** | ||
@@ -22,5 +28,7 @@ * Gather a list of named options from a rule schema. | ||
value.items?.type | ||
? `${value.items.type.toString()}[]` | ||
? `${Array.isArray(value.items.type) && value.items.type.length > 1 | ||
? `(${typeToString(value.items.type)})` | ||
: typeToString(value.items.type)}[]` | ||
: value.type | ||
? value.type.toString() | ||
? typeToString(value.type) | ||
: undefined, | ||
@@ -27,0 +35,0 @@ description: value.description, |
{ | ||
"name": "eslint-doc-generator", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"description": "Automatic documentation generator for ESLint plugins and rules.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
151086
2594