Skip to content

Commit

Permalink
Enable ESLint JSDoc checks
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Oct 12, 2022
1 parent a08815a commit dfac6c6
Show file tree
Hide file tree
Showing 3 changed files with 253 additions and 56 deletions.
40 changes: 40 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,46 @@ module.exports = {
'src/govuk/vendor/polyfills/**/*'
],
overrides: [
{
extends: 'plugin:jsdoc/recommended',
files: ['**/*.{cjs,js,mjs}'],
plugins: [
'jsdoc'
],
rules: {
// JSDoc blocks are optional
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-param': 'off',

// Require hyphens before param description
// Aligns with TSDoc style: https://tsdoc.org/pages/tags/param/
'jsdoc/require-hyphen-before-param-description': 'warn',

// Check for valid formatting
'jsdoc/check-line-alignment': 'warn',
'jsdoc/check-syntax': 'error',

// Add unknown @jest-environment tag name
'jsdoc/check-tag-names': [
'warn', {
definedTags: ['jest-environment']
}
],

// Add missing .querySelectorAll() type
'jsdoc/no-undefined-types': [
'error', {
definedTypes: ['NodeListOf']
}
]
},
settings: {
jsdoc: {
mode: 'typescript'
}
}
},
{
files: ['**/*.test.{cjs,js,mjs}'],
env: {
Expand Down
Loading

0 comments on commit dfac6c6

Please sign in to comment.