-
Notifications
You must be signed in to change notification settings - Fork 1
steroids/dev#804 upgrade streoids/eslint-config #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ export const closeNotification = (id: string | null = null) => ({ | |
|
||
export const showNotification = ( | ||
message: string, | ||
// eslint-disable-next-line default-param-last | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. То же что и выше |
||
level: ColorName = null, | ||
params?: IShowNotificationParameters, | ||
) => dispatch => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
/* eslint-disable no-promise-executor-return */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ошибки в каком коде отключает это правило, и почему оно включено для всего файла? |
||
import * as queryString from 'qs'; | ||
import _isArray from 'lodash-es/isArray'; | ||
|
||
|
@@ -9,8 +10,8 @@ declare global { | |
execute: (...args: any[]) => Promise<string>, | ||
}, | ||
} | ||
} | ||
|
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Зачем? |
||
export interface IResourceComponentConfig { | ||
/** | ||
* API-ключ Google для использования Google Maps и других сервисов. | ||
|
@@ -181,6 +182,7 @@ export default class ResourceComponent implements IResourceComponent { | |
lang: this.language || locale.language, | ||
}, | ||
// @ts-ignore | ||
// eslint-disable-next-line | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Какую ошибку выключает эта и следующая команда? |
||
() => new Promise(resolve => window.ymaps.ready(() => resolve(window.ymaps))), | ||
); | ||
} | ||
|
@@ -195,6 +197,7 @@ export default class ResourceComponent implements IResourceComponent { | |
this.RESOURCE_TWITTER_WIDGET, | ||
{}, | ||
// @ts-ignore | ||
// eslint-disable-next-line | ||
() => new Promise(resolve => window.twttr.ready(() => resolve(window.twttr))), | ||
); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ export const defaultFromStringConverter = (value, type, item) => { | |
case 'boolean': | ||
return ['1', 't', 'y'].includes(String(value).substr(0, 1)) || null; | ||
|
||
// eslint-disable-next-line default-case-last | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Тут и дальше можно же просто подвинуть |
||
default: | ||
case 'string': | ||
return value ? String(value) : null; | ||
|
@@ -78,6 +79,7 @@ export const defaultToStringConverter = (value, type, item) => { | |
case 'boolean': | ||
return value ? '1' : null; | ||
|
||
// eslint-disable-next-line default-case-last | ||
default: | ||
case 'string': | ||
case 'number': | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,14 @@ import _isString from 'lodash-es/isString'; | |
import _isFunction from 'lodash-es/isFunction'; | ||
import _isEqual from 'lodash-es/isEqual'; | ||
import _uniqBy from 'lodash-es/uniqBy'; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Нужно вернуть возможность отделять импорты пустой строкой, в идеале привести к такому виду
// перенос строки
// перенос строки
Мне кажется, так сразу будет понятно, откуда что импортируется. import React from 'react';
import useBem from '@steroidsjs/core/hooks/useBem';
import {DateFormatter} from '@steroidsjs/core/ui/format';
import {Text} from '@steroidsjs/core/ui/typography';
import {Link} from '@steroidsjs/core/ui/nav';
import BaseGrid from 'shared/BaseGrid';
import Button from './views/Button; Подобное мы делали в Клиницисте, можно посмотреть тут There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Как вариант There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ProFIT1337 Давай так, да |
||
import {useCallback, useEffect, useMemo, useRef, useState} from 'react'; | ||
import {usePrevious} from 'react-use'; | ||
import {fieldsDataProviderSetItems} from '../actions/fields'; | ||
import {normalizeItems} from '../utils/data'; | ||
import {useComponents, useDispatch} from './index'; | ||
import Enum from '../base/Enum'; | ||
import {getDataProviderItems, getEnumLabels} from '../reducers/fields'; | ||
import {smartSearch} from '../utils/text'; | ||
import {useComponents, useDispatch} from './index'; | ||
|
||
export interface IAutoCompleteConfig { | ||
/** | ||
|
@@ -34,8 +33,8 @@ export interface IAutoCompleteConfig { | |
} | ||
|
||
export type DataProviderItems = string | ||
| ({new(): Enum,}) | ||
| (string | number | {id: string | number | boolean, label: string | Record<string, any> | number, [key: string]: any, })[]; | ||
| ({new(): Enum}) | ||
| (string | number | {id: string | number | boolean, label: string | Record<string, any> | number, [key: string]: any })[]; | ||
|
||
export interface IDataProvider { | ||
/** | ||
|
@@ -226,7 +225,8 @@ export default function useDataProvider(config: IDataProviderConfig): IDataProvi | |
); | ||
const result = searchHandler(dataProvider.action, { | ||
query: config.query, | ||
...(isAuto ? {ids: config.initialSelectedIds} : null), // deprecated logic | ||
// deprecated logic | ||
...(isAuto ? {ids: config.initialSelectedIds} : null), | ||
...(config.initialSelectedIds?.length > 0 ? {withIds: config.initialSelectedIds} : null), | ||
...config.dataProvider.params, | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,9 +47,11 @@ export default function useSaveCursorPosition(config: ISaveCursorPositionConfig) | |
config.inputParams.onChange(value || event.target?.value); | ||
}, [config.inputParams, config.onChangeCallback]); | ||
|
||
const onChangeWithDelay = useMemo(() => config.debounce?.enabled | ||
const onChangeWithDelay = useMemo( | ||
() => config.debounce?.enabled | ||
&& _debounce(onChange, config.debounce?.delayMs ?? DEFAULT_DEBOUNCE_DELAY_MS), | ||
[config.debounce, onChange]); | ||
[config.debounce, onChange], | ||
); | ||
Comment on lines
+50
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Отступы поехали |
||
|
||
return { | ||
inputRef, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему дизейблится правило, а не меняется местами параметр?