Skip to content

Commit

Permalink
refactor: drop lodash (#406)
Browse files Browse the repository at this point in the history
* refactor: drop lodash

* chore: changeset
  • Loading branch information
SukkaW authored Feb 18, 2025
1 parent b331bdc commit 91d7a0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/vast-coats-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-yml": patch
---

Replace `lodash` to reduce the package installation size
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
"homepage": "https://ota-meshi.github.io/eslint-plugin-yml/",
"dependencies": {
"debug": "^4.3.2",
"escape-string-regexp": "4.0.0",
"eslint-compat-utils": "^0.6.0",
"lodash": "^4.17.21",
"natural-compare": "^1.4.0",
"yaml-eslint-parser": "^1.2.1"
},
Expand All @@ -80,7 +80,6 @@
"@types/eslint-scope": "^3.7.0",
"@types/eslint-visitor-keys": "^3.0.0",
"@types/estree": "^1.0.0",
"@types/lodash": "^4.14.158",
"@types/mocha": "^10.0.0",
"@types/natural-compare": "^1.4.0",
"@types/node": "^22.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/rules/spaced-comment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AST } from "yaml-eslint-parser";
import lodash from "lodash";
import escapeStringRegexp from "escape-string-regexp";
import { createRule } from "../utils/index";
import { getSourceCode } from "../utils/compat";

Expand All @@ -13,7 +13,7 @@ import { getSourceCode } from "../utils/compat";
* @returns {string} An escaped string.
*/
function escapeText(s: string) {
return `(?:${lodash.escapeRegExp(s)})`;
return `(?:${escapeStringRegexp(s)})`;
}

/**
Expand Down

0 comments on commit 91d7a0a

Please # to comment.