Include gr-linked-text in eslint

Change-Id: Ia1fe4818fa43272e641511e28e7518144b2fc72b
This commit is contained in:
Tao Zhou
2019-12-18 16:53:29 +01:00
parent d481cdcbf5
commit e66241045c
3 changed files with 15 additions and 1 deletions

View File

@@ -60,6 +60,7 @@
/**
* Because either the source text or the linkification config has changed,
* the content should be re-parsed.
*
* @param {string|null|undefined} content The raw, un-linkified source
* string to parse.
* @param {Object|null|undefined} config The server config specifying
@@ -90,6 +91,7 @@
* element should be created and attached to the resulting DOM.
* - To attach an arbitrary fragment: when called with only the `fragment`
* argument, the fragment should be attached to the resulting DOM as is.
*
* @param {string|null} text
* @param {string|null} href
* @param {DocumentFragment|undefined} fragment

View File

@@ -19,6 +19,7 @@
/**
* Pattern describing URLs with supported protocols.
*
* @type {RegExp}
*/
const URL_PROTOCOL_PATTERN = /^(https?:\/\/|mailto:)/;
@@ -27,6 +28,7 @@
* Construct a parser for linkifying text. Will linkify plain URLs that appear
* in the text as well as custom links if any are specified in the linkConfig
* parameter.
*
* @param {Object|null|undefined} linkConfig Comment links as specified by the
* commentlinks field on a project config.
* @param {Function} callback The callback to be fired when an intermediate
@@ -45,6 +47,7 @@
/**
* Emit a callback to create a link element.
*
* @param {string} text The text of the link.
* @param {string} href The URL to use as the href of the link.
*/
@@ -56,6 +59,7 @@
/**
* Given the source text and a list of CommentLinkItem objects that were
* generated by the commentlinks config, emit parsing callbacks.
*
* @param {string} text The chuml of source text over which the outputArray
* items range.
* @param {!Array<Gerrit.CommentLinkItem>} outputArray The list of items to add
@@ -93,6 +97,7 @@
/**
* Sort the given array of CommentLinkItems such that the positions are in
* reverse order.
*
* @param {!Array<Gerrit.CommentLinkItem>} outputArray
*/
GrLinkTextParser.prototype.sortArrayReverse = function(outputArray) {
@@ -108,6 +113,7 @@
* - With the `html` paremeter provided, and the `text` and `href` parameters
* passed as `null`. In this case, the string of HTML will be parsed and the
* first resulting node will be used as the resulting content.
*
* @param {string|null} text The text to use if creating a link.
* @param {string|null} href The href to use as the URL if creating a link.
* @param {string|null} html The html to parse and use as the result.
@@ -150,6 +156,7 @@
/**
* Create a CommentLinkItem for a link and append it to the given output
* array.
*
* @param {string|null} text The text for the link.
* @param {string|null} href The href to use as the URL of the link.
* @param {number} position The position inside the source text where the link
@@ -172,6 +179,7 @@
/**
* Create a CommentLinkItem specified by an HTMl string and append it to the
* given output array.
*
* @param {string|null} html The html to parse and use as the result.
* @param {number} position The position inside the source text where the item
* starts.
@@ -192,6 +200,7 @@
/**
* Does the given range overlap with anything already in the item list.
*
* @param {number} position
* @param {number} length
* @param {!Array<Gerrit.CommentLinkItem>} outputArray
@@ -214,6 +223,7 @@
/**
* Parse the given source text and emit callbacks for the items that are
* parsed.
*
* @param {string} text
*/
GrLinkTextParser.prototype.parse = function(text) {
@@ -231,6 +241,7 @@
* ba-linkify has found a plain URL and wants it linkified.
* - With only a `text` parameter provided: this represents the non-link
* content that lies between the links the library has found.
*
* @param {string} text
* @param {string|null|undefined} href
*/
@@ -257,6 +268,7 @@
/**
* Walk over the given source text to find matches for comemntlink patterns
* and emit parse result callbacks.
*
* @param {string} text The raw source text.
* @param {Object|null|undefined} patterns A comment links specification
* object.

View File

@@ -37,4 +37,4 @@ cd ${UI_PATH}
# eslint installation.
npm link eslint eslint-config-google eslint-plugin-html eslint-plugin-jsdoc
${eslint_bin} -c ${UI_PATH}/.eslintrc.json --ignore-pattern 'node_modules/' --ignore-pattern 'bower_components/' --ignore-pattern 'gr-linked-text' --ignore-pattern 'scripts/vendor' --ext .html,.js ${UI_PATH}
${eslint_bin} -c ${UI_PATH}/.eslintrc.json --ignore-pattern 'node_modules/' --ignore-pattern 'bower_components/' --ignore-pattern 'scripts/vendor' --ext .html,.js ${UI_PATH}