fvtt-cthulhu-eternal/node_modules/eslint-plugin-jsdoc/dist/getJsdocProcessorPlugin.cjs.map

1 line
31 KiB
Plaintext
Raw Normal View History

{"version":3,"file":"getJsdocProcessorPlugin.cjs","names":["_nodeFs","require","_nodePath","_nodeUrl","espree","_interopRequireWildcard","_jsdocUtils","_jsdoccomment","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","__dirname","dirname","fileURLToPath","pathToFileURL","__filename","toString","version","JSON","parse","readFileSync","join","likelyNestedJSDocIndentSpace","preTagSpaceLength","firstLinePrefixLength","hasCaptionRegex","escapeStringRegexp","str","replaceAll","countChars","ch","match","RegExp","length","getLinesCols","text","matchLines","colDelta","slice","lastIndexOf","getJsdocProcessorPlugin","options","exampleCodeRegex","rejectExampleCodeRegex","checkExamples","checkDefaults","checkParams","checkProperties","matchingFileName","matchingFileNameDefaults","matchingFileNameParams","matchingFileNameProperties","paddedIndent","captionRequired","sourceType","parser","undefined","exampleCodeRegExp","rejectExampleCodeRegExp","getRegexFromString","otherInfo","extraMessages","getTextsAndFileNames","jsdoc","jsFileName","commentLineCols","textsAndFileNames","checkSource","filename","ext","defaultFileName","lines","cols","skipInit","source","targetTagName","sources","tag","line","push","nonJSPrefacingCols","nonJSPrefacingLines","string","addSourceInfo","src","file","number","codeStartLine","codeStartCol","targetSource","getFilenameInfo","includes","replace","filenameInfo","forEachPreferredTag","description","trim","getTagDescription","tagName","getPreferredTagName","hasTag","matchingFilenameInfo","column","severity","message","ruleId","test","startingIndex","lastStringCount","exampleCode","lastIndex","exec","index","n0","n1","preMatch","preMatchLines","nonJSPreface","nonJSPrefaceLineCount","idx","indexOf","charsInLastLine","global","meta","name","processors","examples","preprocess","ast","parseForESLint","ecmaVersion","comment","err","jsdocComments","comments","filter","value","map","start","range","textToStart","parseComment","flatMap","Boolean","console","log","postprocess","jsMessages","messages","forEach","msg","fatal","endColumn","endLine","codeCtxLine","codeCtxColumn","startLine","startCol","ret","concat","supportsAutofix","exports"],"sources":["../src/getJsdocProcessorPlugin.js"],"sourcesContent":["// Todo: Support TS by fenced block type\n\nimport {readFileSync} from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport * as espree from 'espree';\nimport {\n getRegexFromString,\n forEachPreferredTag,\n getTagDescription,\n getPreferredTagName,\n hasTag,\n} from './jsdocUtils.js';\nimport {\n parseComment,\n} from '@es-joy/jsdoccomment';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst {version} = JSON.parse(\n // @ts-expect-error `Buffer` is ok for `JSON.parse`\n readFileSync(join(__dirname, '../package.json'))\n);\n\n// const zeroBasedLineIndexAdjust = -1;\nconst likelyNestedJSDocIndentSpace = 1;\nconst preTagSpaceLength = 1;\n\n// If a space is present, we should ignore it\nconst firstLinePrefixLength = preTagSpaceLength;\n\nconst hasCaptionRegex = /^\\s*<caption>([\\s\\S]*?)<\\/caption>/u;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nconst escapeStringRegexp = (str) => {\n return str.replaceAll(/[.*+?^${}()|[\\]\\\\]/gu, '\\\\$&');\n};\n\n/**\n * @param {string} str\n * @param {string} ch\n * @returns {import('./iterateJsdoc.js').Integer}\n */\nconst countChars = (str, ch) => {\n return (str.match(new RegExp(escapeStringRegexp(ch), 'gu')) || []).length;\n};\n\n/**\n * @param {string} text\n * @returns {[\n* import('./iterateJsdoc.js').Integer,\n* import('./iterateJsdoc.js').Integer\n* ]}\n*/\nconst getLinesCols = (text) => {\n const matchLines = countChars(text, '\\n');\n\n const colDelta = matchLines ?\n text.slice(text.lastIndexOf('\\n') + 1).length :\n text.length;\n\n return [\n matchLines, colDelta,\n ];\n};\n\n/**\n * @typedef {number} Integer\n */\n\n/**