Skip to content

Commit

Permalink
Delete eslint overrides (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoncool authored Dec 2, 2024
1 parent e6315b9 commit 32387c5
Show file tree
Hide file tree
Showing 213 changed files with 944 additions and 754 deletions.
12 changes: 1 addition & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,5 @@
"node": true,
"jest": true
},
"root": true,
"overrides": [
{
"files": ["*.ts"],
"rules": {
"@typescript-eslint/member-ordering": [0],
"import/order": [0],
"sort-imports": [0]
}
}
]
"root": true
}
1 change: 1 addition & 0 deletions src/components/app-context.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {NodeKit} from '@gravity-ui/nodekit';

import type {Registry} from '../registry';

export function setRegistryToContext<R extends Registry>(nodekit: NodeKit, registry: R) {
Expand Down
4 changes: 3 additions & 1 deletion src/components/error-response-presenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// However the types described there are incorrect: const DBError: typeof dbErrors.DBError;
// Due to incorrect types Typescript casts DBError as a constant.
// DBError cannot be used as a type and typeof DBError does not infer the original type
import {DBError} from 'db-errors';
import {AppError} from '@gravity-ui/nodekit';
import {DBError} from 'db-errors';

import US_ERRORS from '../const/us-error-constants';

const PG_ERRORS = require('pg-error-constants');

function getDBErrorCode(error: DBError): string {
Expand Down
7 changes: 4 additions & 3 deletions src/components/gateway/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {NodeKit, AppError, AppContext} from '@gravity-ui/nodekit';
import {Request, Response} from '@gravity-ui/expresskit';
import {GatewayConfig, Headers as DebugHeaders, GatewayError} from '@gravity-ui/gateway';
import {Headers as DebugHeaders, GatewayConfig, GatewayError} from '@gravity-ui/gateway';
import {AppContext, AppError, NodeKit} from '@gravity-ui/nodekit';

import {IPV6_AXIOS_OPTIONS} from '../../utils/axios';
import {isEnabledFeature, Feature} from '../features';
import {Feature, isEnabledFeature} from '../features';

export const getGatewayConfig = (
nodekit: NodeKit,
Expand Down
6 changes: 4 additions & 2 deletions src/components/middlewares/auth-zitadel.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {NextFunction, Request, Response} from '@gravity-ui/expresskit';
import {introspect} from '../../utils/zitadel';
import {IncomingHttpHeaders} from 'http';

import {NextFunction, Request, Response} from '@gravity-ui/expresskit';

import {DL_AUTH_HEADER_KEY, DL_SERVICE_USER_ACCESS_TOKEN} from '../../const';
import {ZitadelServiceUser} from '../../types/zitadel';
import {introspect} from '../../utils/zitadel';

export const authZitadel = async (req: Request, res: Response, next: NextFunction) => {
const {ctx} = req;
Expand Down
3 changes: 2 additions & 1 deletion src/components/middlewares/check-read-only-mode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Request, Response, NextFunction} from '@gravity-ui/expresskit';
import {NextFunction, Request, Response} from '@gravity-ui/expresskit';

import {US_ERRORS} from '../../const';
import {Feature, isEnabledFeature} from '../features';

Expand Down
5 changes: 3 additions & 2 deletions src/components/middlewares/ctx.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Request, Response, NextFunction} from '@gravity-ui/expresskit';
import {resolvePrivatePermissions} from '../private-permissions';
import {NextFunction, Request, Response} from '@gravity-ui/expresskit';

import {DL_COMPONENT_HEADER} from '../../const';
import {resolvePrivatePermissions} from '../private-permissions';

export const ctx = async (req: Request, res: Response, next: NextFunction) => {
const {
Expand Down
5 changes: 3 additions & 2 deletions src/components/middlewares/decode-id.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Utils from '../../utils';
import {Request, Response, NextFunction} from '@gravity-ui/expresskit';
import {NextFunction, Request, Response} from '@gravity-ui/expresskit';
import {AppError} from '@gravity-ui/nodekit';

import US_ERRORS from '../../const/us-error-constants';
import Utils from '../../utils';

export const decodeId = async (req: Request, _res: Response, next: NextFunction) => {
try {
Expand Down
1 change: 1 addition & 0 deletions src/components/middlewares/final-request-handler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Request, Response} from '@gravity-ui/expresskit';
import {AppError} from '@gravity-ui/nodekit';

import prepareErrorResponse from '../error-response-presenter';

export function logError(error: AppError, req: Request) {
Expand Down
3 changes: 2 additions & 1 deletion src/components/middlewares/resolve-special-tokens.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Request, Response, NextFunction} from '@gravity-ui/expresskit';
import {NextFunction, Request, Response} from '@gravity-ui/expresskit';

import {SYSTEM_USER, US_MASTER_TOKEN_HEADER} from '../../const';

function replaceDotsInLogin(login: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/middlewares/resolve-tenant-id.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Request, Response, NextFunction} from '@gravity-ui/expresskit';
import {NextFunction, Request, Response} from '@gravity-ui/expresskit';

export const resolveTenantId = async (req: Request, res: Response, next: NextFunction) => {
const {tenantIdOverride} = req.ctx.config;
Expand Down
7 changes: 4 additions & 3 deletions src/components/middlewares/resolve-workbook-id.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {Request, Response, NextFunction} from '@gravity-ui/expresskit';
import {NextFunction, Request, Response} from '@gravity-ui/expresskit';
import {AppError} from '@gravity-ui/nodekit';
import {US_ERRORS, DL_WORKBOOK_ID_HEADER} from '../../const';
import Utils from '../../utils';

import {Feature, isEnabledFeature} from '../../components/features';
import {DL_WORKBOOK_ID_HEADER, US_ERRORS} from '../../const';
import Utils from '../../utils';

export const resolveWorkbookId = (req: Request, res: Response, next: NextFunction) => {
if (isEnabledFeature(req.ctx, Feature.WorkbookIsolationEnabled)) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/middlewares/set-ci-env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Request, Response, NextFunction} from '@gravity-ui/expresskit';
import {NextFunction, Request, Response} from '@gravity-ui/expresskit';

export const setCiEnv = (req: Request, res: Response, next: NextFunction) => {
res.locals.userId = 'dev-user-id';
Expand Down
3 changes: 2 additions & 1 deletion src/components/middlewares/wait-database.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Request, Response, NextFunction} from '@gravity-ui/expresskit';
import {NextFunction, Request, Response} from '@gravity-ui/expresskit';

import {db} from '../../db';

export const waitDatabase = async (_req: Request, _res: Response, next: NextFunction) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/middlewares/x-dl-context.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Request, Response, NextFunction} from '@gravity-ui/expresskit';
import {NextFunction, Request, Response} from '@gravity-ui/expresskit';

export const dlContext = (req: Request, res: Response, next: NextFunction) => {
res.locals.dlContext = req.headers['x-dl-context'] || '{}';
Expand Down
7 changes: 4 additions & 3 deletions src/components/validation-schema-compiler.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
'use strict';

import {AppError} from '@gravity-ui/nodekit';
import Ajv from 'ajv';

import {
MAX_BRANDING_OBJECT_SYMBOLS,
MAX_META_OBJECT_SYMBOLS,
MAX_UNVERSIONED_DATA_OBJECT_SYMBOLS,
MAX_PRESET_DATA_OBJECT_SYMBOLS,
MAX_BRANDING_OBJECT_SYMBOLS,
MAX_UNVERSIONED_DATA_OBJECT_SYMBOLS,
} from '../const';
import US_ERRORS from '../const/us-error-constants';
import {AppError} from '@gravity-ui/nodekit';

const ajv = new Ajv({
allErrors: true,
Expand Down
3 changes: 2 additions & 1 deletion src/configs/common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {AppConfig} from '@gravity-ui/nodekit';
import {AuthPolicy} from '@gravity-ui/expresskit';
import {AppConfig} from '@gravity-ui/nodekit';

import {US_MASTER_TOKEN_HEADER} from '../const';
import Utils from '../utils';

Expand Down
1 change: 1 addition & 0 deletions src/configs/opensource/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {AppConfig} from '@gravity-ui/nodekit';

import {Feature, FeaturesConfig} from '../../components/features/types';
import {DL_SERVICE_USER_ACCESS_TOKEN} from '../../const';

Expand Down
1 change: 1 addition & 0 deletions src/configs/opensource/development.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {AppConfig} from '@gravity-ui/nodekit';

import {features} from './common';

export default {
Expand Down
1 change: 1 addition & 0 deletions src/configs/opensource/int-testing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {AppConfig} from '@gravity-ui/nodekit';

import {features} from './common';

export default {
Expand Down
1 change: 1 addition & 0 deletions src/configs/opensource/prod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {AppConfig} from '@gravity-ui/nodekit';

import {features} from './common';

export default {
Expand Down
6 changes: 4 additions & 2 deletions src/console.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import repl = require('repl');

import {raw, transaction} from 'objection';

import {Model, db, getId} from './db';
import Entry from './db/models/entry';
import Tenant from './db/models/tenant';
import Utils from './utils';
import {raw, transaction} from 'objection';
import {db, Model, getId} from './db';

async function runConsole(): Promise<void> {
process.env.REPL_MODE = '1';
Expand Down
21 changes: 11 additions & 10 deletions src/controllers/collections.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
import {Request, Response} from '@gravity-ui/expresskit';

import {prepareResponseAsync} from '../components/response-presenter';
import Utils from '../utils';
import {
Mode,
OrderDirection,
OrderField,
createCollection,
deleteCollections,
getCollection,
getCollectionBreadcrumbs,
getCollectionContent,
getCollectionsListByIds,
getRootCollectionPermissions,
getCollectionBreadcrumbs,
moveCollection,
moveCollectionsList,
updateCollection,
OrderField,
OrderDirection,
Mode,
deleteCollections,
getCollectionsListByIds,
} from '../services/new/collection';
import {
formatCollectionModel,
formatCollectionModelsList,
formatCollection,
formatGetCollectionBreadcrumbs,
formatCollectionContent,
formatCollectionModel,
formatCollectionModelsList,
formatCollectionWithOperation,
formatGetCollectionBreadcrumbs,
} from '../services/new/collection/formatters';
import Utils from '../utils';

export default {
create: async (req: Request, res: Response) => {
Expand Down
5 changes: 3 additions & 2 deletions src/controllers/color-palettes.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {Request, Response} from '@gravity-ui/expresskit';

import {prepareResponseAsync} from '../components/response-presenter';
import {
deleteColorPalette,
getColorPalettesList,
getColorPalette,
getColorPalettesList,
updateColorPalette,
} from '../services/color-palettes';
import {createColorPalette} from '../services/color-palettes/create-color-palette';
import {formatColorPaletteList, formatColorPalette} from '../services/color-palettes/formatters';
import {formatColorPalette, formatColorPaletteList} from '../services/color-palettes/formatters';

export default {
create: async (req: Request, res: Response) => {
Expand Down
35 changes: 18 additions & 17 deletions src/controllers/entries.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
import EntryService from '../services/entry.service';
import {Request, Response} from '@gravity-ui/expresskit';

import {prepareResponseAsync} from '../components/response-presenter';
import Utils from '../utils';
import {US_MASTER_TOKEN_HEADER} from '../const';
import NavigationService from '../services/navigation.service';
import * as ST from '../types/services.types';
import {EntryScope} from '../db/models/new/entry/types';
import {
deleteEntry,
DeleteEntryData,
renameEntry,
updateEntry,
getEntryRevisions,
GetEntryRevisionsData,
RelationDirection,
deleteEntry,
getEntryRelations,
getEntryRevisions,
renameEntry,
switchRevisionEntry,
RelationDirection,
updateEntry,
} from '../services/entry';
import EntryService from '../services/entry.service';
import NavigationService from '../services/navigation.service';
import {
getEntry,
GetEntryArgs,
getEntryMeta,
getEntryMetaPrivate,
GetEntryMetaPrivateArgs,
copyEntryToWorkbook,
copyEntriesToWorkbook,
copyEntryToWorkbook,
getEntry,
getEntryMeta,
getEntryMetaPrivate,
} from '../services/new/entry';
import {
formatGetEntryResponse,
formatGetEntryMetaResponse,
formatGetEntryMetaPrivateResponse,
formatEntryModel,
formatGetEntryMetaPrivateResponse,
formatGetEntryMetaResponse,
formatGetEntryResponse,
} from '../services/new/entry/formatters';
import {EntryScope} from '../db/models/new/entry/types';
import * as ST from '../types/services.types';
import Utils from '../utils';

export default {
getEntry: async (req: Request, res: Response) => {
Expand Down
7 changes: 4 additions & 3 deletions src/controllers/favorites.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import FavoriteService from '../services/favorite.service';
import {Request, Response} from '@gravity-ui/expresskit';
import Utils from '../utils';

import {prepareResponseAsync} from '../components/response-presenter';
import * as ST from '../types/services.types';
import Entry from '../db/models/entry';
import FavoriteService from '../services/favorite.service';
import * as ST from '../types/services.types';
import Utils from '../utils';

export default {
getFavorites: async (req: Request, res: Response) => {
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {db} from '../db';
import {Request, Response} from '@gravity-ui/expresskit';

import {db} from '../db';

export default {
ping: async (_: Request, res: Response) => {
res.send({result: 'pong'});
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/locks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Request, Response} from '@gravity-ui/expresskit';
import LockService from '../services/lock.service';

import {prepareResponseAsync} from '../components/response-presenter';
import LockService from '../services/lock.service';
import * as ST from '../types/services.types';

export default {
Expand Down
1 change: 1 addition & 0 deletions src/controllers/states.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Request, Response} from '@gravity-ui/expresskit';

import {prepareResponseAsync} from '../components/response-presenter';
import {createState, getState} from '../services/new/state';
import {formatCreateStateResponse, formatGetStateResponse} from '../services/new/state/formatters';
Expand Down
5 changes: 3 additions & 2 deletions src/controllers/structure-items.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {Request, Response} from '@gravity-ui/expresskit';
import {getStructureItems, Mode, OrderDirection, OrderField} from '../services/new/structure-item';
import Utils from '../utils';

import {prepareResponseAsync} from '../components/response-presenter';
import {Mode, OrderDirection, OrderField, getStructureItems} from '../services/new/structure-item';
import {formatStructureItems} from '../services/new/structure-item/formatters/format-structure-items';
import Utils from '../utils';

export default {
getStructureItems: async (req: Request, res: Response) => {
Expand Down
Loading

0 comments on commit 32387c5

Please sign in to comment.