Remove ts-prune as it has been archived over a year ago (#28954)

* Remove ts-prune as it has been archived over a year ago

knip replaces it has better configuration

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update knip config

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2025-01-10 09:58:07 +00:00
committed by GitHub
parent effef7eaa7
commit 585aa75525
5 changed files with 4 additions and 20 deletions

View File

@@ -132,9 +132,3 @@ jobs:
- name: Run linter - name: Run linter
run: "yarn run lint:knip" run: "yarn run lint:knip"
- name: Install Deps
run: "scripts/layered.sh"
- name: Dead Code Analysis
run: "yarn run analyse:unused-exports"

13
knip.ts
View File

@@ -10,13 +10,13 @@ export default {
"playwright/**", "playwright/**",
"test/**", "test/**",
"res/decoder-ring/**", "res/decoder-ring/**",
"res/jitsi_external_api.min.js",
"docs/**",
// Used by jest
"__mocks__/maplibre-gl.js",
], ],
project: ["**/*.{js,ts,jsx,tsx}"], project: ["**/*.{js,ts,jsx,tsx}"],
ignore: [ ignore: [
"docs/**",
"res/jitsi_external_api.min.js",
// Used by jest
"__mocks__/maplibre-gl.js",
// Keep for now // Keep for now
"src/hooks/useLocalStorageState.ts", "src/hooks/useLocalStorageState.ts",
"src/components/views/elements/InfoTooltip.tsx", "src/components/views/elements/InfoTooltip.tsx",
@@ -37,13 +37,8 @@ export default {
// False positive // False positive
"sw.js", "sw.js",
// Used by webpack // Used by webpack
"buffer",
"process", "process",
"util", "util",
// Used by workflows
"ts-prune",
// Required due to bug in bloom-filters https://github.com/Callidon/bloom-filters/issues/75
"@types/seedrandom",
], ],
ignoreBinaries: [ ignoreBinaries: [
// Used in scripts & workflows // Used in scripts & workflows

View File

@@ -66,7 +66,6 @@
"test:playwright:screenshots:build": "docker build playwright -t element-web-playwright", "test:playwright:screenshots:build": "docker build playwright -t element-web-playwright",
"test:playwright:screenshots:run": "docker run --rm --network host -e BASE_URL -e CI -v $(pwd):/work/ -v $(node -e 'console.log(require(`path`).dirname(require.resolve(`matrix-js-sdk/package.json`)))'):/work/node_modules/matrix-js-sdk -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/:/tmp/ -it element-web-playwright --grep @screenshot --project=Chrome", "test:playwright:screenshots:run": "docker run --rm --network host -e BASE_URL -e CI -v $(pwd):/work/ -v $(node -e 'console.log(require(`path`).dirname(require.resolve(`matrix-js-sdk/package.json`)))'):/work/node_modules/matrix-js-sdk -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/:/tmp/ -it element-web-playwright --grep @screenshot --project=Chrome",
"coverage": "yarn test --coverage", "coverage": "yarn test --coverage",
"analyse:unused-exports": "ts-node ./scripts/analyse_unused_exports.ts",
"analyse:webpack-bundles": "webpack-bundle-analyzer webpack-stats.json webapp", "analyse:webpack-bundles": "webpack-bundle-analyzer webpack-stats.json webapp",
"update:jitsi": "curl -s https://meet.element.io/libs/external_api.min.js > ./res/jitsi_external_api.min.js" "update:jitsi": "curl -s https://meet.element.io/libs/external_api.min.js > ./res/jitsi_external_api.min.js"
}, },
@@ -287,7 +286,6 @@
"terser-webpack-plugin": "^5.3.9", "terser-webpack-plugin": "^5.3.9",
"testcontainers": "^10.16.0", "testcontainers": "^10.16.0",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"ts-prune": "^0.10.3",
"typescript": "5.7.2", "typescript": "5.7.2",
"util": "^0.12.5", "util": "^0.12.5",
"web-streams-polyfill": "^4.0.0", "web-streams-polyfill": "^4.0.0",

View File

@@ -110,7 +110,6 @@ dis.register((payload) => {
let sessionLockStolen = false; let sessionLockStolen = false;
// this is exposed solely for unit tests. // this is exposed solely for unit tests.
// ts-prune-ignore-next
export function setSessionLockNotStolen(): void { export function setSessionLockNotStolen(): void {
sessionLockStolen = false; sessionLockStolen = false;
} }

View File

@@ -49,7 +49,6 @@ export function arrayFastResample(input: number[], points: number): number[] {
* @param {number} points The number of samples to end up with. * @param {number} points The number of samples to end up with.
* @returns {number[]} The resampled array. * @returns {number[]} The resampled array.
*/ */
// ts-prune-ignore-next
export function arraySmoothingResample(input: number[], points: number): number[] { export function arraySmoothingResample(input: number[], points: number): number[] {
if (input.length === points) return input; // short-circuit a complicated call if (input.length === points) return input; // short-circuit a complicated call
@@ -92,7 +91,6 @@ export function arraySmoothingResample(input: number[], points: number): number[
* @param {number} newMax The maximum value to scale to. * @param {number} newMax The maximum value to scale to.
* @returns {number[]} The rescaled array. * @returns {number[]} The rescaled array.
*/ */
// ts-prune-ignore-next
export function arrayRescale(input: number[], newMin: number, newMax: number): number[] { export function arrayRescale(input: number[], newMin: number, newMax: number): number[] {
const min: number = Math.min(...input); const min: number = Math.min(...input);
const max: number = Math.max(...input); const max: number = Math.max(...input);