Skip to content

Commit

Permalink
chore(deps): update linters (major) (#80830)
Browse files Browse the repository at this point in the history
* chore(deps): update linters

* Revert stylelint update to match @wordpress/stylelint-config version

* Fix some lint warnings and errors

* Make @typescript-eslint/no-explicit-any a warning

---------

Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Marin Atanasov <[email protected]>
  • Loading branch information
3 people authored Sep 27, 2023
1 parent 5a2c8c0 commit e1f240e
Show file tree
Hide file tree
Showing 1,208 changed files with 789 additions and 3,032 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ module.exports = {
extendDefaults: true,
},
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-unused-vars': [ 'error', { ignoreRestSiblings: true } ],
Expand Down
1 change: 0 additions & 1 deletion apps/blaze-dashboard/filter-json-config-loader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* The loader parses a config file and filters out the keys needed by the app, so that we don't load the whole config file.
*
* @param {*} source Content of source file.
* @returns filtered content of source file.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* Detect if the editor is already iFramed.
*
* @returns {boolean} `True` is the editor is iFramed. Otherwise, `False`.
*/
export const inIframe = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { useState, useEffect } from '@wordpress/element';
* or jetpack/recurring-payments.
* Selecting a block whose direct parent has 'payments' in the name also counts.
* This is to account for clicking inside the button in a payments block, for example.
*
* @returns {boolean} Has the user selected a payments block (or a direct descendant) at least once?
*/
const useHasSelectedPaymentBlockOnce = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';

/**
* Assigns timezone to a date without altering it
*
* @param {string} date a date in YYYY-MM-DDTHH:mm:ss format
* @param {number} offset the offset in hours
* @returns a moment instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { isEmpty, isEqual } from 'lodash';

/**
* DOM updater
*
* @param {string[]} options A list of option names to keep track of.
* @param {Function} getOptionValue A function that given an option name as a string, returns the current option value.
*/
Expand All @@ -24,7 +23,6 @@ export default ( options, getOptionValue ) => {
* Do nothing until the editor is ready. This is required when
* working in wpcom iframe environment to avoid running code before
* everything has loaded, which can cause bugs like the following.
*
* @see https://github.com/Automattic/wp-calypso/pull/40690
*/
const isEditorReady = select( 'core/editor' ).__unstableIsEditorReady;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

/**
* Dynamically set WebPack's publicPath so that split assets can be found.
*
* @see https://webpack.js.org/guides/public-path/#on-the-fly
*/
if ( typeof window === 'object' && window.whatsNewAssetsUrl ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

/**
* Dynamically set WebPack's publicPath so that split assets can be found.
*
* @see https://webpack.js.org/guides/public-path/#on-the-fly
*/
if ( typeof window === 'object' && window.wpcomBlockEditorNuxAssetsUrl ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ function WpcomNux() {

/**
* This function returns a collection of NUX slide data
*
* @returns { Array } a collection of <NuxPage /> props
*/
function getWpcomNuxPages() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

/**
* Dynamically set WebPack's publicPath so that split assets can be found.
*
* @see https://webpack.js.org/guides/public-path/#on-the-fly
*/
if ( typeof window === 'object' && window.wpcomGlobalStyles?.assetsUrl ) {
Expand Down
1 change: 0 additions & 1 deletion apps/editing-toolkit/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const isDevelopment = process.env.NODE_ENV !== 'production';
*
* Arguments to this function replicate webpack's so this config can be used on the command line,
* with individual options overridden by command line args.
*
* @see {@link https://webpack.js.org/configuration/configuration-types/#exporting-a-function}
* @see {@link https://webpack.js.org/api/cli/}
* @param {Object} env environment options
Expand Down
4 changes: 0 additions & 4 deletions apps/notifications/src/panel/helpers/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ function getActionBlock( blocks ) {

/**
* Returns an object specifying which actions are enabled for a note and their values
*
* @param note
* @returns {Object}
*/
Expand All @@ -17,7 +16,6 @@ export function getActions( note ) {

/**
* Returns an id for a type of reference in a note or null
*
* @param note
* @param {string} type can be 'post', 'comment', 'site', etc...
* @returns {number|null} null if no reference of type is found
Expand All @@ -35,7 +33,6 @@ export function getReferenceId( note, type ) {
* It's a Calypso link for WP.com sites and
* Jetpack sites with the `edit_links_calypso_redirect` option set.
* It's a wp-admin link otherwise.
*
* @param note
* @returns {string}
*/
Expand All @@ -45,7 +42,6 @@ export function getEditCommentLink( note ) {

/**
* Returns the new post link for the note post.
*
* @param note
* @returns {string}
*/
Expand Down
1 change: 0 additions & 1 deletion apps/notifications/src/panel/helpers/use-safe.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useCallback, useRef, useLayoutEffect } from 'react';
/**
* Hook to be used to make sure a function `fn` is called only
* if the component which uses it is still mounted.
*
* @param {Function} fn A function you want to be safe to call
*/
export default function useSafe( fn ) {
Expand Down
2 changes: 0 additions & 2 deletions apps/notifications/src/panel/indices-to-html/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import noticon2gridicon from '../utils/noticon2gridicon';
/**
* Create the actual DOM nodes for a given piece of text/ranges and
* recurse downward into the range tree if necessary.
*
* @param {string} new_sub_text Plaintext on which ranges act
* @param {Array} new_sub_range Position/applicable ranges array
* @param {Object} range_info The origin range data for this render
Expand Down Expand Up @@ -171,7 +170,6 @@ function render_range( new_sub_text, new_sub_range, range_info, range_data, opti

/**
* Recurse into the data and produce DOM node output
*
* @param {string} sub_text Plain-text upon which ranges act
* @param {Array} sub_ranges Position/applicable ranges array
* @param {Array} range_data All range data
Expand Down
1 change: 0 additions & 1 deletion apps/notifications/src/panel/rest-client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ function cleanupLocalCache() {
* Update lastSeenTime in object instance, localStorage, and remote database.
* Advance this.lastSeenTime to proposedTime or the latest visible note time.
* If the timestamp comes from a note, update the remote database.
*
* @param {number} proposedTime A proposed update to our lastSeenTime timestamp
* @param {boolean} fromStorage Whether this call is from handleStorageEvent
* @returns {boolean} whether or not we will update our lastSeenTime value
Expand Down
1 change: 0 additions & 1 deletion apps/notifications/src/panel/rest-client/wpcom.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const markReadStatus = ( noteId, isRead, callback ) =>

/**
* Mark post as seen using the new more granular per post API.
*
* @param blogId blog identifier
* @param postId post identifier
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* Combines an array of action types and handler methods into one larger object,
* containing one key for each action type and an associated array that
* contains all that type's handler methods.
*
* @param {Array.<ActionHandler>} handlers An array of ActionHandlers.
* @returns {ActionHandler} A combined representation of the inputs in one object.
*/
Expand Down
2 changes: 0 additions & 2 deletions apps/notifications/src/panel/state/notes/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const likeNote = ( noteId, isLiked ) => ( {
* the app so that stale data coming in from polling
* operations don't accidentally change this value to
* an incorrect state and cause a flash of the approval status.
*
* @see approveNote
* @param {number} noteId
* @returns {Object} action object
Expand All @@ -55,7 +54,6 @@ export const resetLocalApproval = ( noteId ) => ( {
* the app so that stale data coming in from polling
* operations don't accidentally change this value to
* an incorrect state and cause a flash of the like status.
*
* @see likeNote
* @param {number} noteId
* @returns {Object} action object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const byId = ( a, b ) => a.id - b.id;
* However, in order to keep the changeset
* small we are copying over this non-ideal
* code until more formal refactorings.
*
* @param {Object} notesState
* @returns {Object[]} list of notification objects
*/
Expand Down
1 change: 0 additions & 1 deletion apps/notifications/src/panel/utils/parse-json.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* Attempts to parse a string as JSON
*
* @param {?string} input possible JSON string
* @returns {*} parsed data or null on failure
*/
Expand Down
4 changes: 0 additions & 4 deletions apps/notifications/src/standalone/messaging.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* Provides functions to communicate with parent frame
*
* @module boot/messaging
*/

Expand All @@ -11,7 +10,6 @@ const debug = debugFactory( 'notifications:messaging' );

/**
* Handles an incoming message event
*
* @typedef {Function} MessageEventReceiver
* @throws {TypeError} When no data or invalid data comes in on the event
* @param {Object} event incoming event
Expand All @@ -25,7 +23,6 @@ const debug = debugFactory( 'notifications:messaging' );
* if the messages are valid to pass them down into the app
* and to the functions which actually respond to the data
* contained in the messages.
*
* @param {Function} receiver called with valid incoming messages
* @returns {MessageEventReceiver}
*/
Expand Down Expand Up @@ -68,7 +65,6 @@ export const receiveMessage = ( receiver ) => ( event ) => {

/**
* Sends outgoing messages to parent frame
*
* @param {Object} message data to send
* @returns {undefined}
*/
Expand Down
1 change: 0 additions & 1 deletion apps/notifications/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const shouldEmitStats = process.env.EMIT_STATS && process.env.EMIT_STATS !== 'fa
* Arguments to this function replicate webpack's so this config can be used on the command line,
* with individual options overridden by command line args. Note that webpack-cli seems to convert
* kebab-case (like `--ouput-path`) to camelCase (`outputPath`)
*
* @see {@link https://webpack.js.org/configuration/configuration-types/#exporting-a-function}
* @see {@link https://webpack.js.org/api/cli/}
* @param {Object} env environment options
Expand Down
1 change: 0 additions & 1 deletion apps/odyssey-stats/filter-json-config-loader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* The loader parses a config file and filters out the keys needed by the app, so that we don't load the whole config file.
*
* @param {*} source Content of source file.
* @returns filtered content of source file.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe( 'index', () => {
test( "should throw an error when given key doesn't exist (NODE_ENV == development)", () => {
process.env.NODE_ENV = 'development';

expect( () => config( fakeKey ) ).toThrowError( ReferenceError );
expect( () => config( fakeKey ) ).toThrow( ReferenceError );
} );

test( "should not throw an error when given key doesn't exist (NODE_ENV != development)", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ function triggerOverrideHandler( e ) {

/**
* Monitors Gutenberg store for draft ID assignment and transmits it to parent frame when needed.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function transmitDraftId( calypsoPort ) {
Expand All @@ -83,7 +82,6 @@ function transmitDraftId( calypsoPort ) {

/**
* Sends a message to the parent frame when the "Move to trash" button is clicked.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function handlePostTrash( calypsoPort ) {
Expand Down Expand Up @@ -142,7 +140,6 @@ function overrideRevisions( calypsoPort ) {
* Listens for post lock status changing to locked, and overrides the modal dialog
* actions, addind an event handler for the All Posts button, and changing the
* Take Over Url to work inside the iframe.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function handlePostLocked( calypsoPort ) {
Expand Down Expand Up @@ -189,7 +186,6 @@ function handlePostLocked( calypsoPort ) {
/**
* Listens for post lock status changing to locked, and for the post to have been taken over
* by another user, adding an event handler for the All Posts button.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function handlePostLockTakeover( calypsoPort ) {
Expand Down Expand Up @@ -257,7 +253,6 @@ function handlePostStatusChange( calypsoPort ) {
/**
* Listens for image changes or removals happening in the Media Modal,
* and updates accordingly all blocks containing them.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function handleUpdateImageBlocks( calypsoPort ) {
Expand All @@ -276,7 +271,6 @@ function handleUpdateImageBlocks( calypsoPort ) {

/**
* Updates all the blocks containing a given edited image.
*
* @param {Array} blocks Array of block objects for the current post.
* @param {Object} image The edited image.
* @param {number} image.id The image ID.
Expand Down Expand Up @@ -396,7 +390,6 @@ function handleUpdateImageBlocks( calypsoPort ) {
/**
* Listens for insert media events happening in a Media Modal opened in a Classic Block,
* and inserts the media into the appropriate block.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function handleInsertClassicBlockMedia( calypsoPort ) {
Expand All @@ -417,7 +410,6 @@ function handleInsertClassicBlockMedia( calypsoPort ) {
/**
* Prevents the default closing flow and sends a message to the parent frame to
* perform the navigation on the client side.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function handleCloseEditor( calypsoPort ) {
Expand Down Expand Up @@ -522,7 +514,6 @@ function isNavSidebarPresent() {

/**
* Modify links in order to open them in parent window and not in a child iframe.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
async function openLinksInParentFrame( calypsoPort ) {
Expand Down Expand Up @@ -720,7 +711,6 @@ async function openLinksInParentFrame( calypsoPort ) {

/**
* Ensures the Calypso Customizer is opened when clicking on the FSE blocks' edit buttons.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function openCustomizer( calypsoPort ) {
Expand All @@ -739,7 +729,6 @@ function openCustomizer( calypsoPort ) {
/**
* Sends a message to Calypso when clicking the "Edit Header" or "Edit Footer"
* buttons in order to perform the navigation in Calypso instead of in the iFrame.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function openTemplatePartLinks( calypsoPort ) {
Expand Down Expand Up @@ -768,7 +757,6 @@ function openTemplatePartLinks( calypsoPort ) {
* Ensures the calypsoifyGutenberg close URL matches the one on the client.
* This is important because we modify the close URL client side in the
* context of template part blocks in FSE.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function getCloseButtonUrl( calypsoPort ) {
Expand Down Expand Up @@ -805,7 +793,6 @@ function getCloseButtonUrl( calypsoPort ) {
* Ensures gutenboarding status and corresponding data is placed on the calypsoifyGutenberg object.
* This is imporant because it allows us to adapt small changes to the editor when
* used in the context of Gutenboarding.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function getGutenboardingStatus( calypsoPort ) {
Expand All @@ -828,7 +815,6 @@ function getGutenboardingStatus( calypsoPort ) {

/**
* Hooks the nav sidebar to change some of its button labels and behaviour.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function getNavSidebarLabels( calypsoPort ) {
Expand Down Expand Up @@ -864,7 +850,6 @@ function getNavSidebarLabels( calypsoPort ) {
/**
* Retrieves info to allow the bridge to build calypso urls. Hook parts of
* the editor that use this info.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function getCalypsoUrlInfo( calypsoPort ) {
Expand Down Expand Up @@ -1004,7 +989,6 @@ function handleCheckoutModal( calypsoPort ) {

/**
* Handles the back to Dashboard link after the removal of the previously-used Portal in Gutenberg 14.5
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function handleSiteEditorBackButton( calypsoPort ) {
Expand Down Expand Up @@ -1040,7 +1024,6 @@ function handleSiteEditorBackButton( calypsoPort ) {
* If WelcomeTour is set to show, check if the App Banner is visible.
* If App Banner is visible, we set the Welcome Tour to not show.
* When the App Banner gets dismissed, we set the Welcome Tour to show.
*
* @param {MessagePort} calypsoPort Port used for communication with parent frame.
*/
function handleAppBannerShowing( calypsoPort ) {
Expand Down
Loading

0 comments on commit e1f240e

Please sign in to comment.