Migrate from ESLint to OxLint (#18443)

## Summary

Fully replaces ESLint with OxLint across the entire monorepo:

- **Replaced all ESLint configs** (`eslint.config.mjs`) with OxLint
configs (`.oxlintrc.json`) for every package: `twenty-front`,
`twenty-server`, `twenty-emails`, `twenty-ui`, `twenty-shared`,
`twenty-sdk`, `twenty-zapier`, `twenty-docs`, `twenty-website`,
`twenty-apps/*`, `create-twenty-app`
- **Migrated custom lint rules** from ESLint plugin format to OxLint JS
plugin system (`@oxlint/plugins`), including
`styled-components-prefixed-with-styled`, `no-hardcoded-colors`,
`sort-css-properties-alphabetically`,
`graphql-resolvers-should-be-guarded`,
`rest-api-methods-should-be-guarded`, `max-consts-per-file`, and
Jotai-related rules
- **Migrated custom rule tests** from ESLint `RuleTester` + Jest to
`oxlint/plugins-dev` `RuleTester` + Vitest
- **Removed all ESLint dependencies** from `package.json` files and
regenerated lockfiles
- **Updated Nx targets** (`lint`, `lint:diff-with-main`, `fmt`) in
`nx.json` and per-project `project.json` to use `oxlint` commands with
proper `dependsOn` for plugin builds
- **Updated CI workflows** (`.github/workflows/ci-*.yaml`) — no more
ESLint executor
- **Updated IDE setup**: replaced `dbaeumer.vscode-eslint` with
`oxc.oxc-vscode` extension, configured `source.fixAll.oxc` and
format-on-save with Prettier
- **Replaced all `eslint-disable` comments** with `oxlint-disable`
equivalents across the codebase
- **Updated docs** (`twenty-docs`) to reference OxLint instead of ESLint
- **Renamed** `twenty-eslint-rules` package to `twenty-oxlint-rules`

### Temporarily disabled rules (tracked in `OXLINT_MIGRATION_TODO.md`)

| Rule | Package | Violations | Auto-fixable |
|------|---------|-----------|-------------|
| `twenty/sort-css-properties-alphabetically` | twenty-front | 578 | Yes
|
| `typescript/consistent-type-imports` | twenty-server | 3814 | Yes |
| `twenty/max-consts-per-file` | twenty-server | 94 | No |

### Dropped plugins (no OxLint equivalent)

`eslint-plugin-project-structure`, `lingui/*`, `@stylistic/*`,
`import/order`, `prefer-arrow/prefer-arrow-functions`,
`eslint-plugin-mdx`, `@next/eslint-plugin-next`,
`eslint-plugin-storybook`, `eslint-plugin-react-refresh`. Partial
coverage for `jsx-a11y` and `unused-imports`.

### Additional fixes (pre-existing issues exposed by merge)

- Fixed `EmailThreadPreview.tsx` broken import from main rename
(`useOpenEmailThreadInSidePanel`)
- Restored truthiness guard in `getActivityTargetObjectRecords.ts`
- Fixed `AgentTurnResolver` return types to match entity (virtual
`fileMediaType`/`fileUrl` are resolved via `@ResolveField()`)

## Test plan

- [x] `npx nx lint twenty-front` passes
- [x] `npx nx lint twenty-server` passes
- [x] `npx nx lint twenty-docs` passes
- [x] Custom oxlint rules validated with Vitest: `npx nx test
twenty-oxlint-rules`
- [x] `npx nx typecheck twenty-front` passes
- [x] `npx nx typecheck twenty-server` passes
- [x] CI workflows trigger correctly with `dependsOn:
["twenty-oxlint-rules:build"]`
- [x] IDE linting works with `oxc.oxc-vscode` extension
This commit is contained in:
Charles Bochet
2026-03-06 01:03:50 +01:00
committed by GitHub
parent b421efbff7
commit 9d57bc39e5
880 changed files with 4711 additions and 9687 deletions
@@ -49,7 +49,7 @@ export class AdminPanelHealthService {
: AdminPanelHealthServiceStatus.OUTAGE;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
private transformServiceDetails(details: any) {
if (!details) return details;
@@ -1,11 +1,11 @@
export class HealthStateManager {
private lastKnownState: {
timestamp: Date;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
details: Record<string, any>;
} | null = null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
updateState(details: Record<string, any>) {
this.lastKnownState = {
timestamp: new Date(),
@@ -9,13 +9,13 @@ import { CreateAppTokenInput } from 'src/engine/core-modules/app-token/dtos/crea
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
export const appTokenAutoResolverOpts: AutoResolverOpts<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
any,
unknown,
unknown,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
ReadResolverOpts<any>,
PagingStrategies
>[] = [
@@ -11,7 +11,7 @@ export class BeforeCreateOneAppToken<T extends AppTokenEntity>
{
async run(
instance: CreateOneInputType<T>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
context: any,
): Promise<CreateOneInputType<T>> {
const userId = context?.req?.user?.id;
@@ -32,7 +32,7 @@ export const copyYarnEngineAndBuildDependencies = async (
env: cleanEnv,
},
);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
} catch (error: any) {
const errorMessage =
[error?.stdout, error?.stderr].filter(Boolean).join('\n') ||
@@ -32,6 +32,6 @@ export class CreateObjectEventInput {
@Field(() => GraphQLJSON, { nullable: true })
@IsObject()
@IsOptional()
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
properties?: Record<string, any>;
}
@@ -11,7 +11,7 @@ export const genericTrackSchema = baseEventSchema.extend({
export type GenericTrackEvent<E extends string = string> = {
type: 'track';
event: E;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
properties: any;
timestamp: string;
version: string;
@@ -19,10 +19,10 @@ export type GenericTrackEvent<E extends string = string> = {
workspaceId?: string;
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
export const eventsRegistry = new Map<string, z.ZodSchema<any>>();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
export function registerEvent<E extends string, S extends z.ZodObject<any>>(
event: E,
schema: S,
@@ -62,7 +62,7 @@ export class SSOAuthController {
PublicEndpointGuard,
NoPermissionGuard,
)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
async generateMetadata(@Req() req: any): Promise<string | void> {
return generateServiceProviderMetadata({
wantAssertionsSigned: true,
@@ -26,7 +26,7 @@ export class OIDCAuthGuard extends AuthGuard('openidconnect') {
super();
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
private getStateByRequest(request: any): {
identityProviderId: string;
} {
@@ -71,7 +71,7 @@ import { workspaceValidator } from 'src/engine/core-modules/workspace/workspace.
import { PermissionsService } from 'src/engine/metadata-modules/permissions/permissions.service';
@Injectable()
// eslint-disable-next-line twenty/inject-workspace-repository
// oxlint-disable-next-line twenty/inject-workspace-repository
export class AuthService {
constructor(
private readonly accessTokenService: AccessTokenService,
@@ -48,7 +48,7 @@ import { isWorkEmail } from 'src/utils/is-work-email';
import { TelemetryEventType } from 'src/engine/core-modules/telemetry/telemetry-event.type';
@Injectable()
// eslint-disable-next-line twenty/inject-workspace-repository
// oxlint-disable-next-line twenty/inject-workspace-repository
export class SignInUpService {
constructor(
@InjectRepository(UserEntity)
@@ -19,7 +19,7 @@ export class GoogleAPIsOauthRequestCodeStrategy extends GoogleAPIsOauthCommonStr
super(twentyConfigService, isDraftEmailEnabled);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
authenticate(req: any, options: any) {
options = {
...options,
@@ -48,7 +48,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
});
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
authenticate(req: Request, options: any) {
options = {
...options,
@@ -11,7 +11,7 @@ export class MicrosoftAPIsOauthRequestCodeStrategy extends MicrosoftAPIsOauthCom
super(twentyConfigService);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
authenticate(req: any, options: any) {
options = {
...options,
@@ -47,7 +47,7 @@ export class MicrosoftStrategy extends PassportStrategy(Strategy, 'microsoft') {
});
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
authenticate(req: Request, options: any) {
options = {
...options,
@@ -45,7 +45,7 @@ export class OIDCAuthStrategy extends PassportStrategy(
});
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
async authenticate(req: Request, options: any) {
return super.authenticate(req, {
...options,
@@ -85,7 +85,7 @@ export class OIDCAuthStrategy extends PassportStrategy(
async validate(
req: Request,
tokenset: TokenSet,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
done: (err: any, user?: OIDCRequest['user']) => void,
) {
try {
@@ -38,7 +38,7 @@ import {
} from 'src/engine/workspace-manager/workspace-cleaner/jobs/clean-workspace-deletion-warning-user-vars.job';
@Injectable()
// eslint-disable-next-line twenty/inject-workspace-repository
// oxlint-disable-next-line twenty/inject-workspace-repository
export class BillingWebhookSubscriptionService {
protected readonly logger = new Logger(
BillingWebhookSubscriptionService.name,
@@ -16,7 +16,7 @@ export const WithLock = (
const originalMethod = descriptor.value;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
descriptor.value = async function (...args: any[]) {
const self = this as { cacheLockService: CacheLockService };
@@ -34,9 +34,9 @@ export class CacheStorageModule implements OnModuleDestroy {
constructor(@Inject(CACHE_MANAGER) private cacheManager: Cache) {}
async onModuleDestroy() {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
if ((this.cacheManager.store as any)?.name === 'redis') {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
await (this.cacheManager.store as any).client.quit();
}
}
@@ -306,7 +306,7 @@ export class CacheStorageService {
}
private isRedisCache() {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
return (this.cache.store as any)?.name === 'redis';
}
@@ -18,7 +18,7 @@ export class CaptchaModule {
provide: CAPTCHA_DRIVER,
useFactory: async (
secureHttpClientService: SecureHttpClientService,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
...args: any[]
) => {
const config = await options.useFactory(...args);
@@ -31,7 +31,7 @@ export type CaptchaModuleOptions =
export type CaptchaModuleAsyncOptions = {
useFactory: (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
...args: any[]
) => CaptchaModuleOptions | Promise<CaptchaModuleOptions> | undefined;
} & Pick<ModuleMetadata, 'imports'> &
@@ -2,14 +2,14 @@ import * as Sentry from '@sentry/node';
export function SentryCronMonitor(monitorSlug: string, schedule: string) {
return function (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
_target: any,
_propertyKey: string,
descriptor: PropertyDescriptor,
) {
const originalMethod = descriptor.value;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
descriptor.value = async function (...args: any[]) {
if (!Sentry.isInitialized()) {
return await originalMethod.apply(this, args);
@@ -74,7 +74,7 @@ export const objectRecordChangedValues = (
return acc;
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
{} as Record<string, { before: any; after: any }>,
);
};
@@ -1,11 +1,11 @@
export function objectRecordDiffMerge(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
oldRecord: Record<string, any>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
newRecord: Record<string, any>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
): Record<string, any> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
const result: Record<string, any> = { diff: {} };
// Iterate over the keys in the oldRecord diff
@@ -1,4 +1,4 @@
/* eslint-disable no-console */
/* oxlint-disable no-console */
import { type ExceptionHandlerOptions } from 'src/engine/core-modules/exception-handler/interfaces/exception-handler-options.interface';
import { type ExceptionHandlerDriverInterface } from 'src/engine/core-modules/exception-handler/interfaces';
@@ -7,7 +7,7 @@ export class ExceptionHandlerConsoleDriver
implements ExceptionHandlerDriverInterface
{
captureExceptions(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
exceptions: ReadonlyArray<any>,
options?: ExceptionHandlerOptions,
) {
@@ -16,7 +16,7 @@ export class ExceptionHandlerSentryDriver
implements ExceptionHandlerDriverInterface
{
captureExceptions(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
exceptions: ReadonlyArray<any>,
options?: ExceptionHandlerOptions,
) {
@@ -37,7 +37,7 @@ export class ExceptionHandlerModule extends ConfigurableModuleClass {
static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule {
const provider = {
provide: EXCEPTION_HANDLER_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
useFactory: async (...args: any[]) => {
const config = await options?.useFactory?.(...args);
@@ -13,7 +13,7 @@ export class ExceptionHandlerService {
) {}
captureExceptions(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
exceptions: ReadonlyArray<any>,
options?: ExceptionHandlerOptions,
): string[] {
@@ -2,7 +2,7 @@ import { type ExceptionHandlerOptions } from 'src/engine/core-modules/exception-
export interface ExceptionHandlerDriverInterface {
captureExceptions(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
exceptions: ReadonlyArray<any>,
options?: ExceptionHandlerOptions,
): string[];
@@ -9,7 +9,7 @@ export interface ExceptionHandlerOptions {
name: string;
};
document?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
additionalData?: Record<string, any>;
user?: ExceptionHandlerUser | null;
workspace?: ExceptionHandlerWorkspace | null;
@@ -9,7 +9,7 @@ export class ExceptionHandlerMockService
implements ExceptionHandlerDriverInterface
{
captureExceptions(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
exceptions: readonly any[],
_?: ExceptionHandlerOptions | undefined,
): string[] {
@@ -10,7 +10,7 @@ export class MockedUnhandledExceptionFilter
extends BaseExceptionFilter
implements ExceptionFilter
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
catch(exception: any, _host: ArgumentsHost) {
throw exception;
}
@@ -89,7 +89,7 @@ export class FileController {
@Param('fileFolder') fileFolder: SupportedFileFolder,
@Param('id') fileId: string,
) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
const workspaceId = (req as any)?.workspaceId;
try {
@@ -42,7 +42,7 @@ export class ResolverValidationPipe implements PipeTransform {
throw new UserInputError(errorMessage);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
private toValidate(metatype: Type<any>): boolean {
const types: unknown[] = [String, Boolean, Number, Array, Object];
@@ -41,7 +41,7 @@ type RestrictedGraphQLErrorExtensions = {
};
export class BaseGraphQLError extends GraphQLError {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
public extensions: Record<string, any>;
override readonly name!: string;
readonly locations: ReadonlyArray<SourceLocation> | undefined;
@@ -51,12 +51,12 @@ export class BaseGraphQLError extends GraphQLError {
readonly nodes: ReadonlyArray<ASTNode> | undefined;
public originalError: Error | undefined;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
[key: string]: any;
constructor(
exceptionOrMessage: string | CustomException,
code?: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
extensions?: Record<string, any>,
) {
if (exceptionOrMessage instanceof CustomException) {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -34,7 +34,7 @@ export class JwtWrapperService {
return this.jwtService.sign(payload, options);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
verify<T extends object = any>(
token: string,
options?: { secret: string },
@@ -42,7 +42,7 @@ export class JwtWrapperService {
return this.jwtService.verify(token, options);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
decode<T = any>(payload: string, options?: jwt.DecodeOptions): T {
return this.jwtService.decode(payload, options);
}
@@ -8,7 +8,7 @@ import {
} from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
export class KeyValuePairService<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
KeyValueTypesMap extends Record<string, any> = Record<string, any>,
> {
constructor(
@@ -39,7 +39,7 @@ export class LoggerModule extends ConfigurableModuleClass {
static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule {
const provider = {
provide: LOGGER_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
useFactory: async (...args: any[]) => {
const config = await options?.useFactory?.(...args);
@@ -18,12 +18,12 @@ type LoggerDriverType = ConsoleLogger & {
export class LoggerService implements LoggerServiceInterface {
constructor(@Inject(LOGGER_DRIVER) private driver: LoggerDriverType) {}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
log(message: any, category: string, ...optionalParams: any[]) {
this.driver.log.apply(this.driver, [message, category, ...optionalParams]);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
error(message: any, category: string, ...optionalParams: any[]) {
this.driver.error.apply(this.driver, [
message,
@@ -32,12 +32,12 @@ export class LoggerService implements LoggerServiceInterface {
]);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
warn(message: any, category: string, ...optionalParams: any[]) {
this.driver.warn.apply(this.driver, [message, category, ...optionalParams]);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
debug?(message: any, category: string, ...optionalParams: any[]) {
this.driver.debug?.apply(this.driver, [
message,
@@ -46,7 +46,7 @@ export class LoggerService implements LoggerServiceInterface {
]);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
verbose?(message: any, category: string, ...optionalParams: any[]) {
this.driver.verbose?.apply(this.driver, [
message,
@@ -61,14 +61,14 @@ export class LoggerService implements LoggerServiceInterface {
time(category: string, label: string) {
if (this.driver.options.logLevels?.includes('debug')) {
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
console.time(`[${category}] ${label}`);
}
}
timeEnd(category: string, label: string) {
if (this.driver.options.logLevels?.includes('debug')) {
// eslint-disable-next-line no-console
// oxlint-disable-next-line no-console
console.timeEnd(`[${category}] ${label}`);
}
}
@@ -6,7 +6,7 @@ export const handler = async (event) => {
const mainPath = `/tmp/${randomId}.mjs`;
// eslint-disable-next-line no-undef
// oxlint-disable-next-line no-undef
const oldProcessEnv = { ...process.env };
try {
@@ -14,7 +14,7 @@ export const handler = async (event) => {
await fs.writeFile(mainPath, code, 'utf8');
// eslint-disable-next-line no-undef
// oxlint-disable-next-line no-undef
process.env = { ...process.env, ...(env ?? {}) };
const mainFile = await import(mainPath);
@@ -26,7 +26,7 @@ export const handler = async (event) => {
return await handlerFn(params);
} finally {
await fs.rm(mainPath, { force: true });
// eslint-disable-next-line no-undef
// oxlint-disable-next-line no-undef
process.env = oldProcessEnv;
}
};
@@ -63,7 +63,7 @@ export type LogicFunctionModuleOptions =
export type LogicFunctionModuleAsyncOptions = {
useFactory: (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
...args: any[]
) => LogicFunctionModuleOptions | Promise<LogicFunctionModuleOptions>;
} & Pick<ModuleMetadata, 'imports'> &
@@ -15,7 +15,7 @@ export class LogicFunctionDriversModule {
static forRootAsync(options: LogicFunctionModuleAsyncOptions): DynamicModule {
const provider = {
provide: LOGIC_FUNCTION_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
useFactory: async (...args: any[]) => {
const config = await options.useFactory(...args);
@@ -1,4 +1,4 @@
/* eslint-disable no-console */
/* oxlint-disable no-console */
export class ConsoleListener {
private readonly originalConsole;
@@ -12,11 +12,11 @@ export class ConsoleListener {
};
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
intercept(callback: (type: string, message: any[]) => void) {
Object.keys(this.originalConsole).forEach((method) => {
// @ts-expect-error legacy noImplicitAny
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
console[method] = (...args: any[]) => {
callback(method, args);
};
@@ -26,7 +26,7 @@ export class ConsoleListener {
release() {
Object.keys(this.originalConsole).forEach((method) => {
// @ts-expect-error legacy noImplicitAny
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
console[method] = (...args: any[]) => {
// @ts-expect-error legacy noImplicitAny
this.originalConsole[method](...args);
@@ -206,7 +206,7 @@ export class LogicFunctionExecutorService {
flatApplication: FlatApplication;
}) {
if (this.twentyConfigService.get('LOGIC_FUNCTION_LOGS_ENABLED')) {
/* eslint-disable no-console */
/* oxlint-disable no-console */
console.log(result.logs);
}
@@ -38,7 +38,7 @@ export class SyncDriver implements MessageQueueDriver {
id: '',
name: jobName,
// TODO: Fix this type issue
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
data: data as any,
});
}
@@ -1,4 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
export interface MessageQueueJob<T = any> {
id: string;
name: string;
@@ -12,6 +12,6 @@ export interface MessageQueueCronJobData<
}
export interface MessageQueueJobData {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
[key: string]: any;
}
@@ -14,7 +14,7 @@ export interface BullMQDriverFactoryOptions {
export interface SyncDriverFactoryOptions {
type: MessageQueueDriverType.Sync;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
options: Record<string, any>;
}
@@ -62,7 +62,7 @@ export class MessageQueueCoreModule extends ConfigurableModuleClass {
const driverProvider: Provider = {
provide: QUEUE_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
useFactory: async (...args: any[]) => {
if (options.useFactory) {
const config = await options.useFactory(...args);
@@ -151,10 +151,10 @@ export class TimelineMessagingService {
person: {
id: threadParticipant.person?.id,
name: {
//eslint-disable-next-line
//oxlint-disable-next-line
//@ts-ignore
firstName: threadParticipant.person?.nameFirstName,
//eslint-disable-next-line
//oxlint-disable-next-line
//@ts-ignore
lastName: threadParticipant.person?.nameLastName,
},
@@ -163,10 +163,10 @@ export class TimelineMessagingService {
workspaceMember: {
id: threadParticipant.workspaceMember?.id,
name: {
//eslint-disable-next-line
//oxlint-disable-next-line
//@ts-ignore
firstName: threadParticipant.workspaceMember?.nameFirstName,
//eslint-disable-next-line
//oxlint-disable-next-line
//@ts-ignore
lastName: threadParticipant.workspaceMember?.nameLastName,
},
@@ -1,2 +1,2 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
export type ObjectRecordProperties = Record<string, any>;
@@ -26,14 +26,14 @@ export type DeleteRecordInput = {
export type FindRecordsInput = {
objectName: string;
filter?: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
recordFilterGroups?: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
recordFilters?: any;
gqlOperationFilter?: Partial<ObjectRecordFilter>[];
};
orderBy?: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
recordSorts?: any;
gqlOperationOrderBy?: Partial<ObjectRecordOrderBy>;
};
@@ -65,9 +65,9 @@ export class RecordInputTransformerService {
private async transformFieldValue(
fieldType: FieldMetadataType,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
value: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
): Promise<any> {
if (!isDefined(value)) {
return value;
@@ -95,7 +95,7 @@ export class RecordInputTransformerService {
}
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
private stringifySubFields(fieldMetadataType: FieldMetadataType, value: any) {
const compositeType = compositeTypeDefinitions.get(fieldMetadataType);
@@ -124,7 +124,7 @@ export class RecordInputTransformerService {
);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
private parseSubFields(fieldMetadataType: FieldMetadataType, value: any) {
const compositeType = compositeTypeDefinitions.get(fieldMetadataType);
@@ -133,7 +133,7 @@ export class RecordInputTransformerService {
}
return Object.entries(value).reduce(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
(acc, [subFieldName, subFieldValue]: [string, any]) => {
const subFieldType = compositeType.properties.find(
(property) => property.name === subFieldName,
@@ -2,9 +2,9 @@ import { isNonEmptyArray, isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'class-validator';
export const transformEmailsValue = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
value: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
): any => {
if (!isDefined(value)) {
return value;
@@ -30,7 +30,7 @@ const getServerBlockNoteEditor = async (): Promise<ServerBlockNoteEditor> => {
};
export const transformRichTextV2Value = async (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
richTextValue: any,
): Promise<RichTextV2Metadata> => {
const parsedValue = isNonEmptyString(richTextValue)
@@ -13,7 +13,7 @@ import {
export class IsX509CertificateConstraint
implements ValidatorConstraintInterface
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
validate(value: any) {
if (typeof value !== 'string') {
return false;
@@ -76,7 +76,7 @@ export class ConfigValueConverterService {
return appValue;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
return transformer.toStorage(appValue as any, options);
} catch (error) {
if (error instanceof ConfigVariableException) {
@@ -5,11 +5,11 @@ import {
} from 'class-validator';
export const AssertOrWarn = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
condition: (object: any, value: any) => boolean,
validationOptions?: ValidationOptions,
) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
return function (object: any, propertyName: string) {
registerDecorator({
name: 'AssertOrWarn',
@@ -21,7 +21,7 @@ export const AssertOrWarn = (
},
constraints: [condition],
validator: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
validate(value: any, args: ValidationArguments) {
return condition(args.object, value);
},
@@ -3,7 +3,7 @@ import { Transform } from 'class-transformer';
export const CastToLogLevelArray = () =>
Transform(({ value }: { value: string }) => toLogLevelArray(value));
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
const toLogLevelArray = (value: any) => {
if (typeof value === 'string') {
const rawLogLevels = value.split(',').map((level) => level.trim());
@@ -4,7 +4,7 @@ import { isNonEmptyString } from '@sniptt/guards';
export const CastToTypeORMLogLevelArray = () =>
Transform(({ value }: { value: string }) => toTypeORMLogLevelArray(value));
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
const toTypeORMLogLevelArray = (value: any) => {
if (isNonEmptyString(value)) {
const rawLogLevels = value.split(',').map((level) => level.trim());
@@ -16,10 +16,10 @@ export const IsStrictlyLowerThan = (
constraints: [property],
options: validationOptions,
validator: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
validate(value: any, args: ValidationArguments) {
const [relatedPropertyName] = args.constraints;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
const relatedValue = (args.object as any)[relatedPropertyName];
return (
@@ -48,11 +48,11 @@ export class ConfigStorageService implements ConfigStorageInterface {
}
private async convertAndSecureValue<T extends keyof ConfigVariables>(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
value: any,
key: T,
isDecrypt = false,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
): Promise<any> {
try {
const convertedValue = isDecrypt
@@ -242,9 +242,9 @@ export class TwentyConfigService {
private maskSensitiveValue<T extends keyof ConfigVariables>(
key: T,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
value: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
): any {
if (!isString(value) || !(key in CONFIG_VARIABLES_MASKING_CONFIG)) {
return value;
@@ -27,7 +27,7 @@ export interface TypeTransformer<T> {
export const typeTransformers: Record<
ConfigVariableType,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
TypeTransformer<any>
> = {
[ConfigVariableType.BOOLEAN]: {
@@ -29,7 +29,7 @@ import { OTPStatus } from './strategies/otp/otp.constants';
const PENDING_METHOD_REUSE_WINDOW_MS = 60 * 60 * 1000;
@Injectable()
// eslint-disable-next-line twenty/inject-workspace-repository
// oxlint-disable-next-line twenty/inject-workspace-repository
export class TwoFactorAuthenticationService {
constructor(
@InjectRepository(TwoFactorAuthenticationMethodEntity)
@@ -42,7 +42,7 @@ import { GlobalWorkspaceOrmManager } from 'src/engine/twenty-orm/global-workspac
import { buildSystemAuthContext } from 'src/engine/twenty-orm/utils/build-system-auth-context.util';
import { WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
// eslint-disable-next-line twenty/inject-workspace-repository
// oxlint-disable-next-line twenty/inject-workspace-repository
export class UserService extends TypeOrmQueryService<UserEntity> {
constructor(
@InjectRepository(UserEntity)
@@ -8,7 +8,7 @@ import { mergeUserVars } from 'src/engine/core-modules/user/user-vars/utils/merg
@Injectable()
export class UserVarsService<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
KeyValueTypesMap extends Record<string, any> = Record<string, any>,
> {
constructor(private readonly keyValuePairService: KeyValuePairService) {}
@@ -22,7 +22,7 @@ export class UserVarsService<
workspaceId?: string;
key: Extract<K, string>;
}): Promise<KeyValueTypesMap[K]> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
let userVarWorkspaceLevel: any[] = [];
if (workspaceId) {
@@ -40,7 +40,7 @@ export class UserVarsService<
);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
let userVarUserLevel: any[] = [];
if (userId) {
@@ -56,7 +56,7 @@ export class UserVarsService<
throw new Error(`Multiple values found for key ${key} at user level`);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
let userVarWorkspaceAndUserLevel: any[] = [];
if (userId && workspaceId) {
@@ -87,9 +87,9 @@ export class UserVarsService<
}: {
userId?: string;
workspaceId?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
}): Promise<Map<Extract<keyof KeyValueTypesMap, string>, any>> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
let result: any[] = [];
if (userId) {
@@ -8,13 +8,13 @@ import { UserEntity } from 'src/engine/core-modules/user/user.entity';
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
export const userAutoResolverOpts: AutoResolverOpts<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
any,
unknown,
unknown,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line @typescripttypescript/no-explicit-any
ReadResolverOpts<any>,
PagingStrategies
>[] = [
@@ -63,7 +63,7 @@ import { DEFAULT_FEATURE_FLAGS } from 'src/engine/workspace-manager/workspace-mi
import { extractVersionMajorMinorPatch } from 'src/utils/version/extract-version-major-minor-patch';
@Injectable()
// eslint-disable-next-line twenty/inject-workspace-repository
// oxlint-disable-next-line twenty/inject-workspace-repository
export class WorkspaceService extends TypeOrmQueryService<WorkspaceEntity> {
protected readonly logger = new Logger(WorkspaceService.name);

Some files were not shown because too many files have changed in this diff Show More