{"name":"@microsoft/tsdoc-config","version":"0.18.1","keywords":["TypeScript","documentation","doc","comments","JSDoc","parser","standard"],"license":"MIT","_id":"@microsoft/tsdoc-config@0.18.1","maintainers":[{"name":"microsoft1es","email":"npmjs@microsoft.com"},{"name":"microsoft-oss-releases","email":"microsoft-oss-publishing@microsoft.com"},{"name":"odspnpm","email":"odspnpm@microsoft.com"}],"homepage":"https://tsdoc.org/","bugs":{"url":"https://github.com/microsoft/tsdoc/issues"},"dist":{"shasum":"7c560bce62abb5f9681e4d231b9ac35553b7e86b","tarball":"http://registry-npm.ywwl.com/@microsoft/tsdoc-config/download/@microsoft/tsdoc-config-0.18.1.tgz","fileCount":13,"integrity":"sha512-9brPoVdfN9k9g0dcWkFeA7IH9bbcttzDJlXvkf8b2OBzd5MueR1V2wkKBL0abn0otvmkHJC6aapBOTJDDeMCZg==","signatures":[{"sig":"MEUCIQCo668gjInCc7mFuSaLBl52uN45bmJQCunK31jweFC6zgIgfwIWtiltluEdbXME/TNwkaOeEYNPoff20dLxZM1DyQE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":106334,"size":23828,"noattachment":false,"key":"/@microsoft/tsdoc-config/-/@microsoft/tsdoc-config-0.18.1.tgz"},"main":"lib/index.js","_from":"file:microsoft-tsdoc-config-0.18.1.tgz","gitHead":"594751026916acfed32c39d79e04d9026ca637bf","scripts":{"build":"heft test --clean","watch":"heft test --clean --watch","_phase:test":"heft run --only test -- --clean","_phase:build":"heft run --only build -- --clean"},"typings":"lib/index.d.ts","_npmUser":{"name":"odspnpm","email":"odspnpm@microsoft.com"},"_resolved":"/tmp/58af0b8ff562912a0fc8dce310981917/microsoft-tsdoc-config-0.18.1.tgz","_integrity":"sha512-9brPoVdfN9k9g0dcWkFeA7IH9bbcttzDJlXvkf8b2OBzd5MueR1V2wkKBL0abn0otvmkHJC6aapBOTJDDeMCZg==","repository":{"url":"git+https://github.com/microsoft/tsdoc.git","type":"git","directory":"tsdoc-config"},"_npmVersion":"10.9.4","description":"A loader for the tsdoc.json file","directories":{},"_nodeVersion":"22.21.1","dependencies":{"ajv":"~8.18.0","jju":"~1.4.0","resolve":"~1.22.2","@microsoft/tsdoc":"0.16.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"~9.25.1","@types/jju":"1.4.2","@types/resolve":"1.20.2","@rushstack/heft":"1.1.1","tsdoc-build-rig":"1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tsdoc-config_0.18.1_1771988236753_0.500647191178444","host":"s3://npm-registry-packages-npm-production"},"readme":"# @microsoft/tsdoc-config\r\n\r\n**TSDoc** is a proposal to standardize the doc comments used in [TypeScript](http://www.typescriptlang.org/)\r\nsource files.  The main package [`@microsoft/tsdoc`](https://www.npmjs.com/package/@microsoft/tsdoc) implements\r\nthe TSDoc parser.  The `@microsoft/tsdoc-config` package is an optional add-on for loading the **tsdoc.json**\r\nfile format that enables users to define custom TSDoc tags.  (This functionality was moved to its own package\r\nbecause it requires external dependencies such as NodeJS and `ajv`, whereas the main package is fully self-contained.)\r\n\r\nFor more information about TSDoc, please visit the project website:\r\n\r\nhttps://tsdoc.org\r\n\r\n\r\n## Creating config files\r\n\r\nThe **tsdoc.json** file is optional.  When used, it is expected to be found in the same folder as\r\nthe **tsconfig.json** file for a project.  The loader looks for it by walking upwards in the directory tree\r\nuntil it finds a folder containing **tsconfig.json** or **package.json**, and then it attempts to load\r\n**tsdoc.json** from that location.\r\n\r\nThe **tsdoc.json** file conforms to the [tsdoc.schema.json](\r\nhttps://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json) JSON schema.  It defines tags using\r\nsimilar fields as the\r\n[TSDocTagDefinition](https://github.com/microsoft/tsdoc/blob/main/tsdoc/src/configuration/TSDocTagDefinition.ts)\r\nAPI used by `TSDocParser` from `@microsoft/tsdoc`.\r\n\r\nHere's a simple example:\r\n\r\n**tsdoc.json**\r\n```js\r\n{\r\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json\",\r\n  \"tagDefinitions\": [\r\n    {\r\n      \"tagName\": \"@myTag\",\r\n      \"syntaxKind\": \"modifier\"\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nIf you want to define custom tags in one place and share them across multiple projects, the `extends` field specifies\r\na list of paths that will be mixed in with the current file:\r\n\r\n**tsdoc.json**\r\n```js\r\n{\r\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json\",\r\n  \"extends\": [\r\n    \"my-package/dist/tsdoc-base.json\",\r\n    \"./path/to/local/file/tsdoc-local.json\"\r\n  ]\r\n}\r\n```\r\n\r\n> NOTE: The `extends` paths are resolved using NodeJS module resolution, so local paths must begin with `./` to avoid\r\n> being interpreted as an NPM package name.\r\n\r\n\r\n## API Usage\r\n\r\nThe code sample below illustrates how to invoke the `@microsoft/tsdoc-config` API to load a\r\n**tsdoc.json** file:\r\n\r\n```ts\r\nimport * as path from 'path';\r\nimport { TSDocParser, TSDocConfiguration } from '@microsoft/tsdoc';\r\nimport { TSDocConfigFile } from '@microsoft/tsdoc-config';\r\n\r\n// Sample source file to be parsed\r\nconst mySourceFile: string = 'my-project/src/example.ts';\r\n\r\n// Load the nearest config file, for example `my-project/tsdoc.json`\r\nconst tsdocConfigFile: TSDocConfigFile = TSDocConfigFile.loadForFolder(path.dirname(mySourceFile));\r\nif (tsdocConfigFile.hasErrors) {\r\n  // Report any errors\r\n  console.log(tsdocConfigFile.getErrorSummary());\r\n}\r\n\r\n// Use the TSDocConfigFile to configure the parser\r\nconst tsdocConfiguration: TSDocConfiguration = new TSDocConfiguration();\r\ntsdocConfigFile.configureParser(tsdocConfiguration);\r\nconst tsdocParser: TSDocParser = new TSDocParser(tsdocConfiguration);\r\n```\r\n\r\n","publish_time":1771988236908,"_cnpm_publish_time":1771988236908,"dist-tags":{"latest":"0.18.3"}}