c3dd6b25a6
## What Many `oxlint-disable` / `eslint-disable` directives across the repo carry a corrupted rule id — `@typescripttypescript/<rule>` — most likely a find-and-replace accident that mangled the eslint-era `@typescript-eslint/` prefix. oxlint matches disable directives **loosely by rule name**, so these still suppress in practice (not a silent no-op), but the id is malformed and misleading. ## Change Replace them with the **canonical oxlint id** `typescript/<rule>` — matching the plugin name and rule keys declared in `.oxlintrc.json` — **127 files, 262 directives**: | rule | count | | --- | ----- | | `typescript/no-explicit-any` | 250 | | `typescript/ban-ts-comment` | 6 | | `typescript/no-misused-promises` | 4 | | `typescript/no-empty-object-type` | 2 | - `twenty-server`: 122 files - `twenty-front`: 5 files Comment-only — no code or runtime changes. ## Verification `oxlint --type-aware -c .oxlintrc.json` reports **0 warnings / 0 errors** for both `twenty-server` and `twenty-front`. Every changed line is exactly the id correction inside a disable directive (262 insertions / 262 deletions, no collateral edits). > Addresses the cubic review, which flagged that the canonical oxlint id is `typescript/...` (no `@`). Worth noting the original `@typescripttypescript/` was not actually a silent no-op — oxlint matches these directives loosely by rule name — but `typescript/` is the correct, config-aligned id.
28 lines
835 B
TypeScript
28 lines
835 B
TypeScript
import isObject from 'lodash.isobject';
|
|
import lodashCamelCase from 'lodash.camelcase';
|
|
import { type CamelCase, type CamelCasedPropertiesDeep } from 'type-fest';
|
|
|
|
export const camelCase = <T>(text: T) =>
|
|
lodashCamelCase(text as unknown as string) as CamelCase<T>;
|
|
|
|
export const camelCaseDeep = <T>(value: T): CamelCasedPropertiesDeep<T> => {
|
|
// Check if it's an array
|
|
if (Array.isArray(value)) {
|
|
return value.map(camelCaseDeep) as CamelCasedPropertiesDeep<T>;
|
|
}
|
|
|
|
// Check if it's an object
|
|
if (isObject(value)) {
|
|
// oxlint-disable-next-line typescript/no-explicit-any
|
|
const result: Record<string, any> = {};
|
|
|
|
for (const key in value) {
|
|
result[camelCase(key)] = camelCaseDeep(value[key]);
|
|
}
|
|
|
|
return result as CamelCasedPropertiesDeep<T>;
|
|
}
|
|
|
|
return value as CamelCasedPropertiesDeep<T>;
|
|
};
|