The Jared Wilcurt's strict JSDoc ESLint rules for obsessives.
npm install --save-dev eslint-plugin-jsdoc eslint-config-tjw-jsdoc
- In your
.eslitrc.js
addtjw-jsdoc
to yourextends
like so:module.exports = { extends: [ 'tjw-jsdoc' ] };
Pairs really well with:
- Sublime Text plugin - DocBlockr - Best in class
- VS Codium plugin - VS DocBlockr - Not as good as the SublimeText one, but not bad
- IntelliJ based editors (WebStorm, etc) have a built in plugin you can enable, but it's not open source, it's handled by Jet Brains, and it's almost completely useless. But you can still enable it and try it out. If enough people turn it on, maybe they'll prioritize making it better.
But the point of using ESLint to enforce this is so that you don't have to do editor-specific things. Any team can adopt this approach and each dev can make ESLint work with whatever tools they use.
See also:
- eslint-config-tjw-base - Basic JavaScript Linting
- eslint-config-tjw-import - Lint import/require statements
- eslint-config-tjw-jest - Lint Jest Unit Tests
- eslint-config-tjw-jsdoc - Enforce JSDoc comment blocks
- eslint-config-tjw-vue - Lint Vue files