Skip to content

Commit e4514a6

Browse files
authored
Remove the deprecated babel-plugin-lodash (#2965)
1 parent 7eafe76 commit e4514a6

File tree

81 files changed

+210
-117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+210
-117
lines changed

.babelrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module.exports = {
1818
"@babel/preset-react",
1919
"@babel/preset-typescript",
2020
],
21-
plugins: ["lodash"],
2221
ignore: ["**/*.d.ts"],
2322
env: {
2423
commonjs: {

.changeset/lucky-pots-double.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
"victory-area": patch
3+
"victory-axis": patch
4+
"victory-bar": patch
5+
"victory-box-plot": patch
6+
"victory-brush-container": patch
7+
"victory-brush-line": patch
8+
"victory-candlestick": patch
9+
"victory-chart": patch
10+
"victory-core": patch
11+
"victory-create-container": patch
12+
"victory-cursor-container": patch
13+
"victory-errorbar": patch
14+
"victory-group": patch
15+
"victory-legend": patch
16+
"victory-line": patch
17+
"victory-native": patch
18+
"victory-pie": patch
19+
"victory-polar-axis": patch
20+
"victory-selection-container": patch
21+
"victory-shared-events": patch
22+
"victory-stack": patch
23+
"victory-tooltip": patch
24+
"victory-voronoi": patch
25+
"victory-voronoi-container": patch
26+
"victory-zoom-container": patch
27+
---
28+
29+
Remove deprecated babel-plugin-lodash plugin

demo/ts/components/accessibility-demo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { isNumber } from "lodash";
2+
import isNumber from "lodash/isNumber";
33
import { VictoryGroup } from "victory-group";
44
import { VictoryStack } from "victory-stack";
55
import { VictoryChart } from "victory-chart";

demo/ts/components/create-container-demo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { round } from "lodash";
2+
import round from "lodash/round";
33
import { VictoryChart } from "victory-chart";
44
import { VictoryStack } from "victory-stack";
55
import { VictoryGroup } from "victory-group";

demo/ts/components/external-events-demo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { VictoryBar } from "victory-bar";
66
import { VictoryLine } from "victory-line";
77
import { VictoryZoomContainer } from "victory-zoom-container";
88
import { VictoryVoronoiContainer } from "victory-voronoi-container";
9-
import { range } from "lodash";
9+
import range from "lodash/range";
1010
import { VictoryTheme, VictoryThemePalette } from "victory-core";
1111

1212
const themeColors: VictoryThemePalette =

eslint.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ export default tseslint.config(
1616
ignores: [
1717
"**/*.d.ts",
1818
"**/.wireit/",
19+
"**/.docusaurus/",
1920
"**/artifacts/",
2021
"**/coverage/",
2122
"**/demo/rn/",
2223
"**/dist/",
24+
"**/build/",
2325
"**/es/",
2426
"**/lib/",
2527
"**/lib-vendor/",
@@ -77,6 +79,13 @@ export default tseslint.config(
7779
"no-restricted-imports": [
7880
"error",
7981
{
82+
paths: [
83+
{
84+
name: "lodash",
85+
message:
86+
"Be sure to import specific lodash functions, not the entire library!",
87+
},
88+
],
8089
patterns: [
8190
{
8291
group: ["victory*/src", "victory*/src/**"],
@@ -133,6 +142,7 @@ export default tseslint.config(
133142
files: ["**/demo/**/*.{ts,tsx}"],
134143
rules: {
135144
"no-magic-numbers": "off",
145+
"no-restricted-imports": "off",
136146
"react/no-multi-comp": "off",
137147
"@typescript-eslint/no-empty-object-type": "off",
138148
},

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"autoprefixer": "^10.0.1",
5858
"babel-jest": "29.7.0",
5959
"babel-loader": "9.1.3",
60-
"babel-plugin-lodash": "3.3.4",
6160
"babel-plugin-module-resolver": "5.0.0",
6261
"babel-preset-react-native": "4.0.1",
6362
"chromatic": "^11.16.3",

packages/victory-area/src/area.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2] }]*/
22
import React from "react";
3-
import { defaults } from "lodash";
3+
import defaults from "lodash/defaults";
44
import * as d3Shape from "victory-vendor/d3-shape";
55
import {
66
Helpers,

packages/victory-axis/src/helper-methods.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defaults } from "lodash";
1+
import defaults from "lodash/defaults";
22
import { Helpers, Scale, Axis } from "victory-core";
33
import { VictoryAxisProps } from "./victory-axis";
44

packages/victory-axis/src/victory-axis.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { isEmpty } from "lodash";
2+
import isEmpty from "lodash/isEmpty";
33
import {
44
VictoryLabel,
55
VictoryContainer,

0 commit comments

Comments
 (0)