Skip to content

Commit

Permalink
build(eslint): comment line length limit (#1217)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera authored Oct 16, 2023
1 parent fbad122 commit 1a675ac
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 45 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"error",
{
"code": 240,
"comments": 120,
"ignoreComments": false,
"ignoreUrls": true
}
Expand Down
14 changes: 9 additions & 5 deletions src/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ Set application messages for banner display
</thead>
<tbody>
<tr>
<td>messages</td><td><code>Array.&lt;{id: string, message: string, title: string, variant: string}&gt;</code> | <code>Object</code></td>
<td>messages</td><td><code>Array</code> | <code>Object</code></td>
</tr> </tbody>
</table>

Expand Down Expand Up @@ -2279,7 +2279,8 @@ Get daily and monthly totals from a data set. A metric totals helper.
</tr><tr>
<td>params.dataSet</td><td><code>object</code></td><td></td>
</tr><tr>
<td>params.isCurrent</td><td><code>boolean</code></td><td><p>Is the current value the &quot;current month&quot;. A proxy value passed through &quot;graphCardMetricTotals&quot;</p>
<td>params.isCurrent</td><td><code>boolean</code></td><td><p>Is the current value the &quot;current month&quot;. A proxy value passed through
&quot;graphCardMetricTotals&quot;</p>
</td>
</tr> </tbody>
</table>
Expand Down Expand Up @@ -2324,7 +2325,8 @@ Get a remaining capacity from data sets. A metric totals helper.
</tr><tr>
<td>params.tallyData</td><td><code>Array</code></td><td></td>
</tr><tr>
<td>params.isCurrent</td><td><code>boolean</code></td><td><p>Is the current value the &quot;current month&quot;. A proxy value passed through &quot;graphCardMetricTotals&quot;</p>
<td>params.isCurrent</td><td><code>boolean</code></td><td><p>Is the current value the &quot;current month&quot;. A proxy value passed
through &quot;graphCardMetricTotals&quot;</p>
</td>
</tr> </tbody>
</table>
Expand All @@ -2349,7 +2351,8 @@ Get a remaining overage from data sets. A metric totals helper.
</tr><tr>
<td>params.tallyData</td><td><code>Array</code></td><td></td>
</tr><tr>
<td>params.isCurrent</td><td><code>boolean</code></td><td><p>Is the current value the &quot;current month&quot;. A proxy value passed through &quot;graphCardMetricTotals&quot;</p>
<td>params.isCurrent</td><td><code>boolean</code></td><td><p>Is the current value the &quot;current month&quot;. A proxy value passed through
&quot;graphCardMetricTotals&quot;</p>
</td>
</tr> </tbody>
</table>
Expand Down Expand Up @@ -2817,7 +2820,8 @@ See, https://react.i18next.com/
</ul>
</td>
</tr><tr>
<td>components</td><td><code>Array</code></td><td></td><td><p>An array of HTML/React nodes used to replace string tokens. i.e. &quot;[<span />, &lt;React.Fragment /&gt;]&quot;</p>
<td>components</td><td><code>Array</code></td><td></td><td><p>An array of HTML/React nodes used to replace string tokens.
i.e. &quot;[<span />, &lt;React.Fragment /&gt;]&quot;</p>
</td>
</tr><tr>
<td>settings</td><td><code>object</code></td><td></td><td></td>
Expand Down
2 changes: 1 addition & 1 deletion src/components/bannerMessages/bannerMessagesContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const useSetBannerMessages = ({
* Set application messages for banner display
*
* @callback setBannerMessages
* @param {Array<{ id: string, message: string, title: string, variant: string }>|{ id: string, message: string, title: string, variant: string }} messages
* @param {Array|{ id: string, message: string, title: string, variant: string }} messages
*/
return useCallback(
messages => {
Expand Down
16 changes: 8 additions & 8 deletions src/components/chart/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ const Chart = ({
/**
* Prop types.
*
* @type {{chartTooltip: React.ReactNode|Function, xValueFormat: Function, padding: {top: number, left: number, bottom: number,
* right: number}, xAxisTickFormat: Function, themeColor: string, chartLegend: React.ReactNode|Function,
* yAxisTickFormat: Function, dataSets: Array, xAxisFixLabelOverlap: boolean, xAxisLabelIncrement: number,
* yValueFormat: Function}}
* @type {{chartTooltip: React.ReactNode|Function, xValueFormat: Function, padding: {top: number, left: number,
* bottom: number, right: number}, xAxisTickFormat: Function, themeColor: string, chartLegend:
* React.ReactNode|Function, yAxisTickFormat: Function, dataSets: Array, xAxisFixLabelOverlap: boolean,
* xAxisLabelIncrement: number, yValueFormat: Function}}
*/
Chart.propTypes = {
chartLegend: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
Expand Down Expand Up @@ -227,10 +227,10 @@ Chart.propTypes = {
/**
* Default props.
*
* @type {{chartTooltip: React.ReactNode|Function, xValueFormat: Function, padding: {top: number, left: number, bottom: number,
* right: number}, xAxisTickFormat: Function, themeColor: string, chartLegend: React.ReactNode|Function,
* yAxisTickFormat: Function, dataSets: Array, xAxisFixLabelOverlap: boolean, xAxisLabelIncrement: number,
* yValueFormat: Function}}
* @type {{chartTooltip: React.ReactNode|Function, xValueFormat: Function, padding: {top: number, left: number,
* bottom: number, right: number}, xAxisTickFormat: Function, themeColor: string, chartLegend:
* React.ReactNode|Function, yAxisTickFormat: Function, dataSets: Array, xAxisFixLabelOverlap: boolean,
* xAxisLabelIncrement: number, yValueFormat: Function}}
*/
Chart.defaultProps = {
chartLegend: null,
Expand Down
4 changes: 2 additions & 2 deletions src/components/graphCard/graphCardChartLegend.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ GraphCardChartLegend.propTypes = {
/**
* Default props.
*
* @type {{datum: {dataSets: Array}, useProduct: Function, t: Function, useGraphCardContext: Function, useDispatch: Function,
* useSelectors: Function, chart: {hide: Function, toggle: Function, isToggled: Function}}}
* @type {{datum: {dataSets: Array}, useProduct: Function, t: Function, useGraphCardContext: Function,
* useDispatch: Function, useSelectors: Function, chart: {hide: Function, toggle: Function, isToggled: Function}}}
*/
GraphCardChartLegend.defaultProps = {
chart: {
Expand Down
9 changes: 6 additions & 3 deletions src/components/graphCard/graphCardHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ const getMetricTotalCurrentOrLastData = helpers.memo(
*
* @param {object} params
* @param {object} params.dataSet
* @param {boolean} params.isCurrent Is the current value the "current month". A proxy value passed through "graphCardMetricTotals"
* @param {boolean} params.isCurrent Is the current value the "current month". A proxy value passed through
* "graphCardMetricTotals"
* @returns {{chartId: string, metricId: string, monthlyHasData: boolean, dailyValue: number, dailyDate: string,
* monthlyValue: number, monthlyDate: string, dailyHasData: boolean}}
*/
Expand Down Expand Up @@ -416,7 +417,8 @@ const getPrepaidTallyCapacity = helpers.memo(
* @param {object} params
* @param {Array} params.capacityData
* @param {Array} params.tallyData
* @param {boolean} params.isCurrent Is the current value the "current month". A proxy value passed through "graphCardMetricTotals"
* @param {boolean} params.isCurrent Is the current value the "current month". A proxy value passed
* through "graphCardMetricTotals"
* @returns {{remainingCapacityHasData: boolean, remainingCapacity: number}}
*/
const getRemainingCapacity = helpers.memo(
Expand Down Expand Up @@ -453,7 +455,8 @@ const getRemainingCapacity = helpers.memo(
* @param {object} params
* @param {Array} params.capacityData
* @param {Array} params.tallyData
* @param {boolean} params.isCurrent Is the current value the "current month". A proxy value passed through "graphCardMetricTotals"
* @param {boolean} params.isCurrent Is the current value the "current month". A proxy value passed through
* "graphCardMetricTotals"
* @returns {{remainingOverage: number, remainingOverageHasData: boolean}}
*/
const getRemainingOverage = helpers.memo(
Expand Down
3 changes: 2 additions & 1 deletion src/components/i18n/i18nHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ const setI18nTestElement = ({ defaultTestId, testId }) => {
* - A default string if the key can't be found.
* - An object with i18next settings. i.e. "{ context: Array|string, testId: boolean|string|React.ReactNode }"
* - An array of objects (key/value) pairs used to replace string tokens. i.e. "[{ hello: 'world' }]"
* @param {Array} components An array of HTML/React nodes used to replace string tokens. i.e. "[<span />, <React.Fragment />]"
* @param {Array} components An array of HTML/React nodes used to replace string tokens.
* i.e. "[<span />, <React.Fragment />]"
* @param {object} settings
* @param {*} settings.i18next
* @param {Function} settings.isDebug
Expand Down
3 changes: 2 additions & 1 deletion src/components/inventoryCard/inventoryCardHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ const normalizeInventorySettings = ({ filters = [], guestFilters = [], settings
* @param {object} params.query
* @param {object} params.session
* @param {object} params.settings
* @returns {{dataSetColumnHeaders: Array, resultsPerPage: number, resultsOffset: number, dataSetRows: Array, resultsCount: number}}
* @returns {{dataSetColumnHeaders: Array, resultsPerPage: number, resultsOffset: number, dataSetRows: Array,
* resultsCount: number}}
*/
const parseInventoryResponse = ({
data = {},
Expand Down
3 changes: 2 additions & 1 deletion src/components/messageView/messageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const MessageView = ({ children, icon, message, pageTitle, title }) => (
/**
* Prop types.
*
* @type {{children: React.ReactNode, icon: React.ReactNode|Function, message: string, pageTitle: string, title: string}}
* @type {{children: React.ReactNode, icon: React.ReactNode|Function, message: string, pageTitle: string,
* title: string}}
*/
MessageView.propTypes = {
children: PropTypes.node,
Expand Down
6 changes: 4 additions & 2 deletions src/components/optinView/optinView.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ const OptinView = ({
/**
* Prop types.
*
* @type {{useSession: Function, t: Function, updateAccountOptIn: Function, useDispatch: Function, useSelectorsResponse: Function}}
* @type {{useSession: Function, t: Function, updateAccountOptIn: Function, useDispatch: Function,
* useSelectorsResponse: Function}}
*/
OptinView.propTypes = {
t: PropTypes.func,
Expand All @@ -215,7 +216,8 @@ OptinView.propTypes = {
/**
* Default props.
*
* @type {{useSession: Function, t: Function, updateAccountOptIn: Function, useDispatch: Function, useSelectorsResponse: Function}}
* @type {{useSession: Function, t: Function, updateAccountOptIn: Function, useDispatch: Function,
* useSelectorsResponse: Function}}
*/
OptinView.defaultProps = {
t: translate,
Expand Down
3 changes: 2 additions & 1 deletion src/components/table/tableHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ const tableHeader = ({
* @param {Function} params.onExpand
* @param {Function} params.onSelect
* @param {Array} params.rows
* @returns {{isExpandableCell: boolean, isSelectTable: boolean, isExpandableRow: boolean, isAllSelected: boolean, rows: any[]}}
* @returns {{isExpandableCell: boolean, isSelectTable: boolean, isExpandableRow: boolean, isAllSelected: boolean,
* rows: any[]}}
*/
const tableRows = ({ onExpand, onSelect, rows = [] } = {}) => {
const updatedRows = [];
Expand Down
3 changes: 2 additions & 1 deletion src/redux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ Get a RHSM response from multiple Tally, or Capacity, IDs and metrics.
</thead>
<tbody>
<tr>
<td>idMetric</td><td><code>object</code> | <code>Array</code></td><td><p>An object, or an Array of objects, in the form of { id: PRODUCT_ID, metric: METRIC_ID, isCapacity: boolean }</p>
<td>idMetric</td><td><code>object</code> | <code>Array</code></td><td><p>An object, or an Array of objects, in the form of { id: PRODUCT_ID, metric: METRIC_ID,
isCapacity: boolean }</p>
</td>
</tr><tr>
<td>query</td><td><code>object</code></td><td></td>
Expand Down
3 changes: 2 additions & 1 deletion src/redux/actions/rhsmActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { generateChartIds } from '../../components/graphCard/graphCardHelpers';
/**
* Get a RHSM response from multiple Tally, or Capacity, IDs and metrics.
*
* @param {object|Array} idMetric An object, or an Array of objects, in the form of { id: PRODUCT_ID, metric: METRIC_ID, isCapacity: boolean }
* @param {object|Array} idMetric An object, or an Array of objects, in the form of { id: PRODUCT_ID, metric: METRIC_ID,
* isCapacity: boolean }
* @param {object} query
* @param {object} options
* @param {string} options.cancelId
Expand Down
5 changes: 3 additions & 2 deletions src/redux/types/rhsmTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ const GET_SUBSCRIPTIONS_INVENTORY_RHSM = 'GET_SUBSCRIPTIONS_INVENTORY_RHSM';
/**
* RHSM API action, reducer types.
*
* @type {{GET_GRAPH_REPORT_CAPACITY_RHSM: string, GET_GRAPH_CAPACITY_RHSM: string, GET_INSTANCES_INVENTORY_GUESTS_RHSM: string,
* GET_SUBSCRIPTIONS_INVENTORY_RHSM: string, GET_INSTANCES_INVENTORY_RHSM: string, GET_GRAPH_TALLY_RHSM: string}}
* @type {{GET_GRAPH_REPORT_CAPACITY_RHSM: string, GET_GRAPH_CAPACITY_RHSM: string, GET_INSTANCES_INVENTORY_GUESTS_RHSM:
* string, GET_SUBSCRIPTIONS_INVENTORY_RHSM: string, GET_INSTANCES_INVENTORY_RHSM: string, GET_GRAPH_TALLY_RHSM:
* string}}
*/
const rhsmTypes = {
GET_GRAPH_CAPACITY_RHSM,
Expand Down
18 changes: 12 additions & 6 deletions src/services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -892,10 +892,12 @@ Get RHSM API instances table/inventory guests data.
</tr><tr>
<td>options.cancelId</td><td><code>string</code></td><td></td>
</tr><tr>
<td>options.schema</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response, ie. [SUCCESS SCHEMA, ERROR SCHEMA]</p>
<td>options.schema</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response,
ie. [SUCCESS SCHEMA, ERROR SCHEMA]</p>
</td>
</tr><tr>
<td>options.transform</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response, ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]</p>
<td>options.transform</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response,
ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]</p>
</td>
</tr> </tbody>
</table>
Expand Down Expand Up @@ -928,10 +930,12 @@ Get RHSM API instances data.
</tr><tr>
<td>options.cancelId</td><td><code>string</code></td><td></td>
</tr><tr>
<td>options.schema</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response, ie. [SUCCESS SCHEMA, ERROR SCHEMA]</p>
<td>options.schema</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response,
ie. [SUCCESS SCHEMA, ERROR SCHEMA]</p>
</td>
</tr><tr>
<td>options.transform</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response, ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]</p>
<td>options.transform</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response,
ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]</p>
</td>
</tr> </tbody>
</table>
Expand Down Expand Up @@ -964,10 +968,12 @@ Get RHSM API subscriptions data.
</tr><tr>
<td>options.cancelId</td><td><code>string</code></td><td></td>
</tr><tr>
<td>options.schema</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response, ie. [SUCCESS SCHEMA, ERROR SCHEMA]</p>
<td>options.schema</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response,
ie. [SUCCESS SCHEMA, ERROR SCHEMA]</p>
</td>
</tr><tr>
<td>options.transform</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response, ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]</p>
<td>options.transform</td><td><code>Array</code></td><td><p>An array of callbacks used to transform the response,
ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]</p>
</td>
</tr> </tbody>
</table>
Expand Down
30 changes: 20 additions & 10 deletions src/services/rhsm/rhsmServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -1194,8 +1194,10 @@ const getApiVersion = (options = {}) => {
* @param {boolean} options.cache
* @param {boolean} options.cancel
* @param {string} options.cancelId
* @param {Array} options.schema An array of callbacks used to transform the response, ie. [SUCCESS SCHEMA, ERROR SCHEMA]
* @param {Array} options.transform An array of callbacks used to transform the response, ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]
* @param {Array} options.schema An array of callbacks used to transform the response,
* ie. [SUCCESS SCHEMA, ERROR SCHEMA]
* @param {Array} options.transform An array of callbacks used to transform the response,
* ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]
* @returns {Promise<*>}
*/
const getGraphTally = (id, params = {}, options = {}) => {
Expand Down Expand Up @@ -1225,7 +1227,8 @@ const getGraphTally = (id, params = {}, options = {}) => {
};

/**
* @api {get} /api/rhsm-subscriptions/v1/capacity/products/:product_id/:metric_id Get RHSM graph capacity data, i.e. thresholds
* @api {get} /api/rhsm-subscriptions/v1/capacity/products/:product_id/:metric_id Get RHSM graph capacity data,
* i.e. thresholds
* @apiDescription Retrieve graph capacity data, such as thresholds.
*
* Reference [RHSM for capacity params and commands](https://github.com/RedHatInsights/rhsm-subscriptions/blob/main/api/rhsm-subscriptions-api-spec.yaml)
Expand Down Expand Up @@ -1510,7 +1513,8 @@ const getGraphCapacity = (id, params = {}, options = {}) => {

/**
* @apiMock {DelayResponse} 250
* @api {get} /api/rhsm-subscriptions/v1/instances/:instance_id/guests Get RHSM instances/systems table/inventory guests data
* @api {get} /api/rhsm-subscriptions/v1/instances/:instance_id/guests Get RHSM instances/systems
* table/inventory guests data
* @apiDescription Retrieve instances/systems table/inventory guests data.
*
* Reference [RHSM for instances guests](https://github.com/RedHatInsights/rhsm-subscriptions/blob/main/api/rhsm-subscriptions-api-spec.yaml)
Expand Down Expand Up @@ -1624,8 +1628,10 @@ const getGraphCapacity = (id, params = {}, options = {}) => {
* @param {boolean} options.cache
* @param {boolean} options.cancel
* @param {string} options.cancelId
* @param {Array} options.schema An array of callbacks used to transform the response, ie. [SUCCESS SCHEMA, ERROR SCHEMA]
* @param {Array} options.transform An array of callbacks used to transform the response, ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]
* @param {Array} options.schema An array of callbacks used to transform the response,
* ie. [SUCCESS SCHEMA, ERROR SCHEMA]
* @param {Array} options.transform An array of callbacks used to transform the response,
* ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]
* @returns {Promise<*>}
*/
const getInstancesInventoryGuests = (id, params = {}, options = {}) => {
Expand Down Expand Up @@ -1772,8 +1778,10 @@ const getInstancesInventoryGuests = (id, params = {}, options = {}) => {
* @param {boolean} options.cache
* @param {boolean} options.cancel
* @param {string} options.cancelId
* @param {Array} options.schema An array of callbacks used to transform the response, ie. [SUCCESS SCHEMA, ERROR SCHEMA]
* @param {Array} options.transform An array of callbacks used to transform the response, ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]
* @param {Array} options.schema An array of callbacks used to transform the response,
* ie. [SUCCESS SCHEMA, ERROR SCHEMA]
* @param {Array} options.transform An array of callbacks used to transform the response,
* ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]
* @returns {Promise<*>}
*/
const getInstancesInventory = (id, params = {}, options = {}) => {
Expand Down Expand Up @@ -1891,8 +1899,10 @@ const getInstancesInventory = (id, params = {}, options = {}) => {
* @param {boolean} options.cache
* @param {boolean} options.cancel
* @param {string} options.cancelId
* @param {Array} options.schema An array of callbacks used to transform the response, ie. [SUCCESS SCHEMA, ERROR SCHEMA]
* @param {Array} options.transform An array of callbacks used to transform the response, ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]
* @param {Array} options.schema An array of callbacks used to transform the response,
* ie. [SUCCESS SCHEMA, ERROR SCHEMA]
* @param {Array} options.transform An array of callbacks used to transform the response,
* ie. [SUCCESS TRANSFORM, ERROR TRANSFORM]
* @returns {Promise<*>}
*/
const getSubscriptionsInventory = (id, params = {}, options = {}) => {
Expand Down

0 comments on commit 1a675ac

Please sign in to comment.