Skip to content

Commit 8a9a830

Browse files
onigoetzjeddy3
andauthored
Fix fastest-levenshtein import when bundling (#8621)
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
1 parent 651a1b4 commit 8a9a830

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.changeset/pink-chicken-clean.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"stylelint": patch
3+
---
4+
5+
Fixed: `fastest-levenshtein` import when bundling

lib/utils/checkInvalidCLIOptions.cjs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/utils/checkInvalidCLIOptions.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { EOL } from 'node:os';
22

3-
import levenshtein from 'fastest-levenshtein';
3+
import { distance } from 'fastest-levenshtein';
44
import picocolors from 'picocolors';
55

66
const { cyan, red } = picocolors;
@@ -32,7 +32,7 @@ const suggest = (all, invalid) => {
3232
const maxThreshold = 10;
3333

3434
for (let threshold = 1; threshold <= maxThreshold; threshold++) {
35-
const suggestion = all.find((option) => levenshtein.distance(option, invalid) <= threshold);
35+
const suggestion = all.find((option) => distance(option, invalid) <= threshold);
3636

3737
if (suggestion) {
3838
return suggestion;

0 commit comments

Comments
 (0)