Skip to content

Commit

Permalink
Replace lodash-es with lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed May 31, 2021
1 parent 21fdbc0 commit f7b0675
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 38 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ module.exports = createConfig({
'@typescript-eslint/explicit-module-boundary-types': 'off',

// Unused vars should be removed but not prevent compilation
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-unused-vars': [
'warn',
{ ignoreRestSiblings: true },
],

// Allow writing void-returning arrow functions in shorthand to save space
'@typescript-eslint/no-confusing-void-expression': [
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ node_modules/
/storybook-static/
/packages/**/dist/

/.env.*
/.env.local
/.env.*.local

npm-debug.log*
*.log
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/build/
/storybook-static/
/packages/**/dist/
/package-lock.json
24 changes: 5 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"d3-format": "^3.0.0",
"d3-scale": "^3.3.0",
"d3-scale-chromatic": "^2.0.0",
"lodash-es": "^4.17.21",
"lodash": "^4.17.21",
"ndarray": "^1.0.19",
"ndarray-ops": "^1.2.2",
"normalize.css": "^8.0.1",
Expand Down Expand Up @@ -83,7 +83,7 @@
"@types/d3-scale": "^3.2.2",
"@types/d3-scale-chromatic": "^2.0.0",
"@types/jest": "^26.0.23",
"@types/lodash-es": "^4.17.4",
"@types/lodash": "^4.14.170",
"@types/ndarray": "^1.0.9",
"@types/node": "^12.20.13",
"@types/react": "^17.0.6",
Expand Down Expand Up @@ -115,10 +115,7 @@
"typescript": "^4.2.4"
},
"jest": {
"restoreMocks": true,
"transformIgnorePatterns": [
"/node_modules/(?!lodash-es)/.*"
]
"restoreMocks": true
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion src/h5web/dimension-mapper/AxisMapper.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isNumber } from 'lodash-es';
import { isNumber } from 'lodash';
import ToggleGroup from '../toolbar/controls/ToggleGroup';
import styles from './DimensionMapper.module.css';
import type { Axis, DimensionMapping } from './models';
Expand Down
2 changes: 1 addition & 1 deletion src/h5web/dimension-mapper/DimensionMapper.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isNumber } from 'lodash-es';
import { isNumber } from 'lodash';
import type { DimensionMapping } from './models';
import styles from './DimensionMapper.module.css';
import SlicingSlider from './SlicingSlider';
Expand Down
2 changes: 1 addition & 1 deletion src/h5web/dimension-mapper/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isNumber } from 'lodash-es';
import { isNumber } from 'lodash';
import type { Axis } from './models';

export function isAxis(elem: number | Axis): elem is Axis {
Expand Down
2 changes: 1 addition & 1 deletion src/h5web/metadata-viewer/EntityTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styles from './MetadataViewer.module.css';
import { isDataset, isDatatype } from '../guards';
import { renderType, renderShape } from './utils';
import RawInspector from './RawInspector';
import { capitalize } from 'lodash-es';
import { capitalize } from 'lodash';
import { ProviderContext } from '../providers/context';

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion src/h5web/providers/mock/values.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { range } from 'lodash-es';
import { range } from 'lodash';

const arr1 = range(-20, 21);
const arr2 = range(0, 100, 5);
Expand Down
2 changes: 1 addition & 1 deletion src/h5web/vis-packs/core/heatmap/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { range } from 'lodash-es';
import { range } from 'lodash';
import type { NdArray } from 'ndarray';
import {
DomainError,
Expand Down
2 changes: 1 addition & 1 deletion src/h5web/vis-packs/core/matrix/IndexTrack.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactNode, useContext } from 'react';
import { range } from 'lodash-es';
import { range } from 'lodash';
import { GridSettingsContext } from './GridSettingsContext';
import styles from './MatrixVis.module.css';

Expand Down
2 changes: 1 addition & 1 deletion src/h5web/vis-packs/core/shared/PanZoomMesh.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRef, useCallback, useEffect } from 'react';
import type { Vector3 } from 'three';
import { useThree } from '@react-three/fiber';
import { clamp } from 'lodash-es';
import { clamp } from 'lodash';
import { useWheelCapture } from '../hooks';
import type { ThreeEvent } from '@react-three/fiber/dist/declarations/src/core/events';

Expand Down
2 changes: 1 addition & 1 deletion src/h5web/vis-packs/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { tickStep, range } from 'd3-array';
import { format } from 'd3-format';
import ndarray, { NdArray } from 'ndarray';
import { assign } from 'ndarray-ops';
import { isNumber } from 'lodash-es';
import { isNumber } from 'lodash';
import type { Axis, DimensionMapping } from '../../dimension-mapper/models';
import {
Size,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isEqual } from 'lodash-es';
import { isEqual } from 'lodash';
import { assertGroup } from '../../../guards';
import MappedLineVis from '../../core/line/MappedLineVis';
import type { VisContainerProps } from '../../models';
Expand Down

0 comments on commit f7b0675

Please sign in to comment.