Skip to content

Commit

Permalink
ESLint: Fix a bunch of ESLint alignment warnings (#47872)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored Feb 8, 2023
1 parent dcfdba8 commit 8dee3e6
Show file tree
Hide file tree
Showing 61 changed files with 308 additions and 308 deletions.
2 changes: 1 addition & 1 deletion bin/plugin/commands/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function formatTime( number ) {
/**
* Curate the raw performance results.
*
* @param {string} testSuite
* @param {string} testSuite
* @param {WPRawPerformanceResults} results
*
* @return {WPPerformanceResults} Curated Performance results.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/data/data-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ _Parameters_

- _kind_ `string`: Kind of the edited entity record.
- _name_ `string`: Name of the edited entity record.
- _recordId_ `number`: Record ID of the edited entity record.
- _recordId_ `number|string`: Record ID of the edited entity record.
- _edits_ `Object`: The edits.
- _options_ `Object`: Options for the edit.
- _options.undoIgnore_ `[boolean]`: Whether to ignore the edit in undo history or not.
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/table-of-contents/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface NestedHeadingData {
* Takes a flat list of heading parameters and nests them based on each header's
* immediate parent's level.
*
* @param headingList The flat list of headings to nest.
* @param headingList The flat list of headings to nest.
*
* @return The nested list of headings.
*/
Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/alignment-matrix-control/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const ALIGNMENTS = GRID.flat();
/**
* Parses and transforms an incoming value to better match the alignment values
*
* @param value An alignment value to parse.
* @param value An alignment value to parse.
*
* @return The parsed value.
*/
Expand All @@ -46,8 +46,8 @@ export function transformValue( value: AlignmentMatrixControlValue ) {
/**
* Creates an item ID based on a prefix ID and an alignment value.
*
* @param prefixId An ID to prefix.
* @param value An alignment value.
* @param prefixId An ID to prefix.
* @param value An alignment value.
*
* @return The item id.
*/
Expand All @@ -63,7 +63,7 @@ export function getItemId(
/**
* Retrieves the alignment index from a value.
*
* @param alignment Value to check.
* @param alignment Value to check.
*
* @return The index of a matching alignment.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/base-control/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { BaseControlProps } from './types';
*
* Namely, it takes care of generating a unique `id`, properly associating it with the `label` and `help` elements.
*
* @param props
* @param props
*/
export function useBaseControlProps(
props: Omit< BaseControlProps, 'children' >
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/border-box-control/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const getMostCommonUnit = (
* Finds the mode value out of the array passed favouring the first value
* as a tiebreaker.
*
* @param values Values to determine the mode from.
* @param values Values to determine the mode from.
*
* @return The mode value.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/date-time/time/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function from12hTo24h( hours: number, isPm: boolean ) {
* given width. For example, the hours and minutes inputs are padded to 2 so
* that '4' appears as '04'.
*
* @param pad How many digits the value should be.
* @param pad How many digits the value should be.
*/
function buildPadInputStateReducer( pad: number ) {
return ( state: InputState, action: InputAction ) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/date-time/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { toDate } from 'date-fns';
* Like date-fn's toDate, but tries to guess the format when a string is
* given.
*
* @param input Value to turn into a date.
* @param input Value to turn into a date.
*/
export function inputToDate( input: Date | string | number ): Date {
if ( typeof input === 'string' ) {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/draggable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function Draggable( {
/**
* Removes the element clone, resets cursor, and removes drag listener.
*
* @param event The non-custom DragEvent.
* @param event The non-custom DragEvent.
*/
function end( event: DragEvent ) {
event.preventDefault();
Expand All @@ -94,7 +94,7 @@ export function Draggable( {
* - Sets transfer data.
* - Adds dragover listener.
*
* @param event The non-custom DragEvent.
* @param event The non-custom DragEvent.
*/
function start( event: DragEvent ) {
const { ownerDocument } = event.target as HTMLElement;
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/focal-point-picker/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const VIDEO_EXTENSIONS = [
/**
* Gets the extension of a file name.
*
* @param filename The file name.
* @param filename The file name.
* @return The extension of the file name.
*/
export function getExtension( filename = '' ): string {
Expand All @@ -30,7 +30,7 @@ export function getExtension( filename = '' ): string {
/**
* Checks if a file is a video.
*
* @param filename The file name.
* @param filename The file name.
* @return Whether the file is a video.
*/
export function isVideoType( filename: string = '' ): boolean {
Expand All @@ -44,7 +44,7 @@ export function isVideoType( filename: string = '' ): boolean {
/**
* Transforms a fraction value to a percentage value.
*
* @param fraction The fraction value.
* @param fraction The fraction value.
* @return A percentage value.
*/
export function fractionToPercentage( fraction: number ): number {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/font-size-picker/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { parseQuantityAndUnitFromRawValue } from '../unit-control';
* Some themes use css vars for their font sizes, so until we
* have the way of calculating them don't display them.
*
* @param value The value that is checked.
* @param value The value that is checked.
* @return Whether the value is a simple css value.
*/
export function isSimpleCssValue(
Expand All @@ -27,7 +27,7 @@ export function isSimpleCssValue(
* If all of the given font sizes have the same unit (e.g. 'px'), return that
* unit. Otherwise return null.
*
* @param fontSizes List of font sizes.
* @param fontSizes List of font sizes.
* @return The common unit, or null.
*/
export function getCommonSizeUnit( fontSizes: FontSize[] ) {
Expand Down
10 changes: 5 additions & 5 deletions packages/components/src/input-control/reducer/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import type { InputChangeCallback } from '../types';
/**
* Prepares initialState for the reducer.
*
* @param initialState The initial state.
* @param initialState The initial state.
* @return Prepared initialState for the reducer
*/
function mergeInitialState(
Expand All @@ -45,7 +45,7 @@ function mergeInitialState(
* exception for CONTROL actions is because they represent controlled updates
* from props and no case has yet presented for their specialization.
*
* @param composedStateReducers A reducer to specialize state changes.
* @param composedStateReducers A reducer to specialize state changes.
* @return The reducer.
*/
function inputControlStateReducer(
Expand Down Expand Up @@ -140,9 +140,9 @@ function inputControlStateReducer(
* This technique uses the "stateReducer" design pattern:
* https://kentcdodds.com/blog/the-state-reducer-pattern/
*
* @param stateReducer An external state reducer.
* @param initialState The initial state for the reducer.
* @param onChangeHandler A handler for the onChange event.
* @param stateReducer An external state reducer.
* @param initialState The initial state for the reducer.
* @param onChangeHandler A handler for the onChange event.
* @return State, dispatch, and a collection of actions.
*/
export function useInputControlStateReducer(
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/input-control/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type { InputChangeCallback } from './types';
/**
* Gets a CSS cursor value based on a drag direction.
*
* @param dragDirection The drag direction.
* @param dragDirection The drag direction.
* @return The CSS cursor value.
*/
export function getDragCursor( dragDirection: string ): string {
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/popover/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const POSITION_TO_PLACEMENT: Record<
* Converts the `Popover`'s legacy "position" prop to the new "placement" prop
* (used by `floating-ui`).
*
* @param position The legacy position
* @param position The legacy position
* @return The corresponding placement
*/
export const positionToPlacement = (
Expand Down Expand Up @@ -112,7 +112,7 @@ const PLACEMENT_TO_ANIMATION_ORIGIN: Record<
* Given the floating-ui `placement`, compute the framer-motion props for the
* popover's entry animation.
*
* @param placement A placement string from floating ui
* @param placement A placement string from floating ui
* @return The object containing the motion props
*/
export const placementToMotionAnimationProps = (
Expand Down Expand Up @@ -142,7 +142,7 @@ export const placementToMotionAnimationProps = (
/**
* Returns the offset of a document's frame element.
*
* @param document The iframe's owner document.
* @param document The iframe's owner document.
*
* @return The offset of the document's frame element, or undefined if the
* document has no frame element.
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/query-controls/terms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
/**
* Returns terms in a tree form.
*
* @param flatTerms Array of terms in flat format.
* @param flatTerms Array of terms in flat format.
*
* @return Terms in tree format.
*/
Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/range-control/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import type { UseControlledRangeValueArgs } from './types';
/**
* A float supported clamp function for a specific value.
*
* @param value The value to clamp.
* @param min The minimum value.
* @param max The maximum value.
* @param value The value to clamp.
* @param min The minimum value.
* @param max The maximum value.
*
* @return A (float) number
*/
Expand All @@ -31,7 +31,7 @@ export function floatClamp( value: number | null, min: number, max: number ) {
/**
* Hook to store a clamped value, derived from props.
*
* @param settings
* @param settings
* @return The controlled value and the value setter.
*/
export function useControlledRangeValue(
Expand Down
28 changes: 14 additions & 14 deletions packages/components/src/resizable-box/resize-tooltip/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ interface UseResizeLabelArgs {
* Custom hook that manages resize listener events. It also provides a label
* based on current resize width x height values.
*
* @param props
* @param props.axis Only shows the label corresponding to the axis.
* @param props.fadeTimeout Duration (ms) before deactivating the resize label.
* @param props.onResize Callback when a resize occurs. Provides { width, height } callback.
* @param props.position Adjusts label value.
* @param props.showPx Whether to add `PX` to the label.
* @param props
* @param props.axis Only shows the label corresponding to the axis.
* @param props.fadeTimeout Duration (ms) before deactivating the resize label.
* @param props.onResize Callback when a resize occurs. Provides { width, height } callback.
* @param props.position Adjusts label value.
* @param props.showPx Whether to add `PX` to the label.
*
* @return Properties for hook.
*/
Expand Down Expand Up @@ -174,14 +174,14 @@ interface GetSizeLabelArgs {
/**
* Gets the resize label based on width and height values (as well as recent changes).
*
* @param props
* @param props.axis Only shows the label corresponding to the axis.
* @param props.height Height value.
* @param props.moveX Recent width (x axis) changes.
* @param props.moveY Recent width (y axis) changes.
* @param props.position Adjusts label value.
* @param props.showPx Whether to add `PX` to the label.
* @param props.width Width value.
* @param props
* @param props.axis Only shows the label corresponding to the axis.
* @param props.height Height value.
* @param props.moveX Recent width (x axis) changes.
* @param props.moveY Recent width (y axis) changes.
* @param props.position Adjusts label value.
* @param props.showPx Whether to add `PX` to the label.
* @param props.width Width value.
*
* @return The rendered label.
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/snackbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const NOTICE_TIMEOUT = 10000;
* Custom hook which announces the message with the given politeness, if a
* valid message is provided.
*
* @param message Message to announce.
* @param politeness Politeness to announce.
* @param message Message to announce.
* @param politeness Politeness to announce.
*/
function useSpokenMessage(
message: SnackbarProps[ 'spokenMessage' ],
Expand Down
14 changes: 7 additions & 7 deletions packages/components/src/ui/context/context-connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ type ContextConnectOptions = {
* Forwards ref (React.ForwardRef) and "Connects" (or registers) a component
* within the Context system under a specified namespace.
*
* @param Component The component to register into the Context system.
* @param namespace The namespace to register the component under.
* @param Component The component to register into the Context system.
* @param namespace The namespace to register the component under.
* @return The connected WordPressComponent
*/
export function contextConnect<
Expand All @@ -50,8 +50,8 @@ export function contextConnect<
* "Connects" (or registers) a component within the Context system under a specified namespace.
* Does not forward a ref.
*
* @param Component The component to register into the Context system.
* @param namespace The namespace to register the component under.
* @param Component The component to register into the Context system.
* @param namespace The namespace to register the component under.
* @return The connected WordPressComponent
*/
export function contextConnectWithoutRef< P >(
Expand Down Expand Up @@ -110,7 +110,7 @@ function _contextConnect<
/**
* Attempts to retrieve the connected namespace from a component.
*
* @param Component The component to retrieve a namespace from.
* @param Component The component to retrieve a namespace from.
* @return The connected namespaces.
*/
export function getConnectNamespace(
Expand Down Expand Up @@ -138,8 +138,8 @@ export function getConnectNamespace(
/**
* Checks to see if a component is connected within the Context system.
*
* @param Component The component to retrieve a namespace from.
* @param match The namespace to check.
* @param Component The component to retrieve a namespace from.
* @param match The namespace to check.
*/
export function hasConnectNamespace(
Component: ReactNode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import memoize from 'memize';
/**
* Generates the connected component CSS className based on the namespace.
*
* @param namespace The name of the connected component.
* @param namespace The name of the connected component.
* @return The generated CSS className.
*/
function getStyledClassName( namespace: string ): string {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/utils/get-valid-children.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Children, isValidElement } from '@wordpress/element';
/**
* Gets a collection of available children elements from a React component's children prop.
*
* @param children
* @param children
*
* @return An array of available children.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/utils/space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const GRID_BASE = '4px';
* When given a unit value or one of the named CSS values like `auto`,
* it will simply return the value back.
*
* @param value A number, numeric string, or a unit value.
* @param value A number, numeric string, or a unit value.
*/
export function space( value?: SpaceInput ): string | undefined {
if ( typeof value === 'undefined' ) {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/unit-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ function UnforwardedUnitControl(
* This allows us to tap into actions to transform the (next) state for
* InputControl.
*
* @param state State from InputControl
* @param action Action triggering state change
* @param state State from InputControl
* @param action Action triggering state change
* @return The updated state to apply to InputControl
*/
const unitControlStateReducer: StateReducer = ( state, action ) => {
Expand Down
Loading

1 comment on commit 8dee3e6

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 8dee3e6.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4124364456
📝 Reported issues:

Please sign in to comment.