mercredi 20 février 2019

Cannot get eslint to throw warning for no jsDoc on Ember classes, props, actions

I am setting up eslint in my ember project. I want to enforce that all functions, classes, actions, and properties are documented with jsDoc.

The problem that I am facing is that I cannot seem to get the enforcement to work on actions, component declarations, or object properties.

I originally tried "require-jsdoc" but also noted that this rule is deprecated. I then installed eslint-plugin-jsdoc with the following config:

rules: [
  ...
  'jsdoc/check-examples': 0,
  'jsdoc/check-param-names': 1,
  'jsdoc/check-tag-names': 1,
  'jsdoc/check-types': 1,
  'jsdoc/newline-after-description': 1,
  'jsdoc/no-undefined-types': 1,
  'jsdoc/require-description': 1,
  'jsdoc/require-description-complete-sentence': 1,
  'jsdoc/require-example': 1,
  'jsdoc/require-hyphen-before-param-description': 1,
  'jsdoc/require-param': 1,
  'jsdoc/require-param-description': 1,
  'jsdoc/require-param-name': 1,
  'jsdoc/require-param-type': 1,
  'jsdoc/require-returns': 1,
  'jsdoc/require-returns-check': 1,
  'jsdoc/require-returns-description': 1,
  'jsdoc/require-returns-type': 1,
]

And still no luck. Any idea how to get the following working?

// throw eslint warning if not documented
export default Component.extend({
  someProp: false, // throw eslint warning if not documented
  actions: {
    someAction() {} // throw eslint warning if not documented
  }
});


All other natural function definitions are working as expected, just attempting to get these cases working. Thanks!




Aucun commentaire:

Enregistrer un commentaire