I have a TypeScript application (4.0.x) that includes the following packages:
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"@vue/cli-plugin-eslint": "^4.5.4",
"eslint": "^7.8.1",
"eslint-plugin-jsdoc": "^30.3.1",
My .eslintrc.js includes the following:
'extends': [
'plugin:vue/essential',
'eslint:recommended',
'@vue/typescript/recommended',
"plugin:jsdoc/recommended"
],
parserOptions: {
ecmaVersion: 2020
},
plugins: [
"jsdoc"
],
rules: {
'jsdoc/require-property-description': 1,
'jsdoc/require-description': 1,
'jsdoc/require-param-type': 'off',
'jsdoc/require-returns-type': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
When I run ESLint against my code I want it to return an error or warning if a property defined on a class doesn't include a JSDoc description.
For example, with the following code I would expect a message regarding id, mainCharacters, and state missing JSDoc descriptions.
export default class Party {
public id = -1;
public mainCharacters: Character[] = [];
public state: PartyState;
/**
* Location index.
*/
public location = 0;
Based upon the documentation it doesn't appear the jsdoc/require-property* rules would work, but I did try switching them on anyway and they're not reporting missing JSDocs.
'jsdoc/require-property': 1,
'jsdoc/require-property-description': 1,
'jsdoc/require-property-name': 1,
'jsdoc/require-property-type': 1,
What ESLint rule(s) am I missing that would report missing JSDocs on TypeScript properties?