eslint-plugin-jsdoc 62.3.1 → 62.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -46,6 +46,7 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
46
46
|
// propertyQuotes = null,
|
|
47
47
|
separatorForSingleObjectField = false,
|
|
48
48
|
stringQuotes = 'double',
|
|
49
|
+
trailingPunctuationMultilineOnly = false,
|
|
49
50
|
typeBracketSpacing = '',
|
|
50
51
|
unionSpacing = ' '
|
|
51
52
|
} = context.options[0] || {};
|
|
@@ -315,7 +316,8 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
315
316
|
const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectResult} */nde;
|
|
316
317
|
/* c8 ignore next -- Guard */
|
|
317
318
|
const separator = typeNode.meta.separator ?? 'comma';
|
|
318
|
-
if (separator !== objectFieldSeparator && (!objectFieldSeparatorOptionalLinebreak || !(objectFieldSeparator.endsWith('-linebreak') && objectFieldSeparator.startsWith(separator))) || (typeNode.meta.separatorForSingleObjectField ?? false) !== separatorForSingleObjectField || (typeNode.meta.propertyIndent ?? '') !== objectFieldIndent && separator.endsWith('-linebreak') || (
|
|
319
|
+
if (separator !== objectFieldSeparator && (!objectFieldSeparatorOptionalLinebreak || !(objectFieldSeparator.endsWith('-linebreak') && objectFieldSeparator.startsWith(separator))) || (typeNode.meta.separatorForSingleObjectField ?? false) !== separatorForSingleObjectField || (typeNode.meta.propertyIndent ?? '') !== objectFieldIndent && separator.endsWith('-linebreak') || (/* c8 ignore next 5 -- jsdoc-type-pratt-parser doesn't encode as should */
|
|
320
|
+
(typeNode.meta.trailingPunctuation ?? false) !== objectFieldSeparatorTrailingPunctuation && (typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly || !(0, _jsdoccomment.stringify)(typeNode).includes('\n')) || !typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly || (0, _jsdoccomment.stringify)(typeNode).includes('\n'))))) {
|
|
319
321
|
typeNode.meta.separator = objectFieldSeparatorOptionalLinebreak && !separator.endsWith('and-linebreak') ? objectFieldSeparator.replace(/-and-linebreak$/v, '') : objectFieldSeparator;
|
|
320
322
|
typeNode.meta.separatorForSingleObjectField = separatorForSingleObjectField;
|
|
321
323
|
typeNode.meta.propertyIndent = objectFieldIndent;
|
|
@@ -323,7 +325,8 @@ var _default = exports.default = (0, _iterateJsdoc.default)(({
|
|
|
323
325
|
errorMessage = `Inconsistent ${objectFieldSeparator} separator usage`;
|
|
324
326
|
} else if ((typeNode.meta.bracketSpacing ?? '') !== objectTypeBracketSpacing) {
|
|
325
327
|
typeNode.meta.bracketSpacing = objectTypeBracketSpacing;
|
|
326
|
-
|
|
328
|
+
// This might not be the cause
|
|
329
|
+
// errorMessage = `Object type bracket spacing should be "${objectTypeBracketSpacing}"`;
|
|
327
330
|
}
|
|
328
331
|
break;
|
|
329
332
|
}
|
|
@@ -580,6 +583,10 @@ or \`double\`. Defaults to 'double'.`,
|
|
|
580
583
|
enum: ['double', 'single'],
|
|
581
584
|
type: 'string'
|
|
582
585
|
},
|
|
586
|
+
trailingPunctuationMultilineOnly: {
|
|
587
|
+
description: 'If `objectFieldSeparatorTrailingPunctuation` is set, this will determine whether the trailing puncutation is only added when the type is multiline',
|
|
588
|
+
type: 'boolean'
|
|
589
|
+
},
|
|
583
590
|
typeBracketSpacing: {
|
|
584
591
|
description: `A string of spaces that will be added immediately after the type's initial
|
|
585
592
|
curly bracket and immediately before its ending curly bracket. Defaults
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeFormatting.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","_jsdocUtils","_jsdoccomment","e","__esModule","default","digitRegex","_default","exports","iterateJsdoc","context","indent","jsdoc","settings","utils","arrayBrackets","arrowFunctionPostReturnMarkerSpacing","arrowFunctionPreReturnMarkerSpacing","enableFixer","functionOrClassParameterSpacing","functionOrClassPostGenericSpacing","functionOrClassPostReturnMarkerSpacing","functionOrClassPreReturnMarkerSpacing","functionOrClassTypeParameterSpacing","genericAndTupleElementSpacing","genericDot","keyValuePostColonSpacing","keyValuePostKeySpacing","keyValuePostOptionalSpacing","keyValuePostVariadicSpacing","methodQuotes","objectFieldIndent","objectFieldQuote","objectFieldSeparator","objectFieldSeparatorOptionalLinebreak","objectFieldSeparatorTrailingPunctuation","objectTypeBracketSpacing","parameterDefaultValueSpacing","postMethodNameSpacing","postNewSpacing","separatorForSingleObjectField","stringQuotes","typeBracketSpacing","unionSpacing","options","mode","checkTypeFormats","tag","potentialType","type","parsedType","tryParseType","parseType","fix","rewireByParsedType","errorMessages","startsWith","endsWith","push","test","traverse","nde","errorMessage","conditionalAdds","meta","typNode","newMeta","parameterSpacing","postGenericSpacing","postReturnMarkerSpacing","preReturnMarkerSpacing","typeParameterSpacing","typeNode","arrow","quote","undefined","left","value","brackets","dot","elementSpacing","postKeySpacing","postColonSpacing","postOptionalSpacing","postVariadicSpacing","variadic","separator","propertyIndent","trailingPunctuation","replace","bracketSpacing","key","defaultValue","defaultValueSpacing","spacing","differentResult","stringify","length","reportJSDoc","tags","getPresentTags","iterateAllJsdocs","docs","description","url","fixable","schema","additionalProperties","properties","enum","module"],"sources":["../../src/rules/typeFormatting.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n rewireByParsedType,\n} from '../jsdocUtils.js';\nimport {\n parse as parseType,\n stringify,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\n\nconst digitRegex = (/^(\\d+(\\.\\d*)?|\\.\\d+)([eE][\\-+]?\\d+)?$/v);\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n settings,\n utils,\n// eslint-disable-next-line complexity -- Todo\n}) => {\n const {\n arrayBrackets = 'square',\n arrowFunctionPostReturnMarkerSpacing = ' ',\n arrowFunctionPreReturnMarkerSpacing = ' ',\n enableFixer = true,\n functionOrClassParameterSpacing = ' ',\n functionOrClassPostGenericSpacing = '',\n functionOrClassPostReturnMarkerSpacing = ' ',\n functionOrClassPreReturnMarkerSpacing = '',\n functionOrClassTypeParameterSpacing = ' ',\n genericAndTupleElementSpacing = ' ',\n genericDot = false,\n keyValuePostColonSpacing = ' ',\n keyValuePostKeySpacing = '',\n keyValuePostOptionalSpacing = '',\n keyValuePostVariadicSpacing = '',\n methodQuotes = 'double',\n objectFieldIndent = '',\n objectFieldQuote = null,\n objectFieldSeparator = 'comma',\n objectFieldSeparatorOptionalLinebreak = true,\n objectFieldSeparatorTrailingPunctuation = false,\n objectTypeBracketSpacing = '',\n parameterDefaultValueSpacing = ' ',\n postMethodNameSpacing = '',\n postNewSpacing = ' ',\n // propertyQuotes = null,\n separatorForSingleObjectField = false,\n stringQuotes = 'double',\n typeBracketSpacing = '',\n unionSpacing = ' ',\n } = context.options[0] || {};\n\n const {\n mode,\n } = settings;\n\n /**\n * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} tag\n */\n const checkTypeFormats = (tag) => {\n const potentialType = tag.type;\n let parsedType;\n try {\n parsedType = mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode);\n } catch {\n return;\n }\n\n const fix = () => {\n rewireByParsedType(jsdoc, tag, parsedType, indent, typeBracketSpacing);\n };\n\n /** @type {string[]} */\n const errorMessages = [];\n\n if (typeBracketSpacing && (!tag.type.startsWith(typeBracketSpacing) || !tag.type.endsWith(typeBracketSpacing))) {\n errorMessages.push(`Must have initial and final \"${typeBracketSpacing}\" spacing`);\n } else if (!typeBracketSpacing && ((/^\\s/v).test(tag.type) || (/\\s$/v).test(tag.type))) {\n errorMessages.push('Must have no initial spacing');\n }\n\n // eslint-disable-next-line complexity -- Todo\n traverse(parsedType, (nde) => {\n let errorMessage = '';\n\n /**\n * @param {Partial<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }} meta\n * @returns {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }}\n */\n const conditionalAdds = (meta) => {\n const typNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult|\n * import('jsdoc-type-pratt-parser').CallSignatureResult|\n * import('jsdoc-type-pratt-parser').ComputedMethodResult|\n * import('jsdoc-type-pratt-parser').ConstructorSignatureResult|\n * import('jsdoc-type-pratt-parser').MethodSignatureResult\n * }\n */ (nde);\n\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }}\n */\n const newMeta = {\n parameterSpacing: meta.parameterSpacing ?? typNode.meta?.parameterSpacing ?? ' ',\n postGenericSpacing: meta.postGenericSpacing ?? typNode.meta?.postGenericSpacing ?? '',\n postReturnMarkerSpacing: meta.postReturnMarkerSpacing ?? typNode.meta?.postReturnMarkerSpacing ?? ' ',\n preReturnMarkerSpacing: meta.preReturnMarkerSpacing ?? typNode.meta?.preReturnMarkerSpacing ?? '',\n typeParameterSpacing: meta.typeParameterSpacing ?? typNode.meta?.typeParameterSpacing ?? ' ',\n };\n\n if (typNode.type === 'JsdocTypeConstructorSignature') {\n newMeta.postNewSpacing = meta.postNewSpacing;\n }\n\n if (typNode.type === 'JsdocTypeMethodSignature') {\n newMeta.postMethodNameSpacing = meta.postMethodNameSpacing ?? typNode.meta?.postMethodNameSpacing ?? '';\n }\n\n return newMeta;\n };\n\n switch (nde.type) {\n case 'JsdocTypeConstructorSignature': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ConstructorSignatureResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postNewSpacing ?? ' ') !== postNewSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n postNewSpacing,\n }));\n errorMessage = `Post-\\`new\\` spacing should be \"${postNewSpacing}\"`;\n break;\n }\n }\n\n case 'JsdocTypeFunction': {\n const typeNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult}\n */ nde;\n if ('arrow' in typeNode && typeNode.arrow) {\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postReturnMarkerSpacing ?? ' ') !== arrowFunctionPostReturnMarkerSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n postReturnMarkerSpacing: arrowFunctionPostReturnMarkerSpacing,\n /* c8 ignore next -- Guard */\n preReturnMarkerSpacing: typeNode.meta?.preReturnMarkerSpacing ?? ' ',\n }));\n errorMessage = `Post-return-marker spacing should be \"${arrowFunctionPostReturnMarkerSpacing}\"`;\n break;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.preReturnMarkerSpacing ?? ' ') !== arrowFunctionPreReturnMarkerSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n /* c8 ignore next -- Guard */\n postReturnMarkerSpacing: typeNode.meta?.postReturnMarkerSpacing ?? ' ',\n preReturnMarkerSpacing: arrowFunctionPreReturnMarkerSpacing,\n }));\n errorMessage = `Pre-return-marker spacing should be \"${arrowFunctionPreReturnMarkerSpacing}\"`;\n break;\n }\n\n break;\n }\n }\n\n case 'JsdocTypeCallSignature':\n case 'JsdocTypeComputedMethod':\n case 'JsdocTypeMethodSignature': {\n const typeNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult|\n * import('jsdoc-type-pratt-parser').CallSignatureResult|\n * import('jsdoc-type-pratt-parser').ComputedMethodResult|\n * import('jsdoc-type-pratt-parser').ConstructorSignatureResult|\n * import('jsdoc-type-pratt-parser').MethodSignatureResult\n * }\n */ (nde);\n if (typeNode.type === 'JsdocTypeMethodSignature' &&\n (typeNode.meta?.postMethodNameSpacing ?? '') !== postMethodNameSpacing\n ) {\n typeNode.meta = {\n quote: typeNode.meta.quote,\n ...conditionalAdds({\n postMethodNameSpacing,\n }),\n };\n errorMessage = `Post-method-name spacing should be \"${postMethodNameSpacing}\"`;\n break;\n } else if (typeNode.type === 'JsdocTypeMethodSignature' &&\n typeNode.meta.quote !== undefined &&\n typeNode.meta.quote !== methodQuotes\n ) {\n typeNode.meta = {\n ...conditionalAdds({\n postMethodNameSpacing: typeNode.meta.postMethodNameSpacing ?? '',\n }),\n quote: methodQuotes,\n };\n errorMessage = `Method quoting style should be \"${methodQuotes}\"`;\n break;\n }\n\n if ((typeNode.meta?.parameterSpacing ?? ' ') !== functionOrClassParameterSpacing) {\n typeNode.meta = conditionalAdds({\n parameterSpacing: functionOrClassParameterSpacing,\n });\n errorMessage = `Parameter spacing should be \"${functionOrClassParameterSpacing}\"`;\n } else if ((typeNode.meta?.postGenericSpacing ?? '') !== functionOrClassPostGenericSpacing) {\n typeNode.meta = conditionalAdds({\n postGenericSpacing: functionOrClassPostGenericSpacing,\n });\n errorMessage = `Post-generic spacing should be \"${functionOrClassPostGenericSpacing}\"`;\n } else if ((typeNode.meta?.postReturnMarkerSpacing ?? ' ') !== functionOrClassPostReturnMarkerSpacing) {\n typeNode.meta = conditionalAdds({\n postReturnMarkerSpacing: functionOrClassPostReturnMarkerSpacing,\n });\n errorMessage = `Post-return-marker spacing should be \"${functionOrClassPostReturnMarkerSpacing}\"`;\n } else if ((typeNode.meta?.preReturnMarkerSpacing ?? '') !== functionOrClassPreReturnMarkerSpacing) {\n typeNode.meta = conditionalAdds({\n preReturnMarkerSpacing: functionOrClassPreReturnMarkerSpacing,\n });\n errorMessage = `Pre-return-marker spacing should be \"${functionOrClassPreReturnMarkerSpacing}\"`;\n } else if ((typeNode.meta?.typeParameterSpacing ?? ' ') !== functionOrClassTypeParameterSpacing) {\n typeNode.meta = conditionalAdds({\n typeParameterSpacing: functionOrClassTypeParameterSpacing,\n });\n errorMessage = `Type parameter spacing should be \"${functionOrClassTypeParameterSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeGeneric': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').GenericResult} */ (nde);\n if ('value' in typeNode.left && typeNode.left.value === 'Array') {\n if (typeNode.meta.brackets !== arrayBrackets) {\n typeNode.meta.brackets = arrayBrackets;\n errorMessage = `Array bracket style should be ${arrayBrackets}`;\n }\n } else if (typeNode.meta.dot !== genericDot) {\n typeNode.meta.dot = genericDot;\n errorMessage = `Dot usage should be ${genericDot}`;\n } else if ((typeNode.meta.elementSpacing ?? ' ') !== genericAndTupleElementSpacing) {\n typeNode.meta.elementSpacing = genericAndTupleElementSpacing;\n errorMessage = `Element spacing should be \"${genericAndTupleElementSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeKeyValue': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').KeyValueResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postKeySpacing ?? '') !== keyValuePostKeySpacing) {\n typeNode.meta = {\n /* c8 ignore next -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: keyValuePostKeySpacing,\n /* c8 ignore next 2 -- Guard */\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post key spacing should be \"${keyValuePostKeySpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.postColonSpacing ?? ' ') !== keyValuePostColonSpacing) {\n typeNode.meta = {\n postColonSpacing: keyValuePostColonSpacing,\n /* c8 ignore next 3 -- Guard */\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post colon spacing should be \"${keyValuePostColonSpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.postOptionalSpacing ?? '') !== keyValuePostOptionalSpacing) {\n typeNode.meta = {\n /* c8 ignore next 2 -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: keyValuePostOptionalSpacing,\n /* c8 ignore next -- Guard */\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post optional (\\`?\\`) spacing should be \"${keyValuePostOptionalSpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if (typeNode.variadic && (typeNode.meta?.postVariadicSpacing ?? '') !== keyValuePostVariadicSpacing) {\n typeNode.meta = {\n /* c8 ignore next 3 -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: keyValuePostVariadicSpacing,\n };\n errorMessage = `Post variadic (\\`...\\`) spacing should be \"${keyValuePostVariadicSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeObject': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectResult} */ (nde);\n /* c8 ignore next -- Guard */\n const separator = typeNode.meta.separator ?? 'comma';\n if (\n (separator !== objectFieldSeparator &&\n (!objectFieldSeparatorOptionalLinebreak ||\n !(objectFieldSeparator.endsWith('-linebreak') &&\n objectFieldSeparator.startsWith(separator)))) ||\n (typeNode.meta.separatorForSingleObjectField ?? false) !== separatorForSingleObjectField ||\n ((typeNode.meta.propertyIndent ?? '') !== objectFieldIndent &&\n separator.endsWith('-linebreak')) ||\n (typeNode.meta.trailingPunctuation ?? false) !== objectFieldSeparatorTrailingPunctuation\n ) {\n typeNode.meta.separator = objectFieldSeparatorOptionalLinebreak && !separator.endsWith('and-linebreak') ?\n objectFieldSeparator.replace(/-and-linebreak$/v, '') :\n objectFieldSeparator;\n typeNode.meta.separatorForSingleObjectField = separatorForSingleObjectField;\n typeNode.meta.propertyIndent = objectFieldIndent;\n typeNode.meta.trailingPunctuation = objectFieldSeparatorTrailingPunctuation;\n errorMessage = `Inconsistent ${objectFieldSeparator} separator usage`;\n } else if ((typeNode.meta.bracketSpacing ?? '') !== objectTypeBracketSpacing) {\n typeNode.meta.bracketSpacing = objectTypeBracketSpacing;\n errorMessage = `Object type bracket spacing should be \"${objectTypeBracketSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeObjectField': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectFieldResult} */ (nde);\n if ((objectFieldQuote ||\n (typeof typeNode.key === 'string' &&\n (\n (/^[\\p{ID_Start}$_][\\p{ID_Continue}$\\u200C\\u200D]*$/v).test(typeNode.key) ||\n digitRegex.test(typeNode.key)\n )\n )) &&\n typeNode.meta.quote !== (objectFieldQuote ?? undefined) &&\n (typeof typeNode.key !== 'string' ||\n !digitRegex.test(typeNode.key))\n ) {\n typeNode.meta.quote = objectFieldQuote ?? undefined;\n errorMessage = `Inconsistent object field quotes ${objectFieldQuote}`;\n } else if ((typeNode.meta?.postKeySpacing ?? '') !== keyValuePostKeySpacing) {\n typeNode.meta.postKeySpacing = keyValuePostKeySpacing;\n errorMessage = `Post key spacing should be \"${keyValuePostKeySpacing}\"`;\n } else if ((typeNode.meta?.postColonSpacing ?? ' ') !== keyValuePostColonSpacing) {\n typeNode.meta.postColonSpacing = keyValuePostColonSpacing;\n errorMessage = `Post colon spacing should be \"${keyValuePostColonSpacing}\"`;\n } else if ((typeNode.meta?.postOptionalSpacing ?? '') !== keyValuePostOptionalSpacing) {\n typeNode.meta.postOptionalSpacing = keyValuePostOptionalSpacing;\n errorMessage = `Post optional (\\`?\\`) spacing should be \"${keyValuePostOptionalSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeStringValue': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').StringValueResult} */ (nde);\n if (typeNode.meta.quote !== stringQuotes) {\n typeNode.meta.quote = stringQuotes;\n errorMessage = `Inconsistent ${stringQuotes} string quotes usage`;\n }\n\n break;\n }\n\n // Only suitable for namepaths (and would need changes); see https://github.com/gajus/eslint-plugin-jsdoc/issues/1524\n // case 'JsdocTypeProperty': {\n // const typeNode = /** @type {import('jsdoc-type-pratt-parser').PropertyResult} */ (nde);\n\n // if ((propertyQuotes ||\n // (typeof typeNode.value === 'string' && !(/\\s/v).test(typeNode.value))) &&\n // typeNode.meta.quote !== (propertyQuotes ?? undefined)\n // ) {\n // typeNode.meta.quote = propertyQuotes ?? undefined;\n // errorMessage = `Inconsistent ${propertyQuotes} property quotes usage`;\n // }\n\n // break;\n // }\n\n case 'JsdocTypeTuple': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').TupleResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.elementSpacing ?? ' ') !== genericAndTupleElementSpacing) {\n typeNode.meta = {\n elementSpacing: genericAndTupleElementSpacing,\n };\n errorMessage = `Element spacing should be \"${genericAndTupleElementSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeTypeParameter': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').TypeParameterResult} */ (nde);\n /* c8 ignore next -- Guard */\n if (typeNode.defaultValue && (typeNode.meta?.defaultValueSpacing ?? ' ') !== parameterDefaultValueSpacing) {\n typeNode.meta = {\n defaultValueSpacing: parameterDefaultValueSpacing,\n };\n errorMessage = `Default value spacing should be \"${parameterDefaultValueSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeUnion': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').UnionResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.spacing ?? ' ') !== unionSpacing) {\n typeNode.meta = {\n spacing: unionSpacing,\n };\n errorMessage = `Inconsistent \"${unionSpacing}\" union spacing usage`;\n }\n\n break;\n }\n\n default:\n break;\n }\n\n if (errorMessage) {\n errorMessages.push(errorMessage);\n }\n });\n\n const differentResult = tag.type !==\n typeBracketSpacing + stringify(parsedType) + typeBracketSpacing;\n\n if (errorMessages.length && differentResult) {\n for (const errorMessage of errorMessages) {\n utils.reportJSDoc(\n errorMessage, tag, enableFixer ? fix : null,\n );\n }\n // Stringification may have been equal previously (and thus no error reported)\n // because the stringification doesn't preserve everything\n } else if (differentResult) {\n utils.reportJSDoc(\n 'There was an error with type formatting', tag, enableFixer ? fix : null,\n );\n }\n };\n\n const tags = utils.getPresentTags([\n 'param',\n 'property',\n 'returns',\n 'this',\n 'throws',\n 'type',\n 'typedef',\n 'yields',\n ]);\n for (const tag of tags) {\n if (tag.type) {\n checkTypeFormats(tag);\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Formats JSDoc type values.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/type-formatting.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n arrayBrackets: {\n description: 'Determines how array generics are represented. Set to `angle` for the style `Array<type>` or `square` for the style `type[]`. Defaults to \"square\".',\n enum: [\n 'angle',\n 'square',\n ],\n type: 'string',\n },\n arrowFunctionPostReturnMarkerSpacing: {\n description: 'The space character (if any) to use after return markers (`=>`). Defaults to \" \".',\n type: 'string',\n },\n arrowFunctionPreReturnMarkerSpacing: {\n description: 'The space character (if any) to use before return markers (`=>`). Defaults to \" \".',\n type: 'string',\n },\n enableFixer: {\n description: 'Whether to enable the fixer. Defaults to `true`.',\n type: 'boolean',\n },\n functionOrClassParameterSpacing: {\n description: 'The space character (if any) to use between function or class parameters. Defaults to \" \".',\n type: 'string',\n },\n functionOrClassPostGenericSpacing: {\n description: 'The space character (if any) to use after a generic expression in a function or class. Defaults to \"\".',\n type: 'string',\n },\n functionOrClassPostReturnMarkerSpacing: {\n description: 'The space character (if any) to use after return markers (`:`). Defaults to \"\".',\n type: 'string',\n },\n functionOrClassPreReturnMarkerSpacing: {\n description: 'The space character (if any) to use before return markers (`:`). Defaults to \"\".',\n type: 'string',\n },\n functionOrClassTypeParameterSpacing: {\n description: 'The space character (if any) to use between type parameters in a function or class. Defaults to \" \".',\n type: 'string',\n },\n genericAndTupleElementSpacing: {\n description: 'The space character (if any) to use between elements in generics and tuples. Defaults to \" \".',\n type: 'string',\n },\n genericDot: {\n description: 'Boolean value of whether to use a dot before the angled brackets of a generic (e.g., `SomeType.<AnotherType>`). Defaults to `false`.',\n type: 'boolean',\n },\n keyValuePostColonSpacing: {\n description: 'The amount of spacing (if any) after the colon of a key-value or object-field pair. Defaults to \" \".',\n type: 'string',\n },\n keyValuePostKeySpacing: {\n description: 'The amount of spacing (if any) immediately after keys in a key-value or object-field pair. Defaults to \"\".',\n type: 'string',\n },\n keyValuePostOptionalSpacing: {\n description: 'The amount of spacing (if any) after the optional operator (`?`) in a key-value or object-field pair. Defaults to \"\".',\n type: 'string',\n },\n keyValuePostVariadicSpacing: {\n description: 'The amount of spacing (if any) after a variadic operator (`...`) in a key-value pair. Defaults to \"\".',\n type: 'string',\n },\n methodQuotes: {\n description: 'The style of quotation mark for surrounding method names when quoted. Defaults to `double`',\n enum: [\n 'double',\n 'single',\n ],\n type: 'string',\n },\n objectFieldIndent: {\n description: `A string indicating the whitespace to be added on each line preceding an\nobject property-value field. Defaults to the empty string.`,\n type: 'string',\n },\n objectFieldQuote: {\n description: `Whether and how object field properties should be quoted (e.g., \\`{\"a\": string}\\`).\nSet to \\`single\\`, \\`double\\`, or \\`null\\`. Defaults to \\`null\\` (no quotes unless\nrequired due to special characters within the field). Digits will be kept as is,\nregardless of setting (they can either represent a digit or a string digit).`,\n enum: [\n 'double',\n 'single',\n null,\n ],\n },\n objectFieldSeparator: {\n description: `For object properties, specify whether a \"semicolon\", \"comma\", \"linebreak\",\n\"semicolon-and-linebreak\", or \"comma-and-linebreak\" should be used after\neach object property-value pair.\n\nDefaults to \\`\"comma\"\\`.`,\n enum: [\n 'comma',\n 'comma-and-linebreak',\n 'linebreak',\n 'semicolon',\n 'semicolon-and-linebreak',\n ],\n type: 'string',\n },\n objectFieldSeparatorOptionalLinebreak: {\n description: `Whether \\`objectFieldSeparator\\` set to \\`\"semicolon-and-linebreak\"\\` or\n\\`\"comma-and-linebreak\"\\` should be allowed to optionally drop the linebreak.\n\nDefaults to \\`true\\`.`,\n type: 'boolean',\n },\n objectFieldSeparatorTrailingPunctuation: {\n description: `If \\`separatorForSingleObjectField\\` is not in effect (i.e., if it is \\`false\\`\nor there are multiple property-value object fields present), this property\nwill determine whether to add punctuation corresponding to the\n\\`objectFieldSeparator\\` (e.g., a semicolon) to the final object field.\nDefaults to \\`false\\`.`,\n type: 'boolean',\n },\n objectTypeBracketSpacing: {\n description: 'The space character (if any) to add after an object\\'s initial curly bracket and before its ending curly bracket',\n type: 'string',\n },\n parameterDefaultValueSpacing: {\n description: 'The space character (if any) to use between the equal signs of a default value. Defaults to \" \".',\n type: 'string',\n },\n postMethodNameSpacing: {\n description: 'The space character (if any) to add after a method name. Defaults to \"\".',\n type: 'string',\n },\n postNewSpacing: {\n description: 'The space character (if any) to add after \"new\" in a constructor. Defaults to \" \".',\n type: 'string',\n },\n // propertyQuotes: {\n // description: `Whether and how namepath properties should be quoted (e.g., \\`ab.\"cd\".\"ef\"\\`).\n // Set to \\`single\\`, \\`double\\`, or \\`null\\`. Defaults to \\`null\\` (no quotes unless\n // required due to whitespace within the property).`,\n // enum: [\n // 'double',\n // 'single',\n // null,\n // ],\n // },\n separatorForSingleObjectField: {\n description: `Whether to apply the \\`objectFieldSeparator\\` (e.g., a semicolon) when there\nis only one property-value object field present. Defaults to \\`false\\`.`,\n type: 'boolean',\n },\n stringQuotes: {\n description: `How string literals should be quoted (e.g., \\`\"abc\"\\`). Set to \\`single\\`\nor \\`double\\`. Defaults to 'double'.`,\n enum: [\n 'double',\n 'single',\n ],\n type: 'string',\n },\n typeBracketSpacing: {\n description: `A string of spaces that will be added immediately after the type's initial\ncurly bracket and immediately before its ending curly bracket. Defaults\nto the empty string.`,\n type: 'string',\n },\n unionSpacing: {\n description: 'Determines the spacing to add to unions (`|`). Defaults to a single space (`\" \"`).',\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAGA,IAAAE,aAAA,GAAAF,OAAA;AAK8B,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9B,MAAMG,UAAU,GAAI,wCAAyC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAE/C,IAAAI,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,MAAM;EACNC,KAAK;EACLC,QAAQ;EACRC;EACF;AACA,CAAC,KAAK;EACJ,MAAM;IACJC,aAAa,GAAG,QAAQ;IACxBC,oCAAoC,GAAG,GAAG;IAC1CC,mCAAmC,GAAG,GAAG;IACzCC,WAAW,GAAG,IAAI;IAClBC,+BAA+B,GAAG,GAAG;IACrCC,iCAAiC,GAAG,EAAE;IACtCC,sCAAsC,GAAG,GAAG;IAC5CC,qCAAqC,GAAG,EAAE;IAC1CC,mCAAmC,GAAG,GAAG;IACzCC,6BAA6B,GAAG,GAAG;IACnCC,UAAU,GAAG,KAAK;IAClBC,wBAAwB,GAAG,GAAG;IAC9BC,sBAAsB,GAAG,EAAE;IAC3BC,2BAA2B,GAAG,EAAE;IAChCC,2BAA2B,GAAG,EAAE;IAChCC,YAAY,GAAG,QAAQ;IACvBC,iBAAiB,GAAG,EAAE;IACtBC,gBAAgB,GAAG,IAAI;IACvBC,oBAAoB,GAAG,OAAO;IAC9BC,qCAAqC,GAAG,IAAI;IAC5CC,uCAAuC,GAAG,KAAK;IAC/CC,wBAAwB,GAAG,EAAE;IAC7BC,4BAA4B,GA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ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"typeFormatting.cjs","names":["_iterateJsdoc","_interopRequireDefault","require","_jsdocUtils","_jsdoccomment","e","__esModule","default","digitRegex","_default","exports","iterateJsdoc","context","indent","jsdoc","settings","utils","arrayBrackets","arrowFunctionPostReturnMarkerSpacing","arrowFunctionPreReturnMarkerSpacing","enableFixer","functionOrClassParameterSpacing","functionOrClassPostGenericSpacing","functionOrClassPostReturnMarkerSpacing","functionOrClassPreReturnMarkerSpacing","functionOrClassTypeParameterSpacing","genericAndTupleElementSpacing","genericDot","keyValuePostColonSpacing","keyValuePostKeySpacing","keyValuePostOptionalSpacing","keyValuePostVariadicSpacing","methodQuotes","objectFieldIndent","objectFieldQuote","objectFieldSeparator","objectFieldSeparatorOptionalLinebreak","objectFieldSeparatorTrailingPunctuation","objectTypeBracketSpacing","parameterDefaultValueSpacing","postMethodNameSpacing","postNewSpacing","separatorForSingleObjectField","stringQuotes","trailingPunctuationMultilineOnly","typeBracketSpacing","unionSpacing","options","mode","checkTypeFormats","tag","potentialType","type","parsedType","tryParseType","parseType","fix","rewireByParsedType","errorMessages","startsWith","endsWith","push","test","traverse","nde","errorMessage","conditionalAdds","meta","typNode","newMeta","parameterSpacing","postGenericSpacing","postReturnMarkerSpacing","preReturnMarkerSpacing","typeParameterSpacing","typeNode","arrow","quote","undefined","left","value","brackets","dot","elementSpacing","postKeySpacing","postColonSpacing","postOptionalSpacing","postVariadicSpacing","variadic","separator","propertyIndent","trailingPunctuation","stringify","includes","replace","bracketSpacing","key","defaultValue","defaultValueSpacing","spacing","differentResult","length","reportJSDoc","tags","getPresentTags","iterateAllJsdocs","docs","description","url","fixable","schema","additionalProperties","properties","enum","module"],"sources":["../../src/rules/typeFormatting.js"],"sourcesContent":["import iterateJsdoc from '../iterateJsdoc.js';\nimport {\n rewireByParsedType,\n} from '../jsdocUtils.js';\nimport {\n parse as parseType,\n stringify,\n traverse,\n tryParse as tryParseType,\n} from '@es-joy/jsdoccomment';\n\nconst digitRegex = (/^(\\d+(\\.\\d*)?|\\.\\d+)([eE][\\-+]?\\d+)?$/v);\n\nexport default iterateJsdoc(({\n context,\n indent,\n jsdoc,\n settings,\n utils,\n// eslint-disable-next-line complexity -- Todo\n}) => {\n const {\n arrayBrackets = 'square',\n arrowFunctionPostReturnMarkerSpacing = ' ',\n arrowFunctionPreReturnMarkerSpacing = ' ',\n enableFixer = true,\n functionOrClassParameterSpacing = ' ',\n functionOrClassPostGenericSpacing = '',\n functionOrClassPostReturnMarkerSpacing = ' ',\n functionOrClassPreReturnMarkerSpacing = '',\n functionOrClassTypeParameterSpacing = ' ',\n genericAndTupleElementSpacing = ' ',\n genericDot = false,\n keyValuePostColonSpacing = ' ',\n keyValuePostKeySpacing = '',\n keyValuePostOptionalSpacing = '',\n keyValuePostVariadicSpacing = '',\n methodQuotes = 'double',\n objectFieldIndent = '',\n objectFieldQuote = null,\n objectFieldSeparator = 'comma',\n objectFieldSeparatorOptionalLinebreak = true,\n objectFieldSeparatorTrailingPunctuation = false,\n objectTypeBracketSpacing = '',\n parameterDefaultValueSpacing = ' ',\n postMethodNameSpacing = '',\n postNewSpacing = ' ',\n // propertyQuotes = null,\n separatorForSingleObjectField = false,\n stringQuotes = 'double',\n trailingPunctuationMultilineOnly = false,\n typeBracketSpacing = '',\n unionSpacing = ' ',\n } = context.options[0] || {};\n\n const {\n mode,\n } = settings;\n\n /**\n * @param {import('@es-joy/jsdoccomment').JsdocTagWithInline} tag\n */\n const checkTypeFormats = (tag) => {\n const potentialType = tag.type;\n let parsedType;\n try {\n parsedType = mode === 'permissive' ?\n tryParseType(/** @type {string} */ (potentialType)) :\n parseType(/** @type {string} */ (potentialType), mode);\n } catch {\n return;\n }\n\n const fix = () => {\n rewireByParsedType(jsdoc, tag, parsedType, indent, typeBracketSpacing);\n };\n\n /** @type {string[]} */\n const errorMessages = [];\n\n if (typeBracketSpacing && (!tag.type.startsWith(typeBracketSpacing) || !tag.type.endsWith(typeBracketSpacing))) {\n errorMessages.push(`Must have initial and final \"${typeBracketSpacing}\" spacing`);\n } else if (!typeBracketSpacing && ((/^\\s/v).test(tag.type) || (/\\s$/v).test(tag.type))) {\n errorMessages.push('Must have no initial spacing');\n }\n\n // eslint-disable-next-line complexity -- Todo\n traverse(parsedType, (nde) => {\n let errorMessage = '';\n\n /**\n * @param {Partial<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }} meta\n * @returns {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }}\n */\n const conditionalAdds = (meta) => {\n const typNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult|\n * import('jsdoc-type-pratt-parser').CallSignatureResult|\n * import('jsdoc-type-pratt-parser').ComputedMethodResult|\n * import('jsdoc-type-pratt-parser').ConstructorSignatureResult|\n * import('jsdoc-type-pratt-parser').MethodSignatureResult\n * }\n */ (nde);\n\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing?: string,\n * postMethodNameSpacing?: string\n * }}\n */\n const newMeta = {\n parameterSpacing: meta.parameterSpacing ?? typNode.meta?.parameterSpacing ?? ' ',\n postGenericSpacing: meta.postGenericSpacing ?? typNode.meta?.postGenericSpacing ?? '',\n postReturnMarkerSpacing: meta.postReturnMarkerSpacing ?? typNode.meta?.postReturnMarkerSpacing ?? ' ',\n preReturnMarkerSpacing: meta.preReturnMarkerSpacing ?? typNode.meta?.preReturnMarkerSpacing ?? '',\n typeParameterSpacing: meta.typeParameterSpacing ?? typNode.meta?.typeParameterSpacing ?? ' ',\n };\n\n if (typNode.type === 'JsdocTypeConstructorSignature') {\n newMeta.postNewSpacing = meta.postNewSpacing;\n }\n\n if (typNode.type === 'JsdocTypeMethodSignature') {\n newMeta.postMethodNameSpacing = meta.postMethodNameSpacing ?? typNode.meta?.postMethodNameSpacing ?? '';\n }\n\n return newMeta;\n };\n\n switch (nde.type) {\n case 'JsdocTypeConstructorSignature': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ConstructorSignatureResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postNewSpacing ?? ' ') !== postNewSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n postNewSpacing,\n }));\n errorMessage = `Post-\\`new\\` spacing should be \"${postNewSpacing}\"`;\n break;\n }\n }\n\n case 'JsdocTypeFunction': {\n const typeNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult}\n */ nde;\n if ('arrow' in typeNode && typeNode.arrow) {\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postReturnMarkerSpacing ?? ' ') !== arrowFunctionPostReturnMarkerSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n postReturnMarkerSpacing: arrowFunctionPostReturnMarkerSpacing,\n /* c8 ignore next -- Guard */\n preReturnMarkerSpacing: typeNode.meta?.preReturnMarkerSpacing ?? ' ',\n }));\n errorMessage = `Post-return-marker spacing should be \"${arrowFunctionPostReturnMarkerSpacing}\"`;\n break;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.preReturnMarkerSpacing ?? ' ') !== arrowFunctionPreReturnMarkerSpacing) {\n typeNode.meta =\n /**\n * @type {Required<import('jsdoc-type-pratt-parser').FunctionResult['meta']> & {\n * postNewSpacing: string,\n * }}\n */ (conditionalAdds({\n /* c8 ignore next -- Guard */\n postReturnMarkerSpacing: typeNode.meta?.postReturnMarkerSpacing ?? ' ',\n preReturnMarkerSpacing: arrowFunctionPreReturnMarkerSpacing,\n }));\n errorMessage = `Pre-return-marker spacing should be \"${arrowFunctionPreReturnMarkerSpacing}\"`;\n break;\n }\n\n break;\n }\n }\n\n case 'JsdocTypeCallSignature':\n case 'JsdocTypeComputedMethod':\n case 'JsdocTypeMethodSignature': {\n const typeNode =\n /**\n * @type {import('jsdoc-type-pratt-parser').FunctionResult|\n * import('jsdoc-type-pratt-parser').CallSignatureResult|\n * import('jsdoc-type-pratt-parser').ComputedMethodResult|\n * import('jsdoc-type-pratt-parser').ConstructorSignatureResult|\n * import('jsdoc-type-pratt-parser').MethodSignatureResult\n * }\n */ (nde);\n if (typeNode.type === 'JsdocTypeMethodSignature' &&\n (typeNode.meta?.postMethodNameSpacing ?? '') !== postMethodNameSpacing\n ) {\n typeNode.meta = {\n quote: typeNode.meta.quote,\n ...conditionalAdds({\n postMethodNameSpacing,\n }),\n };\n errorMessage = `Post-method-name spacing should be \"${postMethodNameSpacing}\"`;\n break;\n } else if (typeNode.type === 'JsdocTypeMethodSignature' &&\n typeNode.meta.quote !== undefined &&\n typeNode.meta.quote !== methodQuotes\n ) {\n typeNode.meta = {\n ...conditionalAdds({\n postMethodNameSpacing: typeNode.meta.postMethodNameSpacing ?? '',\n }),\n quote: methodQuotes,\n };\n errorMessage = `Method quoting style should be \"${methodQuotes}\"`;\n break;\n }\n\n if ((typeNode.meta?.parameterSpacing ?? ' ') !== functionOrClassParameterSpacing) {\n typeNode.meta = conditionalAdds({\n parameterSpacing: functionOrClassParameterSpacing,\n });\n errorMessage = `Parameter spacing should be \"${functionOrClassParameterSpacing}\"`;\n } else if ((typeNode.meta?.postGenericSpacing ?? '') !== functionOrClassPostGenericSpacing) {\n typeNode.meta = conditionalAdds({\n postGenericSpacing: functionOrClassPostGenericSpacing,\n });\n errorMessage = `Post-generic spacing should be \"${functionOrClassPostGenericSpacing}\"`;\n } else if ((typeNode.meta?.postReturnMarkerSpacing ?? ' ') !== functionOrClassPostReturnMarkerSpacing) {\n typeNode.meta = conditionalAdds({\n postReturnMarkerSpacing: functionOrClassPostReturnMarkerSpacing,\n });\n errorMessage = `Post-return-marker spacing should be \"${functionOrClassPostReturnMarkerSpacing}\"`;\n } else if ((typeNode.meta?.preReturnMarkerSpacing ?? '') !== functionOrClassPreReturnMarkerSpacing) {\n typeNode.meta = conditionalAdds({\n preReturnMarkerSpacing: functionOrClassPreReturnMarkerSpacing,\n });\n errorMessage = `Pre-return-marker spacing should be \"${functionOrClassPreReturnMarkerSpacing}\"`;\n } else if ((typeNode.meta?.typeParameterSpacing ?? ' ') !== functionOrClassTypeParameterSpacing) {\n typeNode.meta = conditionalAdds({\n typeParameterSpacing: functionOrClassTypeParameterSpacing,\n });\n errorMessage = `Type parameter spacing should be \"${functionOrClassTypeParameterSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeGeneric': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').GenericResult} */ (nde);\n if ('value' in typeNode.left && typeNode.left.value === 'Array') {\n if (typeNode.meta.brackets !== arrayBrackets) {\n typeNode.meta.brackets = arrayBrackets;\n errorMessage = `Array bracket style should be ${arrayBrackets}`;\n }\n } else if (typeNode.meta.dot !== genericDot) {\n typeNode.meta.dot = genericDot;\n errorMessage = `Dot usage should be ${genericDot}`;\n } else if ((typeNode.meta.elementSpacing ?? ' ') !== genericAndTupleElementSpacing) {\n typeNode.meta.elementSpacing = genericAndTupleElementSpacing;\n errorMessage = `Element spacing should be \"${genericAndTupleElementSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeKeyValue': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').KeyValueResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.postKeySpacing ?? '') !== keyValuePostKeySpacing) {\n typeNode.meta = {\n /* c8 ignore next -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: keyValuePostKeySpacing,\n /* c8 ignore next 2 -- Guard */\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post key spacing should be \"${keyValuePostKeySpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.postColonSpacing ?? ' ') !== keyValuePostColonSpacing) {\n typeNode.meta = {\n postColonSpacing: keyValuePostColonSpacing,\n /* c8 ignore next 3 -- Guard */\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post colon spacing should be \"${keyValuePostColonSpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if ((typeNode.meta?.postOptionalSpacing ?? '') !== keyValuePostOptionalSpacing) {\n typeNode.meta = {\n /* c8 ignore next 2 -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: keyValuePostOptionalSpacing,\n /* c8 ignore next -- Guard */\n postVariadicSpacing: typeNode.meta?.postVariadicSpacing ?? '',\n };\n errorMessage = `Post optional (\\`?\\`) spacing should be \"${keyValuePostOptionalSpacing}\"`;\n /* c8 ignore next -- Guard */\n } else if (typeNode.variadic && (typeNode.meta?.postVariadicSpacing ?? '') !== keyValuePostVariadicSpacing) {\n typeNode.meta = {\n /* c8 ignore next 3 -- Guard */\n postColonSpacing: typeNode.meta?.postColonSpacing ?? ' ',\n postKeySpacing: typeNode.meta?.postKeySpacing ?? '',\n postOptionalSpacing: typeNode.meta?.postOptionalSpacing ?? '',\n postVariadicSpacing: keyValuePostVariadicSpacing,\n };\n errorMessage = `Post variadic (\\`...\\`) spacing should be \"${keyValuePostVariadicSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeObject': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectResult} */ (nde);\n /* c8 ignore next -- Guard */\n const separator = typeNode.meta.separator ?? 'comma';\n\n if (\n (separator !== objectFieldSeparator &&\n (!objectFieldSeparatorOptionalLinebreak ||\n !(objectFieldSeparator.endsWith('-linebreak') &&\n objectFieldSeparator.startsWith(separator)))) ||\n (typeNode.meta.separatorForSingleObjectField ?? false) !== separatorForSingleObjectField ||\n ((typeNode.meta.propertyIndent ?? '') !== objectFieldIndent &&\n separator.endsWith('-linebreak')) ||\n /* c8 ignore next 5 -- jsdoc-type-pratt-parser doesn't encode as should */\n ((typeNode.meta.trailingPunctuation ?? false) !== objectFieldSeparatorTrailingPunctuation &&\n ((typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly ||\n !stringify(typeNode).includes('\\n'))) ||\n (!typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly ||\n stringify(typeNode).includes('\\n')))))\n ) {\n typeNode.meta.separator = objectFieldSeparatorOptionalLinebreak && !separator.endsWith('and-linebreak') ?\n objectFieldSeparator.replace(/-and-linebreak$/v, '') :\n objectFieldSeparator;\n typeNode.meta.separatorForSingleObjectField = separatorForSingleObjectField;\n typeNode.meta.propertyIndent = objectFieldIndent;\n typeNode.meta.trailingPunctuation = objectFieldSeparatorTrailingPunctuation;\n errorMessage = `Inconsistent ${objectFieldSeparator} separator usage`;\n } else if ((typeNode.meta.bracketSpacing ?? '') !== objectTypeBracketSpacing) {\n typeNode.meta.bracketSpacing = objectTypeBracketSpacing;\n // This might not be the cause\n // errorMessage = `Object type bracket spacing should be \"${objectTypeBracketSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeObjectField': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectFieldResult} */ (nde);\n if ((objectFieldQuote ||\n (typeof typeNode.key === 'string' &&\n (\n (/^[\\p{ID_Start}$_][\\p{ID_Continue}$\\u200C\\u200D]*$/v).test(typeNode.key) ||\n digitRegex.test(typeNode.key)\n )\n )) &&\n typeNode.meta.quote !== (objectFieldQuote ?? undefined) &&\n (typeof typeNode.key !== 'string' ||\n !digitRegex.test(typeNode.key))\n ) {\n typeNode.meta.quote = objectFieldQuote ?? undefined;\n errorMessage = `Inconsistent object field quotes ${objectFieldQuote}`;\n } else if ((typeNode.meta?.postKeySpacing ?? '') !== keyValuePostKeySpacing) {\n typeNode.meta.postKeySpacing = keyValuePostKeySpacing;\n errorMessage = `Post key spacing should be \"${keyValuePostKeySpacing}\"`;\n } else if ((typeNode.meta?.postColonSpacing ?? ' ') !== keyValuePostColonSpacing) {\n typeNode.meta.postColonSpacing = keyValuePostColonSpacing;\n errorMessage = `Post colon spacing should be \"${keyValuePostColonSpacing}\"`;\n } else if ((typeNode.meta?.postOptionalSpacing ?? '') !== keyValuePostOptionalSpacing) {\n typeNode.meta.postOptionalSpacing = keyValuePostOptionalSpacing;\n errorMessage = `Post optional (\\`?\\`) spacing should be \"${keyValuePostOptionalSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeStringValue': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').StringValueResult} */ (nde);\n if (typeNode.meta.quote !== stringQuotes) {\n typeNode.meta.quote = stringQuotes;\n errorMessage = `Inconsistent ${stringQuotes} string quotes usage`;\n }\n\n break;\n }\n\n // Only suitable for namepaths (and would need changes); see https://github.com/gajus/eslint-plugin-jsdoc/issues/1524\n // case 'JsdocTypeProperty': {\n // const typeNode = /** @type {import('jsdoc-type-pratt-parser').PropertyResult} */ (nde);\n\n // if ((propertyQuotes ||\n // (typeof typeNode.value === 'string' && !(/\\s/v).test(typeNode.value))) &&\n // typeNode.meta.quote !== (propertyQuotes ?? undefined)\n // ) {\n // typeNode.meta.quote = propertyQuotes ?? undefined;\n // errorMessage = `Inconsistent ${propertyQuotes} property quotes usage`;\n // }\n\n // break;\n // }\n\n case 'JsdocTypeTuple': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').TupleResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.elementSpacing ?? ' ') !== genericAndTupleElementSpacing) {\n typeNode.meta = {\n elementSpacing: genericAndTupleElementSpacing,\n };\n errorMessage = `Element spacing should be \"${genericAndTupleElementSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeTypeParameter': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').TypeParameterResult} */ (nde);\n /* c8 ignore next -- Guard */\n if (typeNode.defaultValue && (typeNode.meta?.defaultValueSpacing ?? ' ') !== parameterDefaultValueSpacing) {\n typeNode.meta = {\n defaultValueSpacing: parameterDefaultValueSpacing,\n };\n errorMessage = `Default value spacing should be \"${parameterDefaultValueSpacing}\"`;\n }\n\n break;\n }\n\n case 'JsdocTypeUnion': {\n const typeNode = /** @type {import('jsdoc-type-pratt-parser').UnionResult} */ (nde);\n /* c8 ignore next -- Guard */\n if ((typeNode.meta?.spacing ?? ' ') !== unionSpacing) {\n typeNode.meta = {\n spacing: unionSpacing,\n };\n errorMessage = `Inconsistent \"${unionSpacing}\" union spacing usage`;\n }\n\n break;\n }\n\n default:\n break;\n }\n\n if (errorMessage) {\n errorMessages.push(errorMessage);\n }\n });\n\n const differentResult = tag.type !==\n typeBracketSpacing + stringify(parsedType) + typeBracketSpacing;\n\n if (errorMessages.length && differentResult) {\n for (const errorMessage of errorMessages) {\n utils.reportJSDoc(\n errorMessage, tag, enableFixer ? fix : null,\n );\n }\n // Stringification may have been equal previously (and thus no error reported)\n // because the stringification doesn't preserve everything\n } else if (differentResult) {\n utils.reportJSDoc(\n 'There was an error with type formatting', tag, enableFixer ? fix : null,\n );\n }\n };\n\n const tags = utils.getPresentTags([\n 'param',\n 'property',\n 'returns',\n 'this',\n 'throws',\n 'type',\n 'typedef',\n 'yields',\n ]);\n for (const tag of tags) {\n if (tag.type) {\n checkTypeFormats(tag);\n }\n }\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Formats JSDoc type values.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/type-formatting.md#repos-sticky-header',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n arrayBrackets: {\n description: 'Determines how array generics are represented. Set to `angle` for the style `Array<type>` or `square` for the style `type[]`. Defaults to \"square\".',\n enum: [\n 'angle',\n 'square',\n ],\n type: 'string',\n },\n arrowFunctionPostReturnMarkerSpacing: {\n description: 'The space character (if any) to use after return markers (`=>`). Defaults to \" \".',\n type: 'string',\n },\n arrowFunctionPreReturnMarkerSpacing: {\n description: 'The space character (if any) to use before return markers (`=>`). Defaults to \" \".',\n type: 'string',\n },\n enableFixer: {\n description: 'Whether to enable the fixer. Defaults to `true`.',\n type: 'boolean',\n },\n functionOrClassParameterSpacing: {\n description: 'The space character (if any) to use between function or class parameters. Defaults to \" \".',\n type: 'string',\n },\n functionOrClassPostGenericSpacing: {\n description: 'The space character (if any) to use after a generic expression in a function or class. Defaults to \"\".',\n type: 'string',\n },\n functionOrClassPostReturnMarkerSpacing: {\n description: 'The space character (if any) to use after return markers (`:`). Defaults to \"\".',\n type: 'string',\n },\n functionOrClassPreReturnMarkerSpacing: {\n description: 'The space character (if any) to use before return markers (`:`). Defaults to \"\".',\n type: 'string',\n },\n functionOrClassTypeParameterSpacing: {\n description: 'The space character (if any) to use between type parameters in a function or class. Defaults to \" \".',\n type: 'string',\n },\n genericAndTupleElementSpacing: {\n description: 'The space character (if any) to use between elements in generics and tuples. Defaults to \" \".',\n type: 'string',\n },\n genericDot: {\n description: 'Boolean value of whether to use a dot before the angled brackets of a generic (e.g., `SomeType.<AnotherType>`). Defaults to `false`.',\n type: 'boolean',\n },\n keyValuePostColonSpacing: {\n description: 'The amount of spacing (if any) after the colon of a key-value or object-field pair. Defaults to \" \".',\n type: 'string',\n },\n keyValuePostKeySpacing: {\n description: 'The amount of spacing (if any) immediately after keys in a key-value or object-field pair. Defaults to \"\".',\n type: 'string',\n },\n keyValuePostOptionalSpacing: {\n description: 'The amount of spacing (if any) after the optional operator (`?`) in a key-value or object-field pair. Defaults to \"\".',\n type: 'string',\n },\n keyValuePostVariadicSpacing: {\n description: 'The amount of spacing (if any) after a variadic operator (`...`) in a key-value pair. Defaults to \"\".',\n type: 'string',\n },\n methodQuotes: {\n description: 'The style of quotation mark for surrounding method names when quoted. Defaults to `double`',\n enum: [\n 'double',\n 'single',\n ],\n type: 'string',\n },\n objectFieldIndent: {\n description: `A string indicating the whitespace to be added on each line preceding an\nobject property-value field. Defaults to the empty string.`,\n type: 'string',\n },\n objectFieldQuote: {\n description: `Whether and how object field properties should be quoted (e.g., \\`{\"a\": string}\\`).\nSet to \\`single\\`, \\`double\\`, or \\`null\\`. Defaults to \\`null\\` (no quotes unless\nrequired due to special characters within the field). Digits will be kept as is,\nregardless of setting (they can either represent a digit or a string digit).`,\n enum: [\n 'double',\n 'single',\n null,\n ],\n },\n objectFieldSeparator: {\n description: `For object properties, specify whether a \"semicolon\", \"comma\", \"linebreak\",\n\"semicolon-and-linebreak\", or \"comma-and-linebreak\" should be used after\neach object property-value pair.\n\nDefaults to \\`\"comma\"\\`.`,\n enum: [\n 'comma',\n 'comma-and-linebreak',\n 'linebreak',\n 'semicolon',\n 'semicolon-and-linebreak',\n ],\n type: 'string',\n },\n objectFieldSeparatorOptionalLinebreak: {\n description: `Whether \\`objectFieldSeparator\\` set to \\`\"semicolon-and-linebreak\"\\` or\n\\`\"comma-and-linebreak\"\\` should be allowed to optionally drop the linebreak.\n\nDefaults to \\`true\\`.`,\n type: 'boolean',\n },\n objectFieldSeparatorTrailingPunctuation: {\n description: `If \\`separatorForSingleObjectField\\` is not in effect (i.e., if it is \\`false\\`\nor there are multiple property-value object fields present), this property\nwill determine whether to add punctuation corresponding to the\n\\`objectFieldSeparator\\` (e.g., a semicolon) to the final object field.\nDefaults to \\`false\\`.`,\n type: 'boolean',\n },\n objectTypeBracketSpacing: {\n description: 'The space character (if any) to add after an object\\'s initial curly bracket and before its ending curly bracket',\n type: 'string',\n },\n parameterDefaultValueSpacing: {\n description: 'The space character (if any) to use between the equal signs of a default value. Defaults to \" \".',\n type: 'string',\n },\n postMethodNameSpacing: {\n description: 'The space character (if any) to add after a method name. Defaults to \"\".',\n type: 'string',\n },\n postNewSpacing: {\n description: 'The space character (if any) to add after \"new\" in a constructor. Defaults to \" \".',\n type: 'string',\n },\n // propertyQuotes: {\n // description: `Whether and how namepath properties should be quoted (e.g., \\`ab.\"cd\".\"ef\"\\`).\n // Set to \\`single\\`, \\`double\\`, or \\`null\\`. Defaults to \\`null\\` (no quotes unless\n // required due to whitespace within the property).`,\n // enum: [\n // 'double',\n // 'single',\n // null,\n // ],\n // },\n separatorForSingleObjectField: {\n description: `Whether to apply the \\`objectFieldSeparator\\` (e.g., a semicolon) when there\nis only one property-value object field present. Defaults to \\`false\\`.`,\n type: 'boolean',\n },\n stringQuotes: {\n description: `How string literals should be quoted (e.g., \\`\"abc\"\\`). Set to \\`single\\`\nor \\`double\\`. Defaults to 'double'.`,\n enum: [\n 'double',\n 'single',\n ],\n type: 'string',\n },\n trailingPunctuationMultilineOnly: {\n description: 'If `objectFieldSeparatorTrailingPunctuation` is set, this will determine whether the trailing puncutation is only added when the type is multiline',\n type: 'boolean',\n },\n typeBracketSpacing: {\n description: `A string of spaces that will be added immediately after the type's initial\ncurly bracket and immediately before its ending curly bracket. Defaults\nto the empty string.`,\n type: 'string',\n },\n unionSpacing: {\n description: 'Determines the spacing to add to unions (`|`). Defaults to a single space (`\" \"`).',\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAGA,IAAAE,aAAA,GAAAF,OAAA;AAK8B,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9B,MAAMG,UAAU,GAAI,wCAAyC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAE/C,IAAAI,qBAAY,EAAC,CAAC;EAC3BC,OAAO;EACPC,MAAM;EACNC,KAAK;EACLC,QAAQ;EACRC;EACF;AACA,CAAC,KAAK;EACJ,MAAM;IACJC,aAAa,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AuB;UACXvD,IAAI,EAAE;QACR,CAAC;QACDd,wBAAwB,EAAE;UACxBqE,WAAW,EAAE,kHAAkH;UAC/HvD,IAAI,EAAE;QACR,CAAC;QACDb,4BAA4B,EAAE;UAC5BoE,WAAW,EAAE,kGAAkG;UAC/GvD,IAAI,EAAE;QACR,CAAC;QACDZ,qBAAqB,EAAE;UACrBmE,WAAW,EAAE,0EAA0E;UACvFvD,IAAI,EAAE;QACR,CAAC;QACDX,cAAc,EAAE;UACdkE,WAAW,EAAE,oFAAoF;UACjGvD,IAAI,EAAE;QACR,CAAC;QACD;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACAV,6BAA6B,EAAE;UAC7BiE,WAAW,EAAE;AACzB,wEAAwE;UAC5DvD,IAAI,EAAE;QACR,CAAC;QACDT,YAAY,EAAE;UACZgE,WAAW,EAAE;AACzB,qCAAqC;UACzBM,IAAI,EAAE,CACJ,QAAQ,EACR,QAAQ,CACT;UACD7D,IAAI,EAAE;QACR,CAAC;QACDR,gCAAgC,EAAE;UAChC+D,WAAW,EAAE,oJAAoJ;UACjKvD,IAAI,EAAE;QACR,CAAC;QACDP,kBAAkB,EAAE;UAClB8D,WAAW,EAAE;AACzB;AACA,qBAAqB;UACTvD,IAAI,EAAE;QACR,CAAC;QACDN,YAAY,EAAE;UACZ6D,WAAW,EAAE,oFAAoF;UACjGvD,IAAI,EAAE;QACR;MACF,CAAC;MACDA,IAAI,EAAE;IACR,CAAC,CACF;IACDA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAA8D,MAAA,CAAAxG,OAAA,GAAAA,OAAA,CAAAH,OAAA","ignoreList":[]}
|
package/dist/rules.d.ts
CHANGED
|
@@ -3162,6 +3162,10 @@ export interface Rules {
|
|
|
3162
3162
|
* or `double`. Defaults to 'double'.
|
|
3163
3163
|
*/
|
|
3164
3164
|
stringQuotes?: "double" | "single";
|
|
3165
|
+
/**
|
|
3166
|
+
* If `objectFieldSeparatorTrailingPunctuation` is set, this will determine whether the trailing puncutation is only added when the type is multiline
|
|
3167
|
+
*/
|
|
3168
|
+
trailingPunctuationMultilineOnly?: boolean;
|
|
3165
3169
|
/**
|
|
3166
3170
|
* A string of spaces that will be added immediately after the type's initial
|
|
3167
3171
|
* curly bracket and immediately before its ending curly bracket. Defaults
|
package/package.json
CHANGED
|
@@ -48,6 +48,7 @@ export default iterateJsdoc(({
|
|
|
48
48
|
// propertyQuotes = null,
|
|
49
49
|
separatorForSingleObjectField = false,
|
|
50
50
|
stringQuotes = 'double',
|
|
51
|
+
trailingPunctuationMultilineOnly = false,
|
|
51
52
|
typeBracketSpacing = '',
|
|
52
53
|
unionSpacing = ' ',
|
|
53
54
|
} = context.options[0] || {};
|
|
@@ -329,6 +330,7 @@ export default iterateJsdoc(({
|
|
|
329
330
|
const typeNode = /** @type {import('jsdoc-type-pratt-parser').ObjectResult} */ (nde);
|
|
330
331
|
/* c8 ignore next -- Guard */
|
|
331
332
|
const separator = typeNode.meta.separator ?? 'comma';
|
|
333
|
+
|
|
332
334
|
if (
|
|
333
335
|
(separator !== objectFieldSeparator &&
|
|
334
336
|
(!objectFieldSeparatorOptionalLinebreak ||
|
|
@@ -337,7 +339,12 @@ export default iterateJsdoc(({
|
|
|
337
339
|
(typeNode.meta.separatorForSingleObjectField ?? false) !== separatorForSingleObjectField ||
|
|
338
340
|
((typeNode.meta.propertyIndent ?? '') !== objectFieldIndent &&
|
|
339
341
|
separator.endsWith('-linebreak')) ||
|
|
340
|
-
|
|
342
|
+
/* c8 ignore next 5 -- jsdoc-type-pratt-parser doesn't encode as should */
|
|
343
|
+
((typeNode.meta.trailingPunctuation ?? false) !== objectFieldSeparatorTrailingPunctuation &&
|
|
344
|
+
((typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly ||
|
|
345
|
+
!stringify(typeNode).includes('\n'))) ||
|
|
346
|
+
(!typeNode.meta.trailingPunctuation && (!trailingPunctuationMultilineOnly ||
|
|
347
|
+
stringify(typeNode).includes('\n')))))
|
|
341
348
|
) {
|
|
342
349
|
typeNode.meta.separator = objectFieldSeparatorOptionalLinebreak && !separator.endsWith('and-linebreak') ?
|
|
343
350
|
objectFieldSeparator.replace(/-and-linebreak$/v, '') :
|
|
@@ -348,7 +355,8 @@ export default iterateJsdoc(({
|
|
|
348
355
|
errorMessage = `Inconsistent ${objectFieldSeparator} separator usage`;
|
|
349
356
|
} else if ((typeNode.meta.bracketSpacing ?? '') !== objectTypeBracketSpacing) {
|
|
350
357
|
typeNode.meta.bracketSpacing = objectTypeBracketSpacing;
|
|
351
|
-
|
|
358
|
+
// This might not be the cause
|
|
359
|
+
// errorMessage = `Object type bracket spacing should be "${objectTypeBracketSpacing}"`;
|
|
352
360
|
}
|
|
353
361
|
|
|
354
362
|
break;
|
|
@@ -659,6 +667,10 @@ or \`double\`. Defaults to 'double'.`,
|
|
|
659
667
|
],
|
|
660
668
|
type: 'string',
|
|
661
669
|
},
|
|
670
|
+
trailingPunctuationMultilineOnly: {
|
|
671
|
+
description: 'If `objectFieldSeparatorTrailingPunctuation` is set, this will determine whether the trailing puncutation is only added when the type is multiline',
|
|
672
|
+
type: 'boolean',
|
|
673
|
+
},
|
|
662
674
|
typeBracketSpacing: {
|
|
663
675
|
description: `A string of spaces that will be added immediately after the type's initial
|
|
664
676
|
curly bracket and immediately before its ending curly bracket. Defaults
|
package/src/rules.d.ts
CHANGED
|
@@ -3162,6 +3162,10 @@ export interface Rules {
|
|
|
3162
3162
|
* or `double`. Defaults to 'double'.
|
|
3163
3163
|
*/
|
|
3164
3164
|
stringQuotes?: "double" | "single";
|
|
3165
|
+
/**
|
|
3166
|
+
* If `objectFieldSeparatorTrailingPunctuation` is set, this will determine whether the trailing puncutation is only added when the type is multiline
|
|
3167
|
+
*/
|
|
3168
|
+
trailingPunctuationMultilineOnly?: boolean;
|
|
3165
3169
|
/**
|
|
3166
3170
|
* A string of spaces that will be added immediately after the type's initial
|
|
3167
3171
|
* curly bracket and immediately before its ending curly bracket. Defaults
|