mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 21:37:41 +00:00
## Summary Cleans up dead code and unused dependencies identified by [knip](https://knip.dev/). All removals were individually verified to have zero imports or references across the codebase. No functional changes. **Deleted 9 unused files:** - `packages/api/src/clickhouse/__tests__/clickhouse.V1_DEPRECATED_test.ts` — skipped deprecated test - `packages/api/src/utils/email.ts` — empty stub functions, never imported - `packages/api/src/utils/queue.ts` — unused utility class - `packages/app/src/Checkbox.tsx` — replaced by Mantine Checkbox, never imported - `packages/app/src/components/DBSearchPageFilters/index.ts` — dead barrel file (shadowed by sibling `.tsx`) - `packages/app/src/components/Sources/index.ts` — dead barrel file (all consumers import submodules directly) - `packages/app/src/components/WhereLanguageControlled.tsx` — unused component - `packages/app/src/TabBarWithContent.tsx` — unused component - `packages/app/src/vsc-dark-plus.ts` — unused Prism theme **Removed 14 unused dependencies** from `packages/api`, `packages/app`, and `packages/common-utils` (e.g. `semver`, `react-query`, `react-sortable-hoc`, `@microsoft/fetch-event-source`, `store2`, `uuid`, etc.) **Removed 17 unused devDependencies** across root, api, app, and common-utils (e.g. `@nx/workspace`, `@typescript-eslint/eslint-plugin`, `@typescript-eslint/parser`, `@types/semver`, `@types/react-table`, `rimraf`, `supertest`, `ts-node`, `tsc-alias`, `tsconfig-paths`, etc.) **Replaced `react-papaparse` with `papaparse`** — code imports `papaparse` directly, not the React wrapper. Added `@types/papaparse` since the package doesn't bundle its own types. **Cleaned up unused exports:** - Trimmed barrel files (`AppNav/index.ts`, `SearchInput/index.ts`) to only re-export what's actually consumed - Removed duplicate named exports where only the default export is used (`DBRowTableFieldWithPopover`, `DBRowTableRowButtons`) - Un-exported interfaces and constants that are only used locally (`DBRowTableFieldWithPopoverProps`, `DBRowTableIconButtonProps`, `DBRowTableRowButtonsProps`, `BASE_URL`, `makeHandler`) - Removed stale `supertest` from `allowModules` in `common-utils/eslint.config.mjs` ### How to test locally or on Vercel 1. `yarn install` — lockfile should resolve cleanly 2. `yarn workspace @hyperdx/common-utils ci:lint` — should pass (the only package where lint+tsc fully passes on this branch) 3. `npx knip` — should show reduced issue counts vs. main ### References - Related PRs: #1973 (knip CI workflow)
97 lines
2.8 KiB
JavaScript
97 lines
2.8 KiB
JavaScript
import js from '@eslint/js';
|
|
import tseslint from 'typescript-eslint';
|
|
import prettierConfig from 'eslint-config-prettier';
|
|
import prettierPlugin from 'eslint-plugin-prettier';
|
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
import nodePlugin from 'eslint-plugin-n';
|
|
import securityPlugin from 'eslint-plugin-security';
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
prettierConfig,
|
|
{
|
|
ignores: [
|
|
'node_modules/**',
|
|
'dist/**',
|
|
'coverage/**',
|
|
'**/*.config.js',
|
|
'**/*.config.mjs',
|
|
'jest.config.js',
|
|
'jest.setup.ts',
|
|
],
|
|
},
|
|
{
|
|
files: ['src/**/*.ts'],
|
|
plugins: {
|
|
'@typescript-eslint': tseslint.plugin,
|
|
'simple-import-sort': simpleImportSort,
|
|
prettier: prettierPlugin,
|
|
n: nodePlugin,
|
|
security: securityPlugin,
|
|
},
|
|
rules: {
|
|
...nodePlugin.configs.recommended.rules,
|
|
...securityPlugin.configs['recommended-legacy'].rules,
|
|
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
'@typescript-eslint/no-empty-interface': 'off',
|
|
'@typescript-eslint/no-empty-object-type': 'warn',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/no-floating-promises': 'error',
|
|
'@typescript-eslint/no-unsafe-type-assertion': 'error',
|
|
'@typescript-eslint/no-namespace': 'warn',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'warn',
|
|
{
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
'n/no-process-exit': 'warn',
|
|
'n/no-missing-import': 'off',
|
|
'n/no-unpublished-import': 'error',
|
|
'n/no-unsupported-features/es-syntax': [
|
|
'error',
|
|
{
|
|
ignores: ['modules'],
|
|
},
|
|
],
|
|
'prettier/prettier': 'error',
|
|
'simple-import-sort/imports': 'error',
|
|
'simple-import-sort/exports': 'error',
|
|
},
|
|
languageOptions: {
|
|
parser: tseslint.parser,
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
project: './tsconfig.json',
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
globals: {
|
|
console: 'readonly',
|
|
process: 'readonly',
|
|
module: 'readonly',
|
|
require: 'readonly',
|
|
__dirname: 'readonly',
|
|
__filename: 'readonly',
|
|
exports: 'readonly',
|
|
Buffer: 'readonly',
|
|
setTimeout: 'readonly',
|
|
clearTimeout: 'readonly',
|
|
setInterval: 'readonly',
|
|
clearInterval: 'readonly',
|
|
setImmediate: 'readonly',
|
|
clearImmediate: 'readonly',
|
|
global: 'readonly',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
// Disable unsafe type assertion rule for test files (mocking requires type assertions)
|
|
files: ['src/**/*.test.ts', 'src/**/__tests__/**/*.ts'],
|
|
rules: {
|
|
'@typescript-eslint/no-unsafe-type-assertion': 'off',
|
|
},
|
|
},
|
|
];
|