Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop lodash #926

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"prettier": "2.8.7"
},
"dependencies": {

Choose a reason for hiding this comment

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

you forget to install lodash.clonedeep

"@types/lodash.clonedeep": "^4.5.7",

Choose a reason for hiding this comment

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

should be devDependency

"ajv": "^8.11.0",
"lodash": "4.17.21",

Choose a reason for hiding this comment

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

you need to remove lodash

Suggested change
"lodash": "4.17.21",

"request-light": "^0.5.7",
Expand Down
4 changes: 2 additions & 2 deletions src/languageservice/services/yamlCodeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import { yamlDocumentsCache } from '../parser/yaml-documents';
import { FlowStyleRewriter } from '../utils/flow-style-rewriter';
import { ASTNode } from '../jsonASTTypes';
import * as _ from 'lodash';
import cloneDeep from '@types/lodash.clonedeep';

Check failure on line 29 in src/languageservice/services/yamlCodeActions.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Multiple spaces found before 'from'

Check failure on line 29 in src/languageservice/services/yamlCodeActions.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Delete `·`

Check failure on line 29 in src/languageservice/services/yamlCodeActions.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Unable to resolve path to module '@types/lodash.clonedeep'

Choose a reason for hiding this comment

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

Suggested change
import cloneDeep from '@types/lodash.clonedeep';
import cloneDeep from 'lodash.clonedeep';

import { SourceToken } from 'yaml/dist/parse/cst';

interface YamlDiagnosticData {
Expand Down Expand Up @@ -247,7 +247,7 @@
node = node.parent;
}
if (node && isMap(node.internalNode)) {
const sorted: YAMLMap = _.cloneDeep(node.internalNode);
const sorted: YAMLMap = cloneDeep(node.internalNode);
if (
(sorted.srcToken.type === 'block-map' || sorted.srcToken.type === 'flow-collection') &&
(node.internalNode.srcToken.type === 'block-map' || node.internalNode.srcToken.type === 'flow-collection')
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,18 @@
resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz"
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==

"@types/lodash.clonedeep@^4.5.7":
version "4.5.7"
resolved "https://registry.yarnpkg.com/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.7.tgz#0e119f582ed6f9e6b373c04a644651763214f197"
integrity sha512-ccNqkPptFIXrpVqUECi60/DFxjNKsfoQxSQsgcBJCX/fuX1wgyQieojkcWH/KpE3xzLoWN/2k+ZeGqIN3paSvw==
dependencies:
"@types/lodash" "*"

"@types/lodash@*":
version "4.14.199"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.199.tgz#c3edb5650149d847a277a8961a7ad360c474e9bf"
integrity sha512-Vrjz5N5Ia4SEzWWgIVwnHNEnb1UE1XMkvY5DGXrAeOGE9imk0hgTHh5GyDjLDJi9OTCn9oo9dXH1uToK1VRfrg==

"@types/[email protected]":
version "8.2.2"
resolved "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.2.tgz"
Expand Down
Loading