fix: use canonical oxlint rule id in lint-disable directives (#21253)
## 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.
This commit is contained in:
+9
-9
@@ -74,7 +74,7 @@ type PermissionOptions = {
|
||||
};
|
||||
|
||||
export class WorkspaceEntityManager extends EntityManager {
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
readonly repositories: Map<string, Repository<any>>;
|
||||
declare connection: GlobalWorkspaceDataSource;
|
||||
|
||||
@@ -428,7 +428,7 @@ export class WorkspaceEntityManager extends EntityManager {
|
||||
if (isNaN(Number(value)))
|
||||
throw new TypeORMError(`Value "${value}" is not a number.`);
|
||||
// convert possible embeded path "social.likes" into object { social: { like: () => value } }
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
const values = propertyPath.split('.').reduceRight<any>(
|
||||
(value, key) => ({ [key]: value }),
|
||||
() => this.connection.driver.escape(column.databaseName) + ' + ' + value,
|
||||
@@ -487,7 +487,7 @@ export class WorkspaceEntityManager extends EntityManager {
|
||||
return this.connection.getMetadata(target).name;
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
private extractTargetNameSingularFromEntity(entity: any): string {
|
||||
return this.connection.getMetadata(entity.constructor).name;
|
||||
}
|
||||
@@ -1040,7 +1040,7 @@ export class WorkspaceEntityManager extends EntityManager {
|
||||
);
|
||||
if (isNaN(Number(value)))
|
||||
throw new TypeORMError(`Value "${value}" is not a number.`);
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
const values = propertyPath.split('.').reduceRight<any>(
|
||||
(value, key) => ({ [key]: value }),
|
||||
() => this.connection.driver.escape(column.databaseName) + ' - ' + value,
|
||||
@@ -1280,7 +1280,7 @@ export class WorkspaceEntityManager extends EntityManager {
|
||||
)
|
||||
.execute()
|
||||
.then(() => formattedEntityOrEntities as Entity[])
|
||||
// oxlint-disable-next-line @typescripttypescript/no-misused-promises
|
||||
// oxlint-disable-next-line typescript/no-misused-promises
|
||||
.finally(() => queryRunnerForEntityPersistExecutor.release());
|
||||
|
||||
if (isDefined(filesFieldFileIds)) {
|
||||
@@ -1501,7 +1501,7 @@ export class WorkspaceEntityManager extends EntityManager {
|
||||
)
|
||||
.execute()
|
||||
.then(() => formattedEntity as Entity | Entity[])
|
||||
// oxlint-disable-next-line @typescripttypescript/no-misused-promises
|
||||
// oxlint-disable-next-line typescript/no-misused-promises
|
||||
.finally(() => queryRunnerForEntityPersistExecutor.release());
|
||||
|
||||
const formattedResult = formatResult<Entity[]>(
|
||||
@@ -1650,7 +1650,7 @@ export class WorkspaceEntityManager extends EntityManager {
|
||||
)
|
||||
.execute()
|
||||
.then(() => formattedEntity as Entity)
|
||||
// oxlint-disable-next-line @typescripttypescript/no-misused-promises
|
||||
// oxlint-disable-next-line typescript/no-misused-promises
|
||||
.finally(() => queryRunnerForEntityPersistExecutor.release());
|
||||
|
||||
const formattedResult = formatResult<Entity[]>(
|
||||
@@ -1800,7 +1800,7 @@ export class WorkspaceEntityManager extends EntityManager {
|
||||
)
|
||||
.execute()
|
||||
.then(() => formattedEntity as Entity)
|
||||
// oxlint-disable-next-line @typescripttypescript/no-misused-promises
|
||||
// oxlint-disable-next-line typescript/no-misused-promises
|
||||
.finally(() => queryRunnerForEntityPersistExecutor.release());
|
||||
|
||||
const formattedResult = formatResult<Entity[]>(
|
||||
@@ -1834,7 +1834,7 @@ export class WorkspaceEntityManager extends EntityManager {
|
||||
|
||||
// Forbidden methods
|
||||
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
override query<T = any>(_query: string, _parameters?: any[]): Promise<T> {
|
||||
throw new PermissionsException(
|
||||
'Method not allowed.',
|
||||
|
||||
+7
-7
@@ -116,7 +116,7 @@ export class GlobalWorkspaceDataSource extends DataSource {
|
||||
|
||||
Object.assign(queryRunner, { manager: manager });
|
||||
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
return queryRunner as any as WorkspaceQueryRunner;
|
||||
}
|
||||
|
||||
@@ -181,17 +181,17 @@ export class GlobalWorkspaceDataSource extends DataSource {
|
||||
|
||||
override createQueryBuilder(
|
||||
queryRunner?: QueryRunner,
|
||||
options?: CreateQueryBuilderOptions, // oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
options?: CreateQueryBuilderOptions, // oxlint-disable-next-line typescript/no-explicit-any
|
||||
): SelectQueryBuilder<any>;
|
||||
|
||||
// Only callable from workspaceEntityManager to guarantee a permission check was run
|
||||
override createQueryBuilder(
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
queryRunnerOrEntityClass?: QueryRunner | EntityTarget<any>,
|
||||
aliasOrOptions?: string | CreateQueryBuilderOptions,
|
||||
queryRunner?: QueryRunner,
|
||||
options?: CreateQueryBuilderOptions,
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
): SelectQueryBuilder<any> {
|
||||
let calledByWorkspaceEntityManager;
|
||||
|
||||
@@ -214,7 +214,7 @@ export class GlobalWorkspaceDataSource extends DataSource {
|
||||
}
|
||||
|
||||
if (isCalledWithEntityTarget) {
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
const entityClass = queryRunnerOrEntityClass as EntityTarget<any>;
|
||||
|
||||
return super.createQueryBuilder(
|
||||
@@ -229,10 +229,10 @@ export class GlobalWorkspaceDataSource extends DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
override query<T = any>(
|
||||
query: string,
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
parameters?: any[],
|
||||
queryRunner?: QueryRunner,
|
||||
options?: {
|
||||
|
||||
+3
-3
@@ -71,7 +71,7 @@ export class WorkspaceSelectQueryBuilder<
|
||||
return workspaceSelectQueryBuilder;
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
override async execute(): Promise<any> {
|
||||
try {
|
||||
this.validatePermissions();
|
||||
@@ -132,7 +132,7 @@ export class WorkspaceSelectQueryBuilder<
|
||||
}
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
override async getRawOne<U = any>(): Promise<U | undefined> {
|
||||
try {
|
||||
this.validatePermissions();
|
||||
@@ -143,7 +143,7 @@ export class WorkspaceSelectQueryBuilder<
|
||||
}
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
override async getRawMany<U = any>(): Promise<U[]> {
|
||||
try {
|
||||
this.validatePermissions();
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ const parseKeyFilter = ({
|
||||
outerQueryBuilder: WorkspaceSelectQueryBuilder<ObjectLiteral>;
|
||||
objectNameSingular: string;
|
||||
key: string;
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
value: any;
|
||||
isFirst: boolean;
|
||||
fieldParser: GraphqlQueryFilterFieldParser;
|
||||
|
||||
@@ -40,7 +40,7 @@ export function formatData<T>(
|
||||
|
||||
const { fieldIdByName, fieldIdByJoinColumnName } = fieldMaps;
|
||||
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
const newData: Record<string, any> = {};
|
||||
|
||||
for (const [key, value] of Object.entries(data)) {
|
||||
@@ -73,10 +73,10 @@ export function formatData<T>(
|
||||
}
|
||||
|
||||
export function formatCompositeField(
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
value: any,
|
||||
fieldMetadata: FlatFieldMetadata,
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
): Record<string, any> {
|
||||
const compositeType = compositeTypeDefinitions.get(
|
||||
fieldMetadata.type as CompositeFieldMetadataType,
|
||||
@@ -88,7 +88,7 @@ export function formatCompositeField(
|
||||
);
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
const formattedCompositeField: Record<string, any> = {};
|
||||
|
||||
for (const property of compositeType.properties) {
|
||||
@@ -107,7 +107,7 @@ export function formatCompositeField(
|
||||
}
|
||||
|
||||
function formatFieldMetadataValue(
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
value: any,
|
||||
fieldMetadata: FlatFieldMetadata,
|
||||
) {
|
||||
|
||||
@@ -27,7 +27,7 @@ import { getCompositeFieldMetadataCollection } from 'src/engine/twenty-orm/utils
|
||||
import { isFieldMetadataEntityOfType } from 'src/engine/utils/is-field-metadata-of-type.util';
|
||||
|
||||
export function formatResult<T>(
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
data: any,
|
||||
flatObjectMetadata: FlatObjectMetadata | undefined,
|
||||
flatObjectMetadataMaps: FlatEntityMaps<FlatObjectMetadata>,
|
||||
@@ -246,7 +246,7 @@ export function getCompositeFieldMetadataMap(
|
||||
}
|
||||
|
||||
function formatFieldMetadataValue(
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
value: any,
|
||||
fieldMetadataType: FieldMetadataType,
|
||||
) {
|
||||
@@ -321,7 +321,7 @@ function formatCompositeFieldValue(
|
||||
* or records with incomplete data.
|
||||
*/
|
||||
function handleEmptyCompositeFields(
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
data: Record<string, any>,
|
||||
flatObjectMetadata: FlatObjectMetadata,
|
||||
flatFieldMetadataMaps: FlatEntityMaps<FlatFieldMetadata>,
|
||||
@@ -344,7 +344,7 @@ function handleEmptyCompositeFields(
|
||||
continue;
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
const typedFieldValue = fieldValue as Record<string, any>;
|
||||
|
||||
// Check if all required properties are null/undefined
|
||||
@@ -377,7 +377,7 @@ function handleEmptyCompositeFields(
|
||||
*/
|
||||
function getDefaultCompositeFieldValue(
|
||||
fieldType: FieldMetadataType,
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
): Record<string, any> | null {
|
||||
switch (fieldType) {
|
||||
case FieldMetadataType.ACTOR:
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ export const isRecordMatchingRLSRowLevelPermissionPredicate = ({
|
||||
flatFieldMetadataMaps,
|
||||
shouldIgnoreSoftDeleteDefaultFilter,
|
||||
}: {
|
||||
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
record: any;
|
||||
filter: RecordGqlOperationFilter;
|
||||
flatObjectMetadata: FlatObjectMetadata;
|
||||
|
||||
Reference in New Issue
Block a user