Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ module.exports = {
selector: 'TSEnumDeclaration',
message: 'Use a union of string literals instead of an enum',
},
{
selector: 'ImportDeclaration[source.value="lodash"] > ImportSpecifier',
message:
'Use default import from "lodash/{method}" instead of named import from "lodash". Example: import set from "lodash/set"',
},
{
selector:
'VariableDeclarator[id.type="ObjectPattern"][init.type="CallExpression"][init.callee.name="require"][init.arguments.0.value="lodash"]',
message:
'Use require("lodash/{method}") instead of destructuring from require("lodash"). Example: const get = require("lodash/get")',
},
],
'@typescript-eslint/ban-types': [
'error',
Expand Down
2 changes: 1 addition & 1 deletion packages/app-admin-ui/client/pages/Home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Box, HeaderInset } from './components';
import { useAdminMeta } from '../../providers/AdminMeta';

import useResizeObserver from 'use-resize-observer';
import throttle from 'lodash.throttle';
import throttle from 'lodash/throttle';

const getCountQuery = lists => {
if (!lists) return null;
Expand Down
2 changes: 1 addition & 1 deletion packages/app-admin-ui/client/pages/List/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { jsx } from '@emotion/core';
import { useRef, forwardRef, useState, useCallback } from 'react';
import debounce from 'lodash.debounce';
import debounce from 'lodash/debounce';

import { SearchIcon, XIcon } from '@primer/octicons-react';
// import { Input } from '@open-arch-ui/input';
Expand Down
2 changes: 1 addition & 1 deletion packages/app-admin-ui/client/util.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx **/
import { jsx } from '@emotion/core';
import { useState, useEffect } from 'react';
import set from 'lodash.set';
import set from 'lodash/set';

// When there are errors, we want to see if they're Access Denied.
// If so, we modify the dataset (which otherwise would be `null`) to have an
Expand Down
4 changes: 1 addition & 3 deletions packages/app-admin-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@
"file-loader": "^6.2.0",
"graphql": "^16.10.0",
"html-webpack-plugin": "^5.6.3",
"lodash.debounce": "^4.0.8",
"lodash.set": "^4.3.2",
"lodash.throttle": "^4.1.1",
"lodash": "^4.17.21",
"memoize-one": "^5.2.1",
"prop-types": "^15.7.2",
"raf-schd": "^4.0.3",
Expand Down
11 changes: 1 addition & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5952,9 +5952,7 @@ __metadata:
file-loader: ^6.2.0
graphql: ^16.10.0
html-webpack-plugin: ^5.6.3
lodash.debounce: ^4.0.8
lodash.set: ^4.3.2
lodash.throttle: ^4.1.1
lodash: ^4.17.21
memoize-one: ^5.2.1
prop-types: ^15.7.2
raf-schd: ^4.0.3
Expand Down Expand Up @@ -24378,13 +24376,6 @@ __metadata:
languageName: node
linkType: hard

"lodash.set@npm:^4.3.2":
version: 4.3.2
resolution: "lodash.set@npm:4.3.2"
checksum: a9122f49eef9f2d0fc9061a33d87f8e5b8c6b23d46e8b9e9ce1529d3588d79741bd1145a3abdfa3b13082703e65af27ff18d8a07bfc22b9be32f3fc36f763f70
languageName: node
linkType: hard

"lodash.some@npm:^4.4.0":
version: 4.6.0
resolution: "lodash.some@npm:4.6.0"
Expand Down