Describe the bug
Encountering a TypeError when trying to use the swagger-jsdoc library in a project where lint-staged is also installed. The error occurs during the execution of the project, specifically when building the Swagger specification files. The error does not appear when lint-staged is uninstalled.
This is the error that i see:
/home/aruberuto/projects/comuncity/code/swagger-jsdoc-lint-staged/node_modules/swagger-jsdoc/src/specification.js:187
YAML.defaultOptions.keepCstNodes = true;
^
TypeError: Cannot set properties of undefined (setting 'keepCstNodes')
at build (/home/aruberuto/projects/comuncity/code/swagger-jsdoc-lint-staged/node_modules/swagger-jsdoc/src/specification.js:187:36)
at module.exports (/home/aruberuto/projects/comuncity/code/swagger-jsdoc-lint-staged/node_modules/swagger-jsdoc/src/lib.js:32:10)
at Object.<anonymous> (/home/aruberuto/projects/comuncity/code/swagger-jsdoc-lint-staged/src/index.ts:14:26)
You should see the log in the terminal with the generated documentation in json.
Expected behavior
The project should start without errors when using the lint-staged library, and the Swagger documentation should be built successfully.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug Encountering a TypeError when trying to use the
swagger-jsdoc
library in a project wherelint-staged
is also installed. The error occurs during the execution of the project, specifically when building the Swagger specification files. The error does not appear whenlint-staged
is uninstalled. This is the error that i see:To Reproduce the error with lint-staged
npm install
.npm start
.No error after removing lint-staged
npm install
.npm remove lint-staged
npm start
.Expected behavior The project should start without errors when using the lint-staged library, and the Swagger documentation should be built successfully.
Desktop:
v20.9.0
10.2.24