Enable import order (#24091)
* Enable import order * Add new order groups and add consistent-type-imports * Remove types group, move react to top and fix issues * Add store and reducers to the redux group and move imports from types folder to the end * Fix tsc * Remove react rule * Fix test * Fix eslint disable
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b2f36c7cdf
Коммит
d13429aa92
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {GlobalState} from '@mattermost/types/store';
|
||||
import type {GlobalState} from '@mattermost/types/store';
|
||||
|
||||
export const emptyLimits: () => GlobalState['entities']['cloud']['limits'] = () => ({
|
||||
limitsLoaded: true,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {TeamsState} from '@mattermost/types/teams';
|
||||
import type {TeamsState} from '@mattermost/types/teams';
|
||||
|
||||
import {TestHelper} from 'utils/test_helper';
|
||||
|
||||
export const emptyTeams: () => TeamsState = () => ({
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {GlobalState} from '@mattermost/types/store';
|
||||
import type {GlobalState} from '@mattermost/types/store';
|
||||
|
||||
import {General} from 'mattermost-redux/constants';
|
||||
|
||||
import {TestHelper} from 'utils/test_helper';
|
||||
|
||||
const emptyOtherUsersState: Omit<GlobalState['entities']['users'], 'profiles' | 'currentUserId'> = {
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React, {
|
||||
import type {
|
||||
ShallowRendererProps,
|
||||
MountRendererProps} from 'enzyme';
|
||||
import {
|
||||
shallow,
|
||||
mount,
|
||||
} from 'enzyme';
|
||||
import React from 'react';
|
||||
import type {
|
||||
ExoticComponent,
|
||||
ForwardRefExoticComponent,
|
||||
ReactElement,
|
||||
} from 'react';
|
||||
import {
|
||||
createIntl,
|
||||
injectIntl,
|
||||
IntlShape,
|
||||
IntlProvider,
|
||||
} from 'react-intl';
|
||||
import {
|
||||
shallow,
|
||||
mount,
|
||||
ShallowRendererProps,
|
||||
MountRendererProps,
|
||||
} from 'enzyme';
|
||||
import type {
|
||||
injectIntl,
|
||||
IntlShape} from 'react-intl';
|
||||
|
||||
import defaultMessages from 'i18n/en.json';
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
import {shallow} from 'enzyme';
|
||||
|
||||
import Constants from 'utils/constants';
|
||||
import {shallowWithIntl} from 'tests/helpers/intl-test-helper';
|
||||
import Constants from 'utils/constants';
|
||||
|
||||
/**
|
||||
* @param {string} [input] text input
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import type {Theme} from 'mattermost-redux/selectors/entities/preferences';
|
||||
|
||||
import CompassThemeProvider from 'components/compass_theme_provider/compass_theme_provider';
|
||||
import {Theme} from 'mattermost-redux/selectors/entities/preferences';
|
||||
|
||||
import {mountWithIntl} from './intl-test-helper';
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ import {connect, useSelector} from 'react-redux';
|
||||
import {Link, Route} from 'react-router-dom';
|
||||
|
||||
import {getUser} from 'mattermost-redux/selectors/entities/users';
|
||||
|
||||
import mergeObjects from 'packages/mattermost-redux/test/merge_objects';
|
||||
|
||||
import {GlobalState} from 'types/store';
|
||||
|
||||
import {TestHelper} from 'utils/test_helper';
|
||||
|
||||
import type {GlobalState} from 'types/store';
|
||||
|
||||
import {renderWithFullContext, screen} from './react_testing_utils';
|
||||
|
||||
describe('renderWithFullContext', () => {
|
||||
|
||||
@@ -9,15 +9,14 @@ import {IntlProvider} from 'react-intl';
|
||||
import {Provider} from 'react-redux';
|
||||
import {Router} from 'react-router-dom';
|
||||
|
||||
import {DeepPartial} from '@mattermost/types/utilities';
|
||||
|
||||
import mergeObjects from 'packages/mattermost-redux/test/merge_objects';
|
||||
import type {DeepPartial} from '@mattermost/types/utilities';
|
||||
|
||||
import configureStore from 'store';
|
||||
|
||||
import mergeObjects from 'packages/mattermost-redux/test/merge_objects';
|
||||
import mockStore from 'tests/test_store';
|
||||
|
||||
import {GlobalState} from 'types/store';
|
||||
import type {GlobalState} from 'types/store';
|
||||
|
||||
export * from '@testing-library/react';
|
||||
export {userEvent};
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import Adapter from 'enzyme-adapter-react-17-updated';
|
||||
import {configure} from 'enzyme';
|
||||
import Adapter from 'enzyme-adapter-react-17-updated';
|
||||
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
import {Provider} from 'react-redux';
|
||||
import {AnyAction} from 'redux';
|
||||
import thunk, {ThunkDispatch} from 'redux-thunk';
|
||||
import configureStore from 'redux-mock-store';
|
||||
|
||||
import {IntlProvider} from 'react-intl';
|
||||
import {Provider} from 'react-redux';
|
||||
import type {AnyAction} from 'redux';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import thunk from 'redux-thunk';
|
||||
import type {ThunkDispatch} from 'redux-thunk';
|
||||
|
||||
import {GlobalState} from 'types/store';
|
||||
import type {GlobalState} from 'types/store';
|
||||
|
||||
import {defaultIntl} from './helpers/intl-test-helper';
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user