chore(eslint): enforce JSDoc block tag formatting #333
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #307
Applied changes based on Issue #307.
I’ve added ESLint (with the TypeScript parser) and the
eslint-plugin-jsdoc
plugin to enforce:@param
,@returns
, etc.) must be on its own line.Changes:
• package.json
– Added a
lint
script– Installed
eslint
,@typescript-eslint/*
,eslint-plugin-jsdoc
, andeslint-config-prettier
as devDependencies• .eslintrc.js
– Configures ESLint to use the TypeScript parser, includes the jsdoc plugin, and enables rules:
•
jsdoc/check-multiline-blocks
•
jsdoc/newline-after-description
•
jsdoc/require-param
•
jsdoc/require-returns
•
max-len
@ 80 chars• .eslintignore
– Ignore
node_modules
and built/dist output• README.md
– Documented the new
npm run lint
command under a “Linting” sectionNow running
npm install
, thennpm run lint
will catch any JSDoc block tags on the same line or over-long comment lines. Let me know if you’d like any adjustments!