mirror of https://github.com/apache/superset.git
fix(dependencies): stopping (and preventing) full lodash library import... now using only method level imports. (#26710)
This commit is contained in:
parent
14c3e2bf70
commit
1d4b8b6989
|
@ -71,6 +71,7 @@ module.exports = {
|
||||||
'prettier',
|
'prettier',
|
||||||
'react',
|
'react',
|
||||||
'file-progress',
|
'file-progress',
|
||||||
|
'lodash',
|
||||||
'theme-colors',
|
'theme-colors',
|
||||||
'translation-vars',
|
'translation-vars',
|
||||||
],
|
],
|
||||||
|
@ -241,6 +242,7 @@ module.exports = {
|
||||||
'jsx-a11y/anchor-is-valid': 1,
|
'jsx-a11y/anchor-is-valid': 1,
|
||||||
'jsx-a11y/click-events-have-key-events': 0, // re-enable up for discussion
|
'jsx-a11y/click-events-have-key-events': 0, // re-enable up for discussion
|
||||||
'jsx-a11y/mouse-events-have-key-events': 0, // re-enable up for discussion
|
'jsx-a11y/mouse-events-have-key-events': 0, // re-enable up for discussion
|
||||||
|
'lodash/import-scope': [2, 'member'],
|
||||||
'new-cap': 0,
|
'new-cap': 0,
|
||||||
'no-bitwise': 0,
|
'no-bitwise': 0,
|
||||||
'no-continue': 0,
|
'no-continue': 0,
|
||||||
|
|
|
@ -224,6 +224,7 @@
|
||||||
"eslint-plugin-jest": "^24.7.0",
|
"eslint-plugin-jest": "^24.7.0",
|
||||||
"eslint-plugin-jest-dom": "^3.6.5",
|
"eslint-plugin-jest-dom": "^3.6.5",
|
||||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||||
|
"eslint-plugin-lodash": "^7.4.0",
|
||||||
"eslint-plugin-no-only-tests": "^2.4.0",
|
"eslint-plugin-no-only-tests": "^2.4.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"eslint-plugin-react": "^7.22.0",
|
"eslint-plugin-react": "^7.22.0",
|
||||||
|
@ -31363,6 +31364,21 @@
|
||||||
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
|
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/eslint-plugin-lodash": {
|
||||||
|
"version": "7.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-plugin-lodash/-/eslint-plugin-lodash-7.4.0.tgz",
|
||||||
|
"integrity": "sha512-Tl83UwVXqe1OVeBRKUeWcfg6/pCW1GTRObbdnbEJgYwjxp5Q92MEWQaH9+dmzbRt6kvYU1Mp893E79nJiCSM8A==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"lodash": "^4.17.21"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"eslint": ">=2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/eslint-plugin-no-only-tests": {
|
"node_modules/eslint-plugin-no-only-tests": {
|
||||||
"version": "2.4.0",
|
"version": "2.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-2.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-2.4.0.tgz",
|
||||||
|
@ -89302,6 +89318,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"eslint-plugin-lodash": {
|
||||||
|
"version": "7.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-plugin-lodash/-/eslint-plugin-lodash-7.4.0.tgz",
|
||||||
|
"integrity": "sha512-Tl83UwVXqe1OVeBRKUeWcfg6/pCW1GTRObbdnbEJgYwjxp5Q92MEWQaH9+dmzbRt6kvYU1Mp893E79nJiCSM8A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"lodash": "^4.17.21"
|
||||||
|
}
|
||||||
|
},
|
||||||
"eslint-plugin-no-only-tests": {
|
"eslint-plugin-no-only-tests": {
|
||||||
"version": "2.4.0",
|
"version": "2.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-2.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-2.4.0.tgz",
|
||||||
|
|
|
@ -290,6 +290,7 @@
|
||||||
"eslint-plugin-jest": "^24.7.0",
|
"eslint-plugin-jest": "^24.7.0",
|
||||||
"eslint-plugin-jest-dom": "^3.6.5",
|
"eslint-plugin-jest-dom": "^3.6.5",
|
||||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||||
|
"eslint-plugin-lodash": "^7.4.0",
|
||||||
"eslint-plugin-no-only-tests": "^2.4.0",
|
"eslint-plugin-no-only-tests": "^2.4.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"eslint-plugin-react": "^7.22.0",
|
"eslint-plugin-react": "^7.22.0",
|
||||||
|
|
|
@ -20,7 +20,14 @@
|
||||||
/* eslint-disable sort-keys */
|
/* eslint-disable sort-keys */
|
||||||
|
|
||||||
const Generator = require('yeoman-generator');
|
const Generator = require('yeoman-generator');
|
||||||
const _ = require('lodash');
|
// eslint-disable-next-line lodash/import-scope
|
||||||
|
const kebabCase = require('lodash/kebabCase');
|
||||||
|
// eslint-disable-next-line lodash/import-scope
|
||||||
|
const startCase = require('lodash/startCase');
|
||||||
|
// eslint-disable-next-line lodash/import-scope
|
||||||
|
const camelCase = require('lodash/camelCase');
|
||||||
|
// eslint-disable-next-line lodash/import-scope
|
||||||
|
const upperFirst = require('lodash/upperFirst');
|
||||||
|
|
||||||
module.exports = class extends Generator {
|
module.exports = class extends Generator {
|
||||||
async prompting() {
|
async prompting() {
|
||||||
|
@ -32,15 +39,15 @@ module.exports = class extends Generator {
|
||||||
name: 'packageName',
|
name: 'packageName',
|
||||||
message: 'Package name:',
|
message: 'Package name:',
|
||||||
// Default to current folder name, e.g. superset-plugin-chart-hello-world
|
// Default to current folder name, e.g. superset-plugin-chart-hello-world
|
||||||
default: _.kebabCase(this.appname),
|
default: kebabCase(this.appname),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
name: 'pluginName',
|
name: 'pluginName',
|
||||||
message: 'Plugin name:',
|
message: 'Plugin name:',
|
||||||
// Hello World
|
// Hello World
|
||||||
default: _.startCase(
|
default: startCase(
|
||||||
_.camelCase(this.appname.replace('superset plugin chart', '').trim()),
|
camelCase(this.appname.replace('superset plugin chart', '').trim()),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -48,7 +55,7 @@ module.exports = class extends Generator {
|
||||||
name: 'description',
|
name: 'description',
|
||||||
message: 'Description:',
|
message: 'Description:',
|
||||||
// Superset Plugin Chart Hello World
|
// Superset Plugin Chart Hello World
|
||||||
default: _.upperFirst(_.startCase(this.appname)),
|
default: upperFirst(startCase(this.appname)),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'list',
|
type: 'list',
|
||||||
|
@ -70,7 +77,7 @@ module.exports = class extends Generator {
|
||||||
|
|
||||||
writing() {
|
writing() {
|
||||||
// SupersetPluginChartHelloWorld
|
// SupersetPluginChartHelloWorld
|
||||||
const packageLabel = _.upperFirst(_.camelCase(this.answers.packageName));
|
const packageLabel = upperFirst(camelCase(this.answers.packageName));
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
...this.answers,
|
...this.answers,
|
||||||
|
|
|
@ -16,8 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import isEmpty from 'lodash/isEmpty';
|
import { isEmpty, isBoolean } from 'lodash';
|
||||||
import isBoolean from 'lodash/isBoolean';
|
|
||||||
|
|
||||||
import { QueryObject } from './types';
|
import { QueryObject } from './types';
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import omit from 'lodash/omit';
|
import { omit } from 'lodash';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AdhocColumn,
|
AdhocColumn,
|
||||||
|
|
|
@ -17,9 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import camelCase from 'lodash/camelCase';
|
import { camelCase, isPlainObject, mapKeys } from 'lodash';
|
||||||
import isPlainObject from 'lodash/isPlainObject';
|
|
||||||
import mapKeys from 'lodash/mapKeys';
|
|
||||||
|
|
||||||
export default function convertKeysToCamelCase<T>(object: T) {
|
export default function convertKeysToCamelCase<T>(object: T) {
|
||||||
if (object === null || object === undefined) {
|
if (object === null || object === undefined) {
|
||||||
|
|
|
@ -28,7 +28,7 @@ import {
|
||||||
import { EChartsCoreOption, GaugeSeriesOption } from 'echarts';
|
import { EChartsCoreOption, GaugeSeriesOption } from 'echarts';
|
||||||
import { GaugeDataItemOption } from 'echarts/types/src/chart/gauge/GaugeSeries';
|
import { GaugeDataItemOption } from 'echarts/types/src/chart/gauge/GaugeSeries';
|
||||||
import { CallbackDataParams } from 'echarts/types/src/util/types';
|
import { CallbackDataParams } from 'echarts/types/src/util/types';
|
||||||
import range from 'lodash/range';
|
import { range } from 'lodash';
|
||||||
import { parseNumbersList } from '../utils/controls';
|
import { parseNumbersList } from '../utils/controls';
|
||||||
import {
|
import {
|
||||||
DEFAULT_FORM_DATA as DEFAULT_GAUGE_FORM_DATA,
|
DEFAULT_FORM_DATA as DEFAULT_GAUGE_FORM_DATA,
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import { DataRecord, DataRecordValue } from '@superset-ui/core';
|
import { DataRecord, DataRecordValue } from '@superset-ui/core';
|
||||||
import _ from 'lodash';
|
import { groupBy as _groupBy, isNumber, transform } from 'lodash';
|
||||||
|
|
||||||
export type TreeNode = {
|
export type TreeNode = {
|
||||||
name: DataRecordValue;
|
name: DataRecordValue;
|
||||||
|
@ -28,7 +28,7 @@ export type TreeNode = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function getMetricValue(datum: DataRecord, metric: string) {
|
function getMetricValue(datum: DataRecord, metric: string) {
|
||||||
return _.isNumber(datum[metric]) ? (datum[metric] as number) : 0;
|
return isNumber(datum[metric]) ? (datum[metric] as number) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function treeBuilder(
|
export function treeBuilder(
|
||||||
|
@ -38,8 +38,8 @@ export function treeBuilder(
|
||||||
secondaryMetric?: string,
|
secondaryMetric?: string,
|
||||||
): TreeNode[] {
|
): TreeNode[] {
|
||||||
const [curGroupBy, ...restGroupby] = groupBy;
|
const [curGroupBy, ...restGroupby] = groupBy;
|
||||||
const curData = _.groupBy(data, curGroupBy);
|
const curData = _groupBy(data, curGroupBy);
|
||||||
return _.transform(
|
return transform(
|
||||||
curData,
|
curData,
|
||||||
(result, value, key) => {
|
(result, value, key) => {
|
||||||
const name = curData[key][0][curGroupBy]!;
|
const name = curData[key][0][curGroupBy]!;
|
||||||
|
|
|
@ -24,8 +24,7 @@ import {
|
||||||
t,
|
t,
|
||||||
isFeatureEnabled,
|
isFeatureEnabled,
|
||||||
} from '@superset-ui/core';
|
} from '@superset-ui/core';
|
||||||
import invert from 'lodash/invert';
|
import { invert, mapKeys } from 'lodash';
|
||||||
import mapKeys from 'lodash/mapKeys';
|
|
||||||
|
|
||||||
import { now } from 'src/utils/dates';
|
import { now } from 'src/utils/dates';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -22,7 +22,7 @@ import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { Redirect } from 'react-router-dom';
|
import { Redirect } from 'react-router-dom';
|
||||||
import { css, styled, t } from '@superset-ui/core';
|
import { css, styled, t } from '@superset-ui/core';
|
||||||
import throttle from 'lodash/throttle';
|
import { throttle } from 'lodash';
|
||||||
import {
|
import {
|
||||||
LOCALSTORAGE_MAX_USAGE_KB,
|
LOCALSTORAGE_MAX_USAGE_KB,
|
||||||
LOCALSTORAGE_WARNING_THRESHOLD,
|
LOCALSTORAGE_WARNING_THRESHOLD,
|
||||||
|
|
|
@ -44,8 +44,7 @@ import {
|
||||||
} from '@superset-ui/core';
|
} from '@superset-ui/core';
|
||||||
import type { QueryEditor, SqlLabRootState } from 'src/SqlLab/types';
|
import type { QueryEditor, SqlLabRootState } from 'src/SqlLab/types';
|
||||||
import type { DatabaseObject } from 'src/features/databases/types';
|
import type { DatabaseObject } from 'src/features/databases/types';
|
||||||
import debounce from 'lodash/debounce';
|
import { debounce, throttle, isBoolean, isEmpty } from 'lodash';
|
||||||
import throttle from 'lodash/throttle';
|
|
||||||
import Modal from 'src/components/Modal';
|
import Modal from 'src/components/Modal';
|
||||||
import Mousetrap from 'mousetrap';
|
import Mousetrap from 'mousetrap';
|
||||||
import Button from 'src/components/Button';
|
import Button from 'src/components/Button';
|
||||||
|
@ -93,7 +92,6 @@ import {
|
||||||
} from 'src/utils/localStorageHelpers';
|
} from 'src/utils/localStorageHelpers';
|
||||||
import { EmptyStateBig } from 'src/components/EmptyState';
|
import { EmptyStateBig } from 'src/components/EmptyState';
|
||||||
import getBootstrapData from 'src/utils/getBootstrapData';
|
import getBootstrapData from 'src/utils/getBootstrapData';
|
||||||
import { isBoolean, isEmpty } from 'lodash';
|
|
||||||
import TemplateParamsEditor from '../TemplateParamsEditor';
|
import TemplateParamsEditor from '../TemplateParamsEditor';
|
||||||
import SouthPane from '../SouthPane';
|
import SouthPane from '../SouthPane';
|
||||||
import SaveQuery, { QueryPayload } from '../SaveQuery';
|
import SaveQuery, { QueryPayload } from '../SaveQuery';
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import pick from 'lodash/pick';
|
import { pick } from 'lodash';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { EditableTabs } from 'src/components/Tabs';
|
import { EditableTabs } from 'src/components/Tabs';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import pick from 'lodash/pick';
|
import { pick } from 'lodash';
|
||||||
import { shallowEqual, useSelector } from 'react-redux';
|
import { shallowEqual, useSelector } from 'react-redux';
|
||||||
import { SqlLabRootState, QueryEditor } from 'src/SqlLab/types';
|
import { SqlLabRootState, QueryEditor } from 'src/SqlLab/types';
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import pick from 'lodash/pick';
|
import { pick } from 'lodash';
|
||||||
import { tableApiUtil } from 'src/hooks/apiResources/tables';
|
import { tableApiUtil } from 'src/hooks/apiResources/tables';
|
||||||
import {
|
import {
|
||||||
BYTES_PER_CHAR,
|
BYTES_PER_CHAR,
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import { AntdDropdown, AntdTooltip } from 'src/components';
|
import { AntdDropdown, AntdTooltip } from 'src/components';
|
||||||
import { styled } from '@superset-ui/core';
|
import { styled } from '@superset-ui/core';
|
||||||
import kebabCase from 'lodash/kebabCase';
|
import { kebabCase } from 'lodash';
|
||||||
|
|
||||||
const StyledDropdownButton = styled.div`
|
const StyledDropdownButton = styled.div`
|
||||||
.ant-btn-group {
|
.ant-btn-group {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import _ from 'lodash';
|
import { startCase } from 'lodash';
|
||||||
import AntdEnhancedIcons from './AntdEnhanced';
|
import AntdEnhancedIcons from './AntdEnhanced';
|
||||||
import Icon from './Icon';
|
import Icon from './Icon';
|
||||||
import IconType from './IconType';
|
import IconType from './IconType';
|
||||||
|
@ -168,7 +168,7 @@ const IconFileNames = [
|
||||||
|
|
||||||
const iconOverrides: Record<string, React.FC<IconType>> = {};
|
const iconOverrides: Record<string, React.FC<IconType>> = {};
|
||||||
IconFileNames.forEach(fileName => {
|
IconFileNames.forEach(fileName => {
|
||||||
const keyName = _.startCase(fileName).replace(/ /g, '');
|
const keyName = startCase(fileName).replace(/ /g, '');
|
||||||
iconOverrides[keyName] = (props: IconType) => (
|
iconOverrides[keyName] = (props: IconType) => (
|
||||||
<Icon fileName={fileName} {...props} />
|
<Icon fileName={fileName} {...props} />
|
||||||
);
|
);
|
||||||
|
|
|
@ -31,8 +31,7 @@ import React, {
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { ensureIsArray, t, usePrevious } from '@superset-ui/core';
|
import { ensureIsArray, t, usePrevious } from '@superset-ui/core';
|
||||||
import { LabeledValue as AntdLabeledValue } from 'antd/lib/select';
|
import { LabeledValue as AntdLabeledValue } from 'antd/lib/select';
|
||||||
import debounce from 'lodash/debounce';
|
import { debounce, isEqual, uniq } from 'lodash';
|
||||||
import { isEqual, uniq } from 'lodash';
|
|
||||||
import Icons from 'src/components/Icons';
|
import Icons from 'src/components/Icons';
|
||||||
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
|
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
|
||||||
import { FAST_DEBOUNCE, SLOW_DEBOUNCE } from 'src/constants';
|
import { FAST_DEBOUNCE, SLOW_DEBOUNCE } from 'src/constants';
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import React, { useEffect, useRef } from 'react';
|
import React, { useEffect, useRef } from 'react';
|
||||||
import isEqual from 'lodash/isEqual';
|
import { isEqual } from 'lodash';
|
||||||
import { styled, t } from '@superset-ui/core';
|
import { styled, t } from '@superset-ui/core';
|
||||||
import { useFilters, usePagination, useSortBy, useTable } from 'react-table';
|
import { useFilters, usePagination, useSortBy, useTable } from 'react-table';
|
||||||
import { Empty } from 'src/components';
|
import { Empty } from 'src/components';
|
||||||
|
|
|
@ -28,7 +28,7 @@ import {
|
||||||
useComponentDidUpdate,
|
useComponentDidUpdate,
|
||||||
} from '@superset-ui/core';
|
} from '@superset-ui/core';
|
||||||
import { ParentSize } from '@visx/responsive';
|
import { ParentSize } from '@visx/responsive';
|
||||||
import pick from 'lodash/pick';
|
import { pick } from 'lodash';
|
||||||
import Tabs from 'src/components/Tabs';
|
import Tabs from 'src/components/Tabs';
|
||||||
import DashboardGrid from 'src/dashboard/containers/DashboardGrid';
|
import DashboardGrid from 'src/dashboard/containers/DashboardGrid';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import pick from 'lodash/pick';
|
import { pick } from 'lodash';
|
||||||
import { shallowEqual, useSelector } from 'react-redux';
|
import { shallowEqual, useSelector } from 'react-redux';
|
||||||
import { DashboardContextForExplore } from 'src/types/DashboardContextForExplore';
|
import { DashboardContextForExplore } from 'src/types/DashboardContextForExplore';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
import throttle from 'lodash/throttle';
|
import { throttle } from 'lodash';
|
||||||
import React, {
|
import React, {
|
||||||
useEffect,
|
useEffect,
|
||||||
useState,
|
useState,
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import isEqual from 'lodash/isEqual';
|
import { isEqual } from 'lodash';
|
||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { RootState } from 'src/dashboard/types';
|
import { RootState } from 'src/dashboard/types';
|
||||||
import { useMemoCompare } from 'src/hooks/useMemoCompare';
|
import { useMemoCompare } from 'src/hooks/useMemoCompare';
|
||||||
|
|
|
@ -29,7 +29,7 @@ import {
|
||||||
} from '@superset-ui/core';
|
} from '@superset-ui/core';
|
||||||
import { Global } from '@emotion/react';
|
import { Global } from '@emotion/react';
|
||||||
import { Column } from 'react-table';
|
import { Column } from 'react-table';
|
||||||
import debounce from 'lodash/debounce';
|
import { debounce } from 'lodash';
|
||||||
import { Space } from 'src/components';
|
import { Space } from 'src/components';
|
||||||
import { Input } from 'src/components/Input';
|
import { Input } from 'src/components/Input';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import throttle from 'lodash/throttle';
|
import { throttle } from 'lodash';
|
||||||
import {
|
import {
|
||||||
POPOVER_INITIAL_HEIGHT,
|
POPOVER_INITIAL_HEIGHT,
|
||||||
POPOVER_INITIAL_WIDTH,
|
POPOVER_INITIAL_WIDTH,
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { legacyValidateNumber, legacyValidateInteger } from '@superset-ui/core';
|
import { legacyValidateNumber, legacyValidateInteger } from '@superset-ui/core';
|
||||||
import debounce from 'lodash/debounce';
|
import { debounce } from 'lodash';
|
||||||
import { FAST_DEBOUNCE } from 'src/constants';
|
import { FAST_DEBOUNCE } from 'src/constants';
|
||||||
import ControlHeader from 'src/explore/components/ControlHeader';
|
import ControlHeader from 'src/explore/components/ControlHeader';
|
||||||
import { Input } from 'src/components/Input';
|
import { Input } from 'src/components/Input';
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import isEqual from 'lodash/isEqual';
|
import { isEqual } from 'lodash';
|
||||||
import {
|
import {
|
||||||
AdhocFilter,
|
AdhocFilter,
|
||||||
ensureIsArray,
|
ensureIsArray,
|
||||||
|
|
|
@ -31,7 +31,7 @@ import {
|
||||||
tn,
|
tn,
|
||||||
} from '@superset-ui/core';
|
} from '@superset-ui/core';
|
||||||
import { LabeledValue as AntdLabeledValue } from 'antd/lib/select';
|
import { LabeledValue as AntdLabeledValue } from 'antd/lib/select';
|
||||||
import debounce from 'lodash/debounce';
|
import { debounce } from 'lodash';
|
||||||
import { useImmerReducer } from 'use-immer';
|
import { useImmerReducer } from 'use-immer';
|
||||||
import { Select } from 'src/components';
|
import { Select } from 'src/components';
|
||||||
import { SLOW_DEBOUNCE } from 'src/constants';
|
import { SLOW_DEBOUNCE } from 'src/constants';
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
import { SyntheticEvent } from 'react';
|
import { SyntheticEvent } from 'react';
|
||||||
import domToImage from 'dom-to-image-more';
|
import domToImage from 'dom-to-image-more';
|
||||||
import kebabCase from 'lodash/kebabCase';
|
import { kebabCase } from 'lodash';
|
||||||
import { t, supersetTheme } from '@superset-ui/core';
|
import { t, supersetTheme } from '@superset-ui/core';
|
||||||
import { addWarningToast } from 'src/components/MessageToasts/actions';
|
import { addWarningToast } from 'src/components/MessageToasts/actions';
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
import { SyntheticEvent } from 'react';
|
import { SyntheticEvent } from 'react';
|
||||||
import domToPdf from 'dom-to-pdf';
|
import domToPdf from 'dom-to-pdf';
|
||||||
import kebabCase from 'lodash/kebabCase';
|
import { kebabCase } from 'lodash';
|
||||||
import { logging, t } from '@superset-ui/core';
|
import { logging, t } from '@superset-ui/core';
|
||||||
import { addWarningToast } from 'src/components/MessageToasts/actions';
|
import { addWarningToast } from 'src/components/MessageToasts/actions';
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
'@typescript-eslint',
|
'@typescript-eslint',
|
||||||
|
'lodash',
|
||||||
],
|
],
|
||||||
extends: [
|
extends: [
|
||||||
'eslint:recommended',
|
'eslint:recommended',
|
||||||
|
@ -32,6 +33,7 @@ module.exports = {
|
||||||
'prettier',
|
'prettier',
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
|
"lodash/import-scope": [2, "member"],
|
||||||
"@typescript-eslint/explicit-module-boundary-types": 0,
|
"@typescript-eslint/explicit-module-boundary-types": 0,
|
||||||
"@typescript-eslint/no-var-requires": 0,
|
"@typescript-eslint/no-var-requires": 0,
|
||||||
},
|
},
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
"@typescript-eslint/parser": "^5.62.0",
|
"@typescript-eslint/parser": "^5.62.0",
|
||||||
"eslint": "^8.56.0",
|
"eslint": "^8.56.0",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
|
"eslint-plugin-lodash": "^7.4.0",
|
||||||
"jest": "^27.3.1",
|
"jest": "^27.3.1",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"ts-jest": "^27.0.7",
|
"ts-jest": "^27.0.7",
|
||||||
|
@ -2670,6 +2671,21 @@
|
||||||
"eslint": ">=7.0.0"
|
"eslint": ">=7.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/eslint-plugin-lodash": {
|
||||||
|
"version": "7.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-plugin-lodash/-/eslint-plugin-lodash-7.4.0.tgz",
|
||||||
|
"integrity": "sha512-Tl83UwVXqe1OVeBRKUeWcfg6/pCW1GTRObbdnbEJgYwjxp5Q92MEWQaH9+dmzbRt6kvYU1Mp893E79nJiCSM8A==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"lodash": "^4.17.21"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"eslint": ">=2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/eslint-scope": {
|
"node_modules/eslint-scope": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
||||||
|
@ -8347,6 +8363,15 @@
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
|
"eslint-plugin-lodash": {
|
||||||
|
"version": "7.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-plugin-lodash/-/eslint-plugin-lodash-7.4.0.tgz",
|
||||||
|
"integrity": "sha512-Tl83UwVXqe1OVeBRKUeWcfg6/pCW1GTRObbdnbEJgYwjxp5Q92MEWQaH9+dmzbRt6kvYU1Mp893E79nJiCSM8A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"lodash": "^4.17.21"
|
||||||
|
}
|
||||||
|
},
|
||||||
"eslint-scope": {
|
"eslint-scope": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
"@typescript-eslint/parser": "^5.62.0",
|
"@typescript-eslint/parser": "^5.62.0",
|
||||||
"eslint": "^8.56.0",
|
"eslint": "^8.56.0",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
|
"eslint-plugin-lodash": "^7.4.0",
|
||||||
"jest": "^27.3.1",
|
"jest": "^27.3.1",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"ts-jest": "^27.0.7",
|
"ts-jest": "^27.0.7",
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as _ from 'lodash';
|
import { merge as _merge } from 'lodash';
|
||||||
|
|
||||||
export interface RedisConfig {
|
export interface RedisConfig {
|
||||||
port: number;
|
port: number;
|
||||||
|
@ -142,6 +142,6 @@ function applyEnvOverrides(config: ConfigType): ConfigType {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildConfig(): ConfigType {
|
export function buildConfig(): ConfigType {
|
||||||
const config = _.merge(defaultConfig(), configFromFile());
|
const config = _merge(defaultConfig(), configFromFile());
|
||||||
return applyEnvOverrides(config);
|
return applyEnvOverrides(config);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue