MM-56985 Remove babel-plugin-lodash (#26295)

This commit is contained in:
Harrison Healey 2024-02-26 16:47:26 -05:00 committed by GitHub
parent 48117fb21f
commit 0d2053aa5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
45 changed files with 52 additions and 61 deletions

View File

@ -128,6 +128,10 @@
"name": "redux",
"importNames": ["DeepPartial"],
"message": "Use DeepPartial from '@mattermost/types/utilities instead."
},
{
"name": "lodash",
"message": "Import individual functions from lodash/<function> instead."
}
]
}

View File

@ -23,7 +23,6 @@ const config = {
}],
],
plugins: [
'lodash',
'react-hot-loader/babel',
'babel-plugin-typescript-to-proptypes',
[

View File

@ -141,7 +141,6 @@
"@types/tinycolor2": "1.4.3",
"@typescript-eslint/eslint-plugin": "5.57.1",
"@typescript-eslint/parser": "5.57.1",
"babel-plugin-lodash": "3.3.4",
"copy-webpack-plugin": "11.0.0",
"emoji-datasource": "6.1.1",
"emoji-datasource-apple": "6.1.1",

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {cloneDeep} from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import type {UserProfile} from '@mattermost/types/users';

View File

@ -1,7 +1,8 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {cloneDeep, set} from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import set from 'lodash/set';
import type {Dispatch} from 'redux';
import {batchActions} from 'redux-batched-actions';
import type {MockStoreEnhanced} from 'redux-mock-store';

View File

@ -1,7 +1,8 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {debounce, isEqual} from 'lodash';
import debounce from 'lodash/debounce';
import isEqual from 'lodash/isEqual';
import React from 'react';
import {FormattedMessage} from 'react-intl';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {debounce} from 'lodash';
import debounce from 'lodash/debounce';
import React from 'react';
import {FormattedMessage} from 'react-intl';

View File

@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import classNames from 'classnames';
import {isNil} from 'lodash';
import isNil from 'lodash/isNil';
import React from 'react';
import {FormattedMessage} from 'react-intl';

View File

@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import {shallow} from 'enzyme';
import {range} from 'lodash';
import range from 'lodash/range';
import React from 'react';
import type {UserProfile} from '@mattermost/types/users';

View File

@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import {shallow} from 'enzyme';
import {range} from 'lodash';
import range from 'lodash/range';
import React from 'react';
import {TestHelper} from 'utils/test_helper';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {debounce} from 'lodash';
import debounce from 'lodash/debounce';
import React from 'react';
import {FormattedMessage, defineMessages} from 'react-intl';

View File

@ -1,7 +1,8 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {uniq, difference} from 'lodash';
import difference from 'lodash/difference';
import uniq from 'lodash/uniq';
import React from 'react';
import {FormattedMessage} from 'react-intl';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {cloneDeep} from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import React from 'react';
import {FormattedMessage} from 'react-intl';

View File

@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import classNames from 'classnames';
import {isNil} from 'lodash';
import isNil from 'lodash/isNil';
import React from 'react';
import {FormattedMessage, defineMessages} from 'react-intl';
import type {MessageDescriptor} from 'react-intl';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {cloneDeep} from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import React from 'react';
import {FormattedMessage} from 'react-intl';

View File

@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import classNames from 'classnames';
import {noop} from 'lodash';
import noop from 'lodash/noop';
import React, {useEffect, useState} from 'react';
import {FormattedMessage, defineMessage, useIntl} from 'react-intl';
import {useDispatch, useSelector} from 'react-redux';

View File

@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import type {Instance} from '@popperjs/core';
import {debounce} from 'lodash';
import debounce from 'lodash/debounce';
import type React from 'react';
import {useCallback, useEffect, useLayoutEffect, useState} from 'react';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {isEmpty} from 'lodash';
import isEmpty from 'lodash/isEmpty';
import React from 'react';
import {FormattedMessage} from 'react-intl';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {isEmpty} from 'lodash';
import isEmpty from 'lodash/isEmpty';
import React, {useEffect, useState} from 'react';
import {FormattedMessage} from 'react-intl';
import {useSelector, useDispatch} from 'react-redux';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {partition} from 'lodash';
import partition from 'lodash/partition';
import React from 'react';
import type {ReactNode} from 'react';
import {useSelector} from 'react-redux';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {isEqual} from 'lodash';
import isEqual from 'lodash/isEqual';
import React from 'react';
import {Modal} from 'react-bootstrap';
import type {IntlShape} from 'react-intl';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {debounce} from 'lodash';
import debounce from 'lodash/debounce';
import React, {useCallback, useEffect, useState} from 'react';
import {FormattedMessage, useIntl} from 'react-intl';
import {useHistory} from 'react-router-dom';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {debounce} from 'lodash';
import debounce from 'lodash/debounce';
import React, {useCallback, useEffect, useState} from 'react';
import {FormattedMessage, useIntl} from 'react-intl';
import {useDispatch} from 'react-redux';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {isEmpty} from 'lodash';
import isEmpty from 'lodash/isEmpty';
import React from 'react';
import type {ComponentType} from 'react';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {uniqWith} from 'lodash';
import uniqWith from 'lodash/uniqWith';
import React, {useEffect, useState} from 'react';
import {FormattedMessage, useIntl} from 'react-intl';
import {useSelector, useDispatch} from 'react-redux';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {debounce} from 'lodash';
import debounce from 'lodash/debounce';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {FormattedMessage} from 'react-intl';
import {useDispatch, useSelector} from 'react-redux';

View File

@ -4,7 +4,7 @@
import MuiMenuItem from '@mui/material/MenuItem';
import type {MenuItemProps as MuiMenuItemProps} from '@mui/material/MenuItem';
import {styled} from '@mui/material/styles';
import {cloneDeep} from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import React, {
Children,
useContext,

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {debounce} from 'lodash';
import debounce from 'lodash/debounce';
import React from 'react';
import {Modal} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl';

View File

@ -2,7 +2,8 @@
// See LICENSE.txt for license information.
import {mount} from 'enzyme';
import {cloneDeep, set} from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import set from 'lodash/set';
import React from 'react';
import {Provider} from 'react-redux';

View File

@ -7,7 +7,7 @@ import {Elements} from '@stripe/react-stripe-js';
import type {Stripe, StripeCardElementChangeEvent} from '@stripe/stripe-js';
import {loadStripe} from '@stripe/stripe-js/pure'; // https://github.com/stripe/stripe-js#importing-loadstripe-without-side-effects
import classnames from 'classnames';
import {isEmpty} from 'lodash';
import isEmpty from 'lodash/isEmpty';
import React from 'react';
import type {ReactNode} from 'react';
import {FormattedMessage, injectIntl} from 'react-intl';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {cloneDeep} from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import React from 'react';
import ReactDOM from 'react-dom';
import {FormattedMessage} from 'react-intl';

View File

@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import classNames from 'classnames';
import {isEmpty} from 'lodash';
import isEmpty from 'lodash/isEmpty';
import React, {memo, useCallback, useEffect, useState} from 'react';
import type {ReactNode} from 'react';
import {useIntl} from 'react-intl';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {isEmpty} from 'lodash';
import isEmpty from 'lodash/isEmpty';
import React, {memo, useCallback, useEffect} from 'react';
import type {PropsWithChildren} from 'react';
import {FormattedMessage, useIntl} from 'react-intl';

View File

@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import {shallow} from 'enzyme';
import {set} from 'lodash';
import set from 'lodash/set';
import React from 'react';
import type {ComponentProps} from 'react';

View File

@ -1,7 +1,8 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {capitalize as caps, isArray} from 'lodash';
import caps from 'lodash/capitalize';
import isArray from 'lodash/isArray';
import type {Moment} from 'moment-timezone';
import moment from 'moment-timezone';
import React, {PureComponent} from 'react';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {debounce} from 'lodash';
import debounce from 'lodash/debounce';
import React, {useEffect, useCallback, useState, useRef} from 'react';
import {FormattedMessage, useIntl} from 'react-intl';
import styled from 'styled-components';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {uniq} from 'lodash';
import uniq from 'lodash/uniq';
import {batchActions} from 'redux-batched-actions';
import type {Post} from '@mattermost/types/posts';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {isEqual} from 'lodash';
import isEqual from 'lodash/isEqual';
import type {AnyAction} from 'redux';
import {combineReducers} from 'redux';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {max} from 'lodash';
import max from 'lodash/max';
import type {
Channel,

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {findKey} from 'lodash';
import findKey from 'lodash/findKey';
import type {AnyAction} from 'redux';
import {combineReducers} from 'redux';

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {cloneDeep} from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import {ResourceToSysConsolePermissionsTable, RESOURCE_KEYS} from 'mattermost-redux/constants/permissions_sysconsole';
import {createSelector} from 'mattermost-redux/selectors/create_selector';

View File

@ -1,7 +1,9 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {intersection, isPlainObject, zipObject} from 'lodash';
import intersection from 'lodash/intersection';
import isPlainObject from 'lodash/isPlainObject';
import zipObject from 'lodash/zipObject';
/**
* Transform a function with multiple args into one that receives a normalized args object.

View File

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {isNil} from 'lodash';
import isNil from 'lodash/isNil';
import type {TextboxElement} from 'components/textbox';

View File

@ -5,7 +5,7 @@ import {getName} from 'country-list';
import crypto from 'crypto';
import cssVars from 'css-vars-ponyfill';
import type {Locale} from 'date-fns';
import {isNil} from 'lodash';
import isNil from 'lodash/isNil';
import moment from 'moment';
import React from 'react';
import type {LinkHTMLAttributes} from 'react';

View File

@ -187,7 +187,6 @@
"@types/tinycolor2": "1.4.3",
"@typescript-eslint/eslint-plugin": "5.57.1",
"@typescript-eslint/parser": "5.57.1",
"babel-plugin-lodash": "3.3.4",
"copy-webpack-plugin": "11.0.0",
"emoji-datasource": "6.1.1",
"emoji-datasource-apple": "6.1.1",
@ -6644,18 +6643,6 @@
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
"node_modules/babel-plugin-lodash": {
"version": "3.3.4",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/helper-module-imports": "^7.0.0-beta.49",
"@babel/types": "^7.0.0-beta.49",
"glob": "^7.1.1",
"lodash": "^4.17.10",
"require-package-name": "^2.0.1"
}
},
"node_modules/babel-plugin-macros": {
"version": "2.8.0",
"license": "MIT",
@ -20182,11 +20169,6 @@
"node": ">=0.10.0"
}
},
"node_modules/require-package-name": {
"version": "2.0.1",
"dev": true,
"license": "MIT"
},
"node_modules/requires-port": {
"version": "1.0.0",
"dev": true,