From ccd6920d8af28d4e9c1d4aded29e348825b2bdda Mon Sep 17 00:00:00 2001 From: Valerii Sidorenko Date: Sat, 7 Feb 2026 15:16:30 +0100 Subject: [PATCH 1/3] chore(knip): add knip config and CI lint check --- .github/workflows/ci.yml | 2 + knip.json | 9 + package-lock.json | 491 ++++++++++++++++++++++++++++++++++++++- package.json | 4 +- 4 files changed, 495 insertions(+), 11 deletions(-) create mode 100644 knip.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd2537c..c7e959e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,8 @@ jobs: run: npm ci - name: Lint Files run: npm run lint + - name: Knip + run: npm run knip - name: Typecheck run: npm run typecheck - name: Build diff --git a/knip.json b/knip.json new file mode 100644 index 0000000..d09c634 --- /dev/null +++ b/knip.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://unpkg.com/knip@5/schema.json", + "entry": ["src/index.ts", "gulpfile.mjs"], + "ignoreDependencies": ["@commitlint/types"], + "ignoreIssues": { + ".storybook/main.ts": ["unresolved"], + "**/*.scss": ["unresolved"] + } +} diff --git a/package-lock.json b/package-lock.json index b314d62..4ed03c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,6 +42,7 @@ "gulp-sass": "^6.0.1", "gulp-sourcemaps": "^3.0.0", "husky": "^9.1.7", + "knip": "^5.83.1", "nano-staged": "^0.9.0", "npm-run-all": "^4.1.5", "playwright": "^1.57.0", @@ -1248,21 +1249,21 @@ } }, "node_modules/@emnapi/core": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.3.tgz", - "integrity": "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.8.1.tgz", + "integrity": "sha512-AvT9QFpxK0Zd8J0jopedNm+w/2fIzvtPKPjqyw9jwvBaReTTqPBk9Hixaz7KbjimP+QNz605/XnjFcDAL2pqBg==", "dev": true, "license": "MIT", "optional": true, "dependencies": { - "@emnapi/wasi-threads": "1.0.2", + "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" } }, "node_modules/@emnapi/runtime": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.3.tgz", - "integrity": "sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", "dev": true, "license": "MIT", "optional": true, @@ -1271,9 +1272,9 @@ } }, "node_modules/@emnapi/wasi-threads": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.2.tgz", - "integrity": "sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", + "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", "dev": true, "license": "MIT", "optional": true, @@ -2640,6 +2641,317 @@ "node": ">= 8" } }, + "node_modules/@oxc-resolver/binding-android-arm-eabi": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.17.0.tgz", + "integrity": "sha512-kVnY21v0GyZ/+LG6EIO48wK3mE79BUuakHUYLIqobO/Qqq4mJsjuYXMSn3JtLcKZpN1HDVit4UHpGJHef1lrlw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-android-arm64": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.17.0.tgz", + "integrity": "sha512-Pf8e3XcsK9a8RHInoAtEcrwf2vp7V9bSturyUUYxw9syW6E7cGi7z9+6ADXxm+8KAevVfLA7pfBg8NXTvz/HOw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-arm64": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.17.0.tgz", + "integrity": "sha512-lVSgKt3biecofXVr8e1hnfX0IYMd4A6VCxmvOmHsFt5Zbmt0lkO4S2ap2bvQwYDYh5ghUNamC7M2L8K6vishhQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-x64": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.17.0.tgz", + "integrity": "sha512-+/raxVJE1bo7R4fA9Yp0wm3slaCOofTEeUzM01YqEGcRDLHB92WRGjRhagMG2wGlvqFuSiTp81DwSbBVo/g6AQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-freebsd-x64": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.17.0.tgz", + "integrity": "sha512-x9Ks56n+n8h0TLhzA6sJXa2tGh3uvMGpBppg6PWf8oF0s5S/3p/J6k1vJJ9lIUtTmenfCQEGKnFokpRP4fLTLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-gnueabihf": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.17.0.tgz", + "integrity": "sha512-Wf3w07Ow9kXVJrS0zmsaFHKOGhXKXE8j1tNyy+qIYDsQWQ4UQZVx5SjlDTcqBnFerlp3Z3Is0RjmVzgoLG3qkA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-musleabihf": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.17.0.tgz", + "integrity": "sha512-N0OKA1al1gQ5Gm7Fui1RWlXaHRNZlwMoBLn3TVtSXX+WbnlZoVyDqqOqFL8+pVEHhhxEA2LR8kmM0JO6FAk6dg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-gnu": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.17.0.tgz", + "integrity": "sha512-wdcQ7Niad9JpjZIGEeqKJnTvczVunqlZ/C06QzR5zOQNeLVRScQ9S5IesKWUAPsJQDizV+teQX53nTK+Z5Iy+g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-musl": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.17.0.tgz", + "integrity": "sha512-65B2/t39HQN5AEhkLsC+9yBD1iRUkKOIhfmJEJ7g6wQ9kylra7JRmNmALFjbsj0VJsoSQkpM8K07kUZuNJ9Kxw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-ppc64-gnu": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.17.0.tgz", + "integrity": "sha512-kExgm3TLK21dNMmcH+xiYGbc6BUWvT03PUZ2aYn8mUzGPeeORklBhg3iYcaBI3ZQHB25412X1Z6LLYNjt4aIaA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-riscv64-gnu": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.17.0.tgz", + "integrity": "sha512-1utUJC714/ydykZQE8c7QhpEyM4SaslMfRXxN9G61KYazr6ndt85LaubK3EZCSD50vVEfF4PVwFysCSO7LN9uA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-riscv64-musl": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.17.0.tgz", + "integrity": "sha512-mayiYOl3LMmtO2CLn4I5lhanfxEo0LAqlT/EQyFbu1ZN3RS+Xa7Q3JEM0wBpVIyfO/pqFrjvC5LXw/mHNDEL7A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-s390x-gnu": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.17.0.tgz", + "integrity": "sha512-Ow/yI+CrUHxIIhn/Y1sP/xoRKbCC3x9O1giKr3G/pjMe+TCJ5ZmfqVWU61JWwh1naC8X5Xa7uyLnbzyYqPsHfg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-x64-gnu": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.17.0.tgz", + "integrity": "sha512-Z4J7XlPMQOLPANyu6y3B3V417Md4LKH5bV6bhqgaG99qLHmU5LV2k9ErV14fSqoRc/GU/qOpqMdotxiJqN/YWg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-x64-musl": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.17.0.tgz", + "integrity": "sha512-0effK+8lhzXsgsh0Ny2ngdnTPF30v6QQzVFApJ1Ctk315YgpGkghkelvrLYYgtgeFJFrzwmOJ2nDvCrUFKsS2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-openharmony-arm64": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-openharmony-arm64/-/binding-openharmony-arm64-11.17.0.tgz", + "integrity": "sha512-kFB48dRUW6RovAICZaxHKdtZe+e94fSTNA2OedXokzMctoU54NPZcv0vUX5PMqyikLIKJBIlW7laQidnAzNrDA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.17.0.tgz", + "integrity": "sha512-a3elKSBLPT0OoRPxTkCIIc+4xnOELolEBkPyvdj01a6PSdSmyJ1NExWjWLaXnT6wBMblvKde5RmSwEi3j+jZpg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.1.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.1.tgz", + "integrity": "sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1", + "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@oxc-resolver/binding-win32-arm64-msvc": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.17.0.tgz", + "integrity": "sha512-4eszUsSDb9YVx0RtYkPWkxxtSZIOgfeiX//nG5cwRRArg178w4RCqEF1kbKPud9HPrp1rXh7gE4x911OhvTnPg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxc-resolver/binding-win32-ia32-msvc": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-11.17.0.tgz", + "integrity": "sha512-t946xTXMmR7yGH0KAe9rB055/X4EPIu93JUvjchl2cizR5QbuwkUV7vLS2BS6x6sfvDoQb6rWYnV1HCci6tBSg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxc-resolver/binding-win32-x64-msvc": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.17.0.tgz", + "integrity": "sha512-pX6s2kMXLQg+hlqKk5UqOW09iLLxnTkvn8ohpYp2Mhsm2yzDPCx9dyOHiB/CQixLzTkLQgWWJykN4Z3UfRKW4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@parcel/watcher": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.0.tgz", @@ -8232,6 +8544,16 @@ "reusify": "^1.0.4" } }, + "node_modules/fd-package-json": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fd-package-json/-/fd-package-json-2.0.0.tgz", + "integrity": "sha512-jKmm9YtsNXN789RS/0mSzOC1NUq9mkVd65vbSSVsKdjGvYXBuE4oWe2QOEoFeRmJg+lPuZxpmrfFclNhoRMneQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "walk-up-path": "^4.0.0" + } + }, "node_modules/fflate": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", @@ -8413,6 +8735,22 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/formatly": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/formatly/-/formatly-0.3.0.tgz", + "integrity": "sha512-9XNj/o4wrRFyhSMJOvsuyMwy8aUfBaZ1VrqHVfohyXf0Sw0e+yfKG+xZaY3arGCOMdwFsqObtzVOc1gU9KiT9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "fd-package-json": "^2.0.0" + }, + "bin": { + "formatly": "bin/index.mjs" + }, + "engines": { + "node": ">=18.3.0" + } + }, "node_modules/fs-mkdirp-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-2.0.1.tgz", @@ -10297,6 +10635,84 @@ "node": ">=0.10.0" } }, + "node_modules/knip": { + "version": "5.83.1", + "resolved": "https://registry.npmjs.org/knip/-/knip-5.83.1.tgz", + "integrity": "sha512-av3ZG/Nui6S/BNL8Tmj12yGxYfTnwWnslouW97m40him7o8MwiMjZBY9TPvlEWUci45aVId0/HbgTwSKIDGpMw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/webpro" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/knip" + } + ], + "license": "ISC", + "dependencies": { + "@nodelib/fs.walk": "^1.2.3", + "fast-glob": "^3.3.3", + "formatly": "^0.3.0", + "jiti": "^2.6.0", + "js-yaml": "^4.1.1", + "minimist": "^1.2.8", + "oxc-resolver": "^11.15.0", + "picocolors": "^1.1.1", + "picomatch": "^4.0.1", + "smol-toml": "^1.5.2", + "strip-json-comments": "5.0.3", + "zod": "^4.1.11" + }, + "bin": { + "knip": "bin/knip.js", + "knip-bun": "bin/knip-bun.js" + }, + "engines": { + "node": ">=18.18.0" + }, + "peerDependencies": { + "@types/node": ">=18", + "typescript": ">=5.0.4 <7" + } + }, + "node_modules/knip/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/knip/node_modules/strip-json-comments": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz", + "integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/knip/node_modules/zod": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/known-css-properties": { "version": "0.37.0", "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.37.0.tgz", @@ -11270,6 +11686,38 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/oxc-resolver": { + "version": "11.17.0", + "resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-11.17.0.tgz", + "integrity": "sha512-R5P2Tw6th+nQJdNcZGfuppBS/sM0x1EukqYffmlfX2xXLgLGCCPwu4ruEr9Sx29mrpkHgITc130Qps2JR90NdQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxc-resolver/binding-android-arm-eabi": "11.17.0", + "@oxc-resolver/binding-android-arm64": "11.17.0", + "@oxc-resolver/binding-darwin-arm64": "11.17.0", + "@oxc-resolver/binding-darwin-x64": "11.17.0", + "@oxc-resolver/binding-freebsd-x64": "11.17.0", + "@oxc-resolver/binding-linux-arm-gnueabihf": "11.17.0", + "@oxc-resolver/binding-linux-arm-musleabihf": "11.17.0", + "@oxc-resolver/binding-linux-arm64-gnu": "11.17.0", + "@oxc-resolver/binding-linux-arm64-musl": "11.17.0", + "@oxc-resolver/binding-linux-ppc64-gnu": "11.17.0", + "@oxc-resolver/binding-linux-riscv64-gnu": "11.17.0", + "@oxc-resolver/binding-linux-riscv64-musl": "11.17.0", + "@oxc-resolver/binding-linux-s390x-gnu": "11.17.0", + "@oxc-resolver/binding-linux-x64-gnu": "11.17.0", + "@oxc-resolver/binding-linux-x64-musl": "11.17.0", + "@oxc-resolver/binding-openharmony-arm64": "11.17.0", + "@oxc-resolver/binding-wasm32-wasi": "11.17.0", + "@oxc-resolver/binding-win32-arm64-msvc": "11.17.0", + "@oxc-resolver/binding-win32-ia32-msvc": "11.17.0", + "@oxc-resolver/binding-win32-x64-msvc": "11.17.0" + } + }, "node_modules/p-limit": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", @@ -12871,6 +13319,19 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, + "node_modules/smol-toml": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.0.tgz", + "integrity": "sha512-4zemZi0HvTnYwLfrpk/CF9LOd9Lt87kAt50GnqhMpyF9U3poDAP2+iukq2bZsO/ufegbYehBkqINbsWxj4l4cw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } + }, "node_modules/source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -14729,6 +15190,16 @@ "node": ">=18" } }, + "node_modules/walk-up-path": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-4.0.0.tgz", + "integrity": "sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", diff --git a/package.json b/package.json index 70491c5..f4d9baf 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,8 @@ "build": "gulp", "start": "storybook dev -p 7070", "build-storybook": "storybook build -c .storybook -o storybook-static", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "knip": "knip" }, "dependencies": { "@bem-react/classname": "^1.6.0", @@ -98,6 +99,7 @@ "gulp-sass": "^6.0.1", "gulp-sourcemaps": "^3.0.0", "husky": "^9.1.7", + "knip": "^5.83.1", "nano-staged": "^0.9.0", "npm-run-all": "^4.1.5", "playwright": "^1.57.0", From be5de02f6c0896cc1dda8cc241eab88d6a748a5d Mon Sep 17 00:00:00 2001 From: Valerii Sidorenko Date: Sat, 7 Feb 2026 15:43:33 +0100 Subject: [PATCH 2/3] chore(knip): use github-actions reporter in CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7e959e..3531cdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - name: Lint Files run: npm run lint - name: Knip - run: npm run knip + run: npm run knip -- --reporter github-actions - name: Typecheck run: npm run typecheck - name: Build From 6a6bd6bcaf5d78d02663acf0e681be8058a13060 Mon Sep 17 00:00:00 2001 From: Valerii Sidorenko Date: Sat, 7 Feb 2026 15:57:32 +0100 Subject: [PATCH 3/3] refactor(knip): remove unused exports reported by knip --- .storybook/theme.ts | 4 ++-- gulpfile.mjs | 1 + src/components/CalendarView/CalendarView.tsx | 2 +- .../DatePicker/hooks/datePickerStateFactory.ts | 2 +- .../RangeDateSelection/components/Ticks/Ticks.tsx | 1 - .../components/Ticks/UnavialableTicks.tsx | 5 +---- src/components/RangeDateSelection/utils/span.ts | 2 +- .../components/Control/Control.tsx | 2 +- .../components/Presets/Presets.tsx | 4 ++-- .../components/Presets/utils.ts | 2 +- .../components/Zones/Zones.tsx | 2 +- src/components/RelativeRangeDatePicker/utils.ts | 2 +- .../utils/validation/relativeRangeDatePicker.ts | 15 +++++++++++++-- src/demo/DocsDecorator/DocsDecorator.tsx | 2 +- src/demo/utils/cn.ts | 2 +- src/demo/utils/zones.ts | 2 +- src/hooks/useMove.ts | 4 ++-- tsconfig.json | 5 ++++- 18 files changed, 35 insertions(+), 24 deletions(-) diff --git a/.storybook/theme.ts b/.storybook/theme.ts index 88e5898..b84bea8 100644 --- a/.storybook/theme.ts +++ b/.storybook/theme.ts @@ -29,13 +29,13 @@ const common: Omit = { brandUrl: 'https://gravity-ui.com/', }; -export const CloudThemeLight = create({ +const CloudThemeLight = create({ base: 'light', ...common, brandTitle: renderBrandTitle('light'), }); -export const CloudThemeDark = create({ +const CloudThemeDark = create({ base: 'dark', ...common, brandTitle: renderBrandTitle('dark'), diff --git a/gulpfile.mjs b/gulpfile.mjs index d37e0f8..a8f6b0c 100644 --- a/gulpfile.mjs +++ b/gulpfile.mjs @@ -19,6 +19,7 @@ task('clean', () => { async function compileTs(modules = false) { const tsProject = await createTypescriptProject({ compilerOptions: { + noEmit: false, declaration: true, ...(modules ? undefined : {verbatimModuleSyntax: false}), module: modules ? 'esnext' : 'NodeNext', diff --git a/src/components/CalendarView/CalendarView.tsx b/src/components/CalendarView/CalendarView.tsx index eb74186..af3baf2 100644 --- a/src/components/CalendarView/CalendarView.tsx +++ b/src/components/CalendarView/CalendarView.tsx @@ -27,7 +27,7 @@ export interface CalendarInstance { focus: () => void; } -export interface CalendarViewProps extends DomProps, StyleProps, FocusEvents, AccessibilityProps { +interface CalendarViewProps extends DomProps, StyleProps, FocusEvents, AccessibilityProps { state: CalendarState | RangeCalendarState; /** * The size of the element. diff --git a/src/components/DatePicker/hooks/datePickerStateFactory.ts b/src/components/DatePicker/hooks/datePickerStateFactory.ts index 12db59c..aab973c 100644 --- a/src/components/DatePicker/hooks/datePickerStateFactory.ts +++ b/src/components/DatePicker/hooks/datePickerStateFactory.ts @@ -63,7 +63,7 @@ export interface DatePickerState { dateFieldState: DateFieldState; } -export interface DatePickerStateFactoryOptions> { +interface DatePickerStateFactoryOptions> { getPlaceholderTime: (placeholderValue: DateTime | undefined, timeZone?: string) => T; mergeDateTime: (date: T, time: T) => T; setTimezone: (date: T, timeZone: string) => T; diff --git a/src/components/RangeDateSelection/components/Ticks/Ticks.tsx b/src/components/RangeDateSelection/components/Ticks/Ticks.tsx index e01a881..da52245 100644 --- a/src/components/RangeDateSelection/components/Ticks/Ticks.tsx +++ b/src/components/RangeDateSelection/components/Ticks/Ticks.tsx @@ -34,7 +34,6 @@ interface TicksProps { const b = block('timeline-ticks'); export {makeMiddleTicksGeometry, makeSlitTicksGeometry}; -export type {Geometry}; export function Ticks({ theme, diff --git a/src/components/RangeDateSelection/components/Ticks/UnavialableTicks.tsx b/src/components/RangeDateSelection/components/Ticks/UnavialableTicks.tsx index 401b871..e10fec4 100644 --- a/src/components/RangeDateSelection/components/Ticks/UnavialableTicks.tsx +++ b/src/components/RangeDateSelection/components/Ticks/UnavialableTicks.tsx @@ -6,7 +6,7 @@ import {block} from '../../../../utils/cn'; import {useViewportDimensions, useViewportInterval} from '../Ruler/Ruler'; import type {Geometry} from './utils'; -import {calculatePosition, makeMiddleTicksGeometry, makeSlitTicksGeometry} from './utils'; +import {calculatePosition} from './utils'; import './Ticks.scss'; @@ -22,9 +22,6 @@ interface TicksProps { const b = block('timeline-ticks'); -export {makeMiddleTicksGeometry, makeSlitTicksGeometry}; -export type {Geometry}; - export function UnavailableTicks({ theme, geometry, diff --git a/src/components/RangeDateSelection/utils/span.ts b/src/components/RangeDateSelection/utils/span.ts index c4fc16a..21bdadc 100644 --- a/src/components/RangeDateSelection/utils/span.ts +++ b/src/components/RangeDateSelection/utils/span.ts @@ -1,4 +1,4 @@ -export interface Span { +interface Span { start: number; end: number; } diff --git a/src/components/RelativeRangeDatePicker/components/Control/Control.tsx b/src/components/RelativeRangeDatePicker/components/Control/Control.tsx index 5ddb51f..d80dd3e 100644 --- a/src/components/RelativeRangeDatePicker/components/Control/Control.tsx +++ b/src/components/RelativeRangeDatePicker/components/Control/Control.tsx @@ -14,7 +14,7 @@ import {i18n} from './i18n'; import './Control.scss'; -export type ControlProps = { +type ControlProps = { props: RelativeRangeDatePickerProps; state: RelativeRangeDatePickerState; open: boolean; diff --git a/src/components/RelativeRangeDatePicker/components/Presets/Presets.tsx b/src/components/RelativeRangeDatePicker/components/Presets/Presets.tsx index 82304cf..b23b627 100644 --- a/src/components/RelativeRangeDatePicker/components/Presets/Presets.tsx +++ b/src/components/RelativeRangeDatePicker/components/Presets/Presets.tsx @@ -16,7 +16,7 @@ import './Presets.scss'; const b = block('relative-range-date-picker-presets'); -export interface PresetProps { +interface PresetProps { className?: string; onChoosePreset: (start: string, end: string) => void; withTime?: boolean; @@ -75,7 +75,7 @@ export function Presets({ ); } -export const SIZE_TO_ITEM_HEIGHT = { +const SIZE_TO_ITEM_HEIGHT = { s: 28, m: 28, l: 32, diff --git a/src/components/RelativeRangeDatePicker/components/Presets/utils.ts b/src/components/RelativeRangeDatePicker/components/Presets/utils.ts index d26e6c6..b40f5c8 100644 --- a/src/components/RelativeRangeDatePicker/components/Presets/utils.ts +++ b/src/components/RelativeRangeDatePicker/components/Presets/utils.ts @@ -67,7 +67,7 @@ function isDateUnit(value: string): value is 's' | 'm' | 'h' | 'd' | 'w' | 'M' | return ['s', 'm', 'h', 'd', 'w', 'M', 'y'].includes(value); } -export function filterPresets(presets: Preset[], minValue?: DateTime) { +function filterPresets(presets: Preset[], minValue?: DateTime) { return presets.filter((preset) => { const from = dateTimeParse(preset.from); const to = dateTimeParse(preset.to, {roundUp: true}); diff --git a/src/components/RelativeRangeDatePicker/components/Zones/Zones.tsx b/src/components/RelativeRangeDatePicker/components/Zones/Zones.tsx index ef79980..c216236 100644 --- a/src/components/RelativeRangeDatePicker/components/Zones/Zones.tsx +++ b/src/components/RelativeRangeDatePicker/components/Zones/Zones.tsx @@ -42,7 +42,7 @@ zones.unshift({ const b = block('relative-range-date-picker-zones'); -export interface ZonesProps { +interface ZonesProps { value: string; onUpdate: (timeZone: string) => void; size?: 's' | 'm' | 'l' | 'xl'; diff --git a/src/components/RelativeRangeDatePicker/utils.ts b/src/components/RelativeRangeDatePicker/utils.ts index 69df86b..a318b36 100644 --- a/src/components/RelativeRangeDatePicker/utils.ts +++ b/src/components/RelativeRangeDatePicker/utils.ts @@ -7,7 +7,7 @@ import type {Preset} from './components/Presets/defaultPresets'; import {i18n} from './components/Presets/i18n'; import {getPresetTitle} from './components/Presets/utils'; -export function resolveTimeZone(timeZone: string) { +function resolveTimeZone(timeZone: string) { if (timeZone === 'default' || timeZone === 'system') { return dateTime({timeZone}).timeZone(); } diff --git a/src/components/utils/validation/relativeRangeDatePicker.ts b/src/components/utils/validation/relativeRangeDatePicker.ts index c13a06c..a41a41d 100644 --- a/src/components/utils/validation/relativeRangeDatePicker.ts +++ b/src/components/utils/validation/relativeRangeDatePicker.ts @@ -5,8 +5,14 @@ import type {RelativeRangeDatePickerValue} from '../../RelativeRangeDatePicker'; import type {ExtractFunctionType} from '../../types'; import {getValidationResult} from './datePicker'; +import type {ValidationResult} from './datePicker'; import {i18n} from './i18n'; +interface RangeValidationResult extends ValidationResult { + startValidationResult: ValidationResult; + endValidationResult: ValidationResult; +} + export function getRangeValidationResult( value: RelativeRangeDatePickerValue | null, allowNullableValues: boolean | undefined, @@ -15,9 +21,14 @@ export function getRangeValidationResult( isDateUnavailable: ((v: DateTime, endpoint: 'start' | 'end') => boolean) | undefined, timeZone: string, t: ExtractFunctionType = i18n, -) { +): RangeValidationResult { if (!value) { - return {isInvalid: false, errors: []}; + return { + isInvalid: false, + errors: [], + startValidationResult: {isInvalid: false, errors: []}, + endValidationResult: {isInvalid: false, errors: []}, + }; } const startDate = value.start ? dateTimeParse(value.start.value, {timeZone}) : null; diff --git a/src/demo/DocsDecorator/DocsDecorator.tsx b/src/demo/DocsDecorator/DocsDecorator.tsx index e673756..3e972c2 100644 --- a/src/demo/DocsDecorator/DocsDecorator.tsx +++ b/src/demo/DocsDecorator/DocsDecorator.tsx @@ -9,7 +9,7 @@ import {block} from '../utils/cn'; import './DocsDecorator.scss'; -export interface DocsDecoratorProps extends React.PropsWithChildren {} +interface DocsDecoratorProps extends React.PropsWithChildren {} const b = block('docs-decorator'); diff --git a/src/demo/utils/cn.ts b/src/demo/utils/cn.ts index f3ed192..ca80cd7 100644 --- a/src/demo/utils/cn.ts +++ b/src/demo/utils/cn.ts @@ -1,5 +1,5 @@ import {withNaming} from '@bem-react/classname'; -export const NAMESPACE = 'g-storybook-'; +const NAMESPACE = 'g-storybook-'; export const block = withNaming({n: NAMESPACE, e: '__', m: '_'}); diff --git a/src/demo/utils/zones.ts b/src/demo/utils/zones.ts index a4f0b28..9643848 100644 --- a/src/demo/utils/zones.ts +++ b/src/demo/utils/zones.ts @@ -1,7 +1,7 @@ import {dateTime, getTimeZonesList} from '@gravity-ui/date-utils'; import type {InputType} from 'storybook/internal/types'; -export const zones = getTimeZonesList().reduce>((l, zone) => { +const zones = getTimeZonesList().reduce>((l, zone) => { // eslint-disable-next-line no-param-reassign l[zone] = `${zone} (UTC ${dateTime({timeZone: zone}).format('Z')})`; return l; diff --git a/src/hooks/useMove.ts b/src/hooks/useMove.ts index af832b0..bc43647 100644 --- a/src/hooks/useMove.ts +++ b/src/hooks/useMove.ts @@ -2,7 +2,7 @@ import React from 'react'; import {useEventHandler} from './useEventHandler'; -export type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard'; +type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard'; interface EventBase { shiftKey: boolean; @@ -29,7 +29,7 @@ export interface MoveEndEvent extends BaseMoveEvent { type: 'moveend'; } -export interface MoveEvents { +interface MoveEvents { onMoveStart?: (e: MoveStartEvent) => void; onMove?: (e: MoveMoveEvent) => void; onMoveEnd?: (e: MoveEndEvent) => void; diff --git a/tsconfig.json b/tsconfig.json index 7601c66..6531da0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,15 @@ { "extends": "@gravity-ui/tsconfig", "compilerOptions": { + "noEmit": true, "resolveJsonModule": true, "verbatimModuleSyntax": true, "module": "ESNext", "moduleResolution": "bundler", "jsx": "react-jsx", - "importHelpers": true + "importHelpers": true, + "isolatedModules": true, + "declaration": true }, "include": ["**/*.ts", "**/*.tsx", ".storybook/**/*.ts", ".storybook/**/*.tsx"] }