Skip to content

Commit

Permalink
Infrastructure: Add eslint-plugin-jsdoc (pull #1647)
Browse files Browse the repository at this point in the history
* chore: Add ESLint plugin for JSDoc
* fix: ESLint jsdoc/newline-after-description
* fix: ESLint jsdoc/check-tag-names
* fix: ESLint jsdoc/require-param
* fix: ESLint jsdoc/require-returns
* fix: ESLint jsdoc/require-returns-type
* fix: Double word 'value' in comment
  • Loading branch information
nschonni committed Jan 19, 2021
1 parent 2e6e052 commit 31b9760
Show file tree
Hide file tree
Showing 44 changed files with 364 additions and 267 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.json
@@ -1,5 +1,5 @@
{
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"extends": ["eslint:recommended", "plugin:jsdoc/recommended", "plugin:prettier/recommended"],
"env": {
"browser": true,
"es6": true
Expand All @@ -8,6 +8,11 @@
"ecmaVersion": 6
},
"rules": {
"jsdoc/no-undefined-types": 0,
"jsdoc/require-jsdoc": 0,
"jsdoc/require-param-description": 0,
"jsdoc/require-param-type": 0,
"jsdoc/require-returns-description": 0,
"strict": [2, "global"],
"no-console": "error"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/alert/js/alert.js
Expand Up @@ -17,7 +17,7 @@ window.addEventListener('load', function () {
*
* @desc Adds an alert to the page
*
* @param {Object} event - Standard W3C event object
* @param {object} event - Standard W3C event object
*
*/

Expand Down
2 changes: 1 addition & 1 deletion examples/combobox/js/grid-combo-example.js
Expand Up @@ -90,7 +90,7 @@ function searchVeggies(searchString) {

/**
* @function onload
* @desc Initialize the combobox examples once the page has loaded
* @description Initialize the combobox examples once the page has loaded
*/
window.addEventListener('load', function () {
new aria.GridCombobox(
Expand Down
6 changes: 2 additions & 4 deletions examples/combobox/js/grid-combo.js
Expand Up @@ -8,14 +8,12 @@
var aria = aria || {};

/**
* @constructor
* @class
*
* @desc
* @description
* Combobox object representing the state and interactions for a combobox
* widget
*
* @param comboboxNode
* The DOM node pointing to the combobox
* @param input
* The input node
* @param grid
Expand Down
22 changes: 11 additions & 11 deletions examples/dialog-modal/js/dialog.js
Expand Up @@ -19,11 +19,11 @@ aria.Utils = aria.Utils || {};
aria.Utils.dialogOpenClass = 'has-dialog';

/**
* @desc Set focus on descendant nodes until the first focusable element is
* @description Set focus on descendant nodes until the first focusable element is
* found.
* @param element
* DOM node for which to find the first focusable descendant.
* @returns
* @returns {boolean}
* true if a focusable element is found and focus is set.
*/
aria.Utils.focusFirstDescendant = function (element) {
Expand All @@ -40,10 +40,10 @@ aria.Utils = aria.Utils || {};
}; // end focusFirstDescendant

/**
* @desc Find the last descendant node that is focusable.
* @description Find the last descendant node that is focusable.
* @param element
* DOM node for which to find the last focusable descendant.
* @returns
* @returns {boolean}
* true if a focusable element is found and focus is set.
*/
aria.Utils.focusLastDescendant = function (element) {
Expand All @@ -60,10 +60,10 @@ aria.Utils = aria.Utils || {};
}; // end focusLastDescendant

/**
* @desc Set Attempt to set focus on the current node.
* @description Set Attempt to set focus on the current node.
* @param element
* The node to attempt to focus on.
* @returns
* @returns {boolean}
* true if element is focused.
*/
aria.Utils.attemptFocus = function (element) {
Expand All @@ -85,7 +85,7 @@ aria.Utils = aria.Utils || {};
aria.OpenDialogList = aria.OpenDialogList || new Array(0);

/**
* @returns the last opened dialog (the current dialog)
* @returns {object} the last opened dialog (the current dialog)
*/
aria.getCurrentDialog = function () {
if (aria.OpenDialogList && aria.OpenDialogList.length) {
Expand Down Expand Up @@ -114,8 +114,8 @@ aria.Utils = aria.Utils || {};
document.addEventListener('keyup', aria.handleEscape);

/**
* @constructor
* @desc Dialog object providing modal focus management.
* @class
* @description Dialog object providing modal focus management.
*
* Assumptions: The element serving as the dialog container is present in the
* DOM and hidden. The dialog container has role='dialog'.
Expand Down Expand Up @@ -235,7 +235,7 @@ aria.Utils = aria.Utils || {};
};

/**
* @desc
* @description
* Hides the current top dialog,
* removes listeners of the top dialog,
* restore listeners of a parent dialog if one was open under the one that just closed,
Expand All @@ -259,7 +259,7 @@ aria.Utils = aria.Utils || {};
}; // end close

/**
* @desc
* @description
* Hides the current dialog and replaces it with another.
*
* @param newDialogId
Expand Down
3 changes: 2 additions & 1 deletion examples/feed/js/main.js
Expand Up @@ -9,8 +9,9 @@

/**
* ARIA Feed Example
*
* @function onload
* @desc Initialize the feed once the page has loaded
* @description Initialize the feed once the page has loaded
*/
window.addEventListener('load', function () {
var feedNode = document.getElementById('restaurant-feed');
Expand Down

0 comments on commit 31b9760

Please sign in to comment.