Skip to content

Commit 9059981

Browse files
authored
chore(app-admin-ui): DOMA-12629 update lodash (#47)
* chore(app-admin-ui): DOMA-12629 update lodash * chore(app-admin-ui): DOMA-12629 update yarn.lock * chore(app-admin-ui): DOMA-12629 fix after review * chore(app-admin-ui): DOMA-12629 add eslint rule * chore(app-admin-ui): DOMA-12629 fix prettierr
1 parent 94b48fe commit 9059981

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

.eslintrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ module.exports = {
8181
selector: 'TSEnumDeclaration',
8282
message: 'Use a union of string literals instead of an enum',
8383
},
84+
{
85+
selector: 'ImportDeclaration[source.value="lodash"] > ImportSpecifier',
86+
message:
87+
'Use default import from "lodash/{method}" instead of named import from "lodash". Example: import set from "lodash/set"',
88+
},
89+
{
90+
selector:
91+
'VariableDeclarator[id.type="ObjectPattern"][init.type="CallExpression"][init.callee.name="require"][init.arguments.0.value="lodash"]',
92+
message:
93+
'Use require("lodash/{method}") instead of destructuring from require("lodash"). Example: const get = require("lodash/get")',
94+
},
8495
],
8596
'@typescript-eslint/ban-types': [
8697
'error',

packages/app-admin-ui/client/pages/Home/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Box, HeaderInset } from './components';
1212
import { useAdminMeta } from '../../providers/AdminMeta';
1313

1414
import useResizeObserver from 'use-resize-observer';
15-
import throttle from 'lodash.throttle';
15+
import throttle from 'lodash/throttle';
1616

1717
const getCountQuery = lists => {
1818
if (!lists) return null;

packages/app-admin-ui/client/pages/List/Search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { jsx } from '@emotion/core';
44
import { useRef, forwardRef, useState, useCallback } from 'react';
5-
import debounce from 'lodash.debounce';
5+
import debounce from 'lodash/debounce';
66

77
import { SearchIcon, XIcon } from '@primer/octicons-react';
88
// import { Input } from '@open-arch-ui/input';

packages/app-admin-ui/client/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @jsx jsx **/
22
import { jsx } from '@emotion/core';
33
import { useState, useEffect } from 'react';
4-
import set from 'lodash.set';
4+
import set from 'lodash/set';
55

66
// When there are errors, we want to see if they're Access Denied.
77
// If so, we modify the dataset (which otherwise would be `null`) to have an

packages/app-admin-ui/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@
5858
"file-loader": "^6.2.0",
5959
"graphql": "^16.10.0",
6060
"html-webpack-plugin": "^5.6.3",
61-
"lodash.debounce": "^4.0.8",
62-
"lodash.set": "^4.3.2",
63-
"lodash.throttle": "^4.1.1",
61+
"lodash": "^4.17.21",
6462
"memoize-one": "^5.2.1",
6563
"prop-types": "^15.7.2",
6664
"raf-schd": "^4.0.3",

yarn.lock

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5952,9 +5952,7 @@ __metadata:
59525952
file-loader: ^6.2.0
59535953
graphql: ^16.10.0
59545954
html-webpack-plugin: ^5.6.3
5955-
lodash.debounce: ^4.0.8
5956-
lodash.set: ^4.3.2
5957-
lodash.throttle: ^4.1.1
5955+
lodash: ^4.17.21
59585956
memoize-one: ^5.2.1
59595957
prop-types: ^15.7.2
59605958
raf-schd: ^4.0.3
@@ -24378,13 +24376,6 @@ __metadata:
2437824376
languageName: node
2437924377
linkType: hard
2438024378

24381-
"lodash.set@npm:^4.3.2":
24382-
version: 4.3.2
24383-
resolution: "lodash.set@npm:4.3.2"
24384-
checksum: a9122f49eef9f2d0fc9061a33d87f8e5b8c6b23d46e8b9e9ce1529d3588d79741bd1145a3abdfa3b13082703e65af27ff18d8a07bfc22b9be32f3fc36f763f70
24385-
languageName: node
24386-
linkType: hard
24387-
2438824379
"lodash.some@npm:^4.4.0":
2438924380
version: 4.6.0
2439024381
resolution: "lodash.some@npm:4.6.0"

0 commit comments

Comments
 (0)