Skip to content

Commit

Permalink
refactor: use direct imports instead of lib imports (#1182)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemmufazalov authored Aug 19, 2024
1 parent 73a7905 commit 7d544b7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
13 changes: 12 additions & 1 deletion src/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@
"selector": "ImportDeclaration[source.value='axios'] :matches(ImportSpecifier[imported.name='isAxiosError'])",
"message": "Please use isAxiosError from utils/response instead of axios",
},
],
],
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": [".*/**/lib"],
"message": "Please use direct imports instead",
},
],
},
],
},
}
3 changes: 2 additions & 1 deletion src/components/ElapsedTime/ElapsedTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import React from 'react';
import {duration} from '@gravity-ui/date-utils';
import {Label} from '@gravity-ui/uikit';

import {HOUR_IN_SECONDS, SECOND_IN_MS, cn} from '../../lib';
import {cn} from '../../utils/cn';
import {HOUR_IN_SECONDS, SECOND_IN_MS} from '../../utils/constants';

const b = cn('ydb-query-elapsed-time');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import React from 'react';
import {Dialog, Link as ExternalLink, Flex, TextInput} from '@gravity-ui/uikit';
import {Controller, useForm} from 'react-hook-form';

import {ENABLE_TRACING_LEVEL_KEY} from '../../../../lib';
import {
selectQueryAction,
setQueryAction,
} from '../../../../store/reducers/queryActions/queryActions';
import type {QuerySettings} from '../../../../types/store/query';
import {cn} from '../../../../utils/cn';
import {ENABLE_TRACING_LEVEL_KEY} from '../../../../utils/constants';
import {
useQueryExecutionSettings,
useSetting,
Expand Down
3 changes: 2 additions & 1 deletion src/containers/Tenant/Query/utils/useSavedQueries.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {SAVED_QUERIES_KEY, useSetting, useTypedSelector} from '../../../../lib';
import {selectSavedQueriesFilter} from '../../../../store/reducers/queryActions/queryActions';
import type {SavedQuery} from '../../../../types/store/query';
import {SAVED_QUERIES_KEY} from '../../../../utils/constants';
import {useSetting, useTypedSelector} from '../../../../utils/hooks';

export function useSavedQueries() {
const [savedQueries] = useSetting<SavedQuery[]>(SAVED_QUERIES_KEY, []);
Expand Down
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-restricted-imports */
/* eslint-disable import/order */
import ReactDOM from 'react-dom/client';

Expand Down
2 changes: 1 addition & 1 deletion src/store/reducers/tenants/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {createSelector} from '@reduxjs/toolkit';
import escapeRegExp from 'lodash/escapeRegExp';

import type {RootState} from '../..';
import {SHOW_DOMAIN_DATABASE_KEY} from '../../../lib';
import {EFlag} from '../../../types/api/enums';
import {SHOW_DOMAIN_DATABASE_KEY} from '../../../utils/constants';
import {ProblemFilterValues, getSettingValue, selectProblemFilter} from '../settings/settings';
import type {ProblemFilterValue} from '../settings/types';

Expand Down

0 comments on commit 7d544b7

Please sign in to comment.