Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f84bf4a

Browse files
authored
chore(website): migrate from lzstring.ts to lz-string package (typescript-eslint#6727)
1 parent 4cca58c commit f84bf4a

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

packages/website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"json-schema-to-typescript": "^11.0.1",
3131
"json5": "^2.2.1",
3232
"konamimojisplosion": "^0.5.1",
33-
"lzstring.ts": "^2.0.2",
33+
"lz-string": "^1.5.0",
3434
"prettier": "*",
3535
"prism-react-renderer": "^1.3.3",
3636
"react": "^18.1.0",

packages/website/plugins/generated-rule-docs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as fs from 'fs';
44
import type { JSONSchema7 } from 'json-schema';
55
import type { JSONSchema } from 'json-schema-to-typescript';
66
import { compile } from 'json-schema-to-typescript';
7-
import * as lz from 'lzstring.ts';
7+
import * as lz from 'lz-string';
88
import type * as mdast from 'mdast';
99
import { EOL } from 'os';
1010
import * as path from 'path';
@@ -417,7 +417,7 @@ export const generatedRuleDocs: Plugin = () => {
417417
};
418418

419419
function convertToPlaygroundHash(eslintrc: string): string {
420-
return lz.LZString.compressToEncodedURIComponent(eslintrc);
420+
return lz.compressToEncodedURIComponent(eslintrc);
421421
}
422422

423423
function nodeIsHeading(node: unist.Node): node is mdast.Heading {

packages/website/src/components/hooks/useHashState.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { toJsonConfig } from '@site/src/components/config/utils';
2-
import * as lz from 'lzstring.ts';
2+
import * as lz from 'lz-string';
33
import { useCallback, useEffect, useState } from 'react';
44

55
import { hasOwnProperty } from '../lib/has-own-property';
66
import { shallowEqual } from '../lib/shallowEqual';
77
import type { ConfigModel } from '../types';
88

99
function writeQueryParam(value: string): string {
10-
return lz.LZString.compressToEncodedURIComponent(value);
10+
return lz.compressToEncodedURIComponent(value);
1111
}
1212

1313
function readQueryParam(value: string | null, fallback: string): string {
1414
return value
15-
? lz.LZString.decompressFromEncodedURIComponent(value) ?? fallback
15+
? lz.decompressFromEncodedURIComponent(value) ?? fallback
1616
: fallback;
1717
}
1818

yarn.lock

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9894,12 +9894,10 @@ lru-queue@^0.1.0:
98949894
dependencies:
98959895
es5-ext "~0.10.2"
98969896

9897-
lzstring.ts@^2.0.2:
9898-
version "2.0.2"
9899-
resolved "https://registry.yarnpkg.com/lzstring.ts/-/lzstring.ts-2.0.2.tgz#1d269bd6ab423713f31e614f67018110ed860129"
9900-
integrity sha512-SEDSYQ3gNrGOdqWcXDO6OU/j3E/ff0WfndKOED4WV0oxDzgf4vijuIwbEE/m0f1LGuTbwH3jVHcwrLdRbQqh3A==
9901-
dependencies:
9902-
tslib "^1.10.0"
9897+
lz-string@^1.5.0:
9898+
version "1.5.0"
9899+
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941"
9900+
integrity sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==
99039901

99049902
[email protected], magic-string@^0.25.0, magic-string@^0.25.7:
99059903
version "0.25.9"
@@ -13621,7 +13619,7 @@ tsconfig-paths@^4.1.2:
1362113619
minimist "^1.2.6"
1362213620
strip-bom "^3.0.0"
1362313621

13624-
tslib@^1.10.0, tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0:
13622+
tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0:
1362513623
version "1.14.1"
1362613624
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
1362713625
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

0 commit comments

Comments
 (0)