Skip to content

Commit

Permalink
🚨(eslint) sort module names
Browse files Browse the repository at this point in the history
We were sorting the import path but not the module names.
We added a new rule to sort the module names as well.
It is a automatic fixable rule.
  • Loading branch information
AntoLC committed Jul 17, 2023
1 parent ebd5c00 commit fcb91e7
Show file tree
Hide file tree
Showing 270 changed files with 479 additions and 479 deletions.
6 changes: 0 additions & 6 deletions src/frontend/apps/lti_site/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ module.exports = {
{
files: ['*.ts', '*.tsx'],
rules: {
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
'import/order': [
'error',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
fetchResponseHandler,
fetchWrapper,
} from 'lib-components';
import { useQuery, UseQueryOptions } from 'react-query';
import { UseQueryOptions, useQuery } from 'react-query';

export interface ConfigResponse {
p2p: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
APIList,
fetchList,
FetchListQueryKey,
Organization,
fetchList,
} from 'lib-components';
import { useQuery, UseQueryOptions } from 'react-query';
import { UseQueryOptions, useQuery } from 'react-query';

type OrganizationsResponse = APIList<Organization>;
type UseOrganizationsParams = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import { Nullable } from 'lib-common';
import { forwardRef, Fragment } from 'react';
import { Fragment, forwardRef } from 'react';

import MainLayout from './MainLayout';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Spinner, BoxProps, SpinnerProps } from 'grommet';
import { Box, BoxProps, Spinner, SpinnerProps } from 'grommet';

export const ContentSpinner = ({
boxProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { waitFor, screen, act } from '@testing-library/react';
import { act, screen, waitFor } from '@testing-library/react';
import fetchMock from 'fetch-mock';
import { useP2PConfig, useSentry } from 'lib-components';
import { Deferred, render } from 'lib-tests';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fetchWrapper, useJwt, TokenResponse } from 'lib-components';
import { useMutation, UseMutationOptions } from 'react-query';
import { TokenResponse, fetchWrapper, useJwt } from 'lib-components';
import { UseMutationOptions, useMutation } from 'react-query';

type UseBasicLoginData = {
username: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AnonymousUser, fetchWrapper, User } from 'lib-components';
import { AnonymousUser, User, fetchWrapper } from 'lib-components';

const isPresentWithType = (value: unknown, type: 'string' | 'boolean') => {
return value !== null && value !== undefined && typeof value === type;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fetchWrapper } from 'lib-components';
import { useMutation, UseMutationOptions } from 'react-query';
import { UseMutationOptions, useMutation } from 'react-query';

type UsePasswordResetData = {
email: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fetchWrapper } from 'lib-components';
import { useMutation, UseMutationOptions } from 'react-query';
import { UseMutationOptions, useMutation } from 'react-query';

type UsePasswordResetConfirmData = {
uid: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
TokenResponse,
fetchResponseHandler,
fetchWrapper,
TokenResponse,
} from 'lib-components';

const isValidateChallenge = (response: unknown): response is TokenResponse => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
TokenResponse,
fetchResponseHandler,
fetchWrapper,
TokenResponse,
} from 'lib-components';

export interface IValidateClassroomInvite {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box } from 'grommet';
import { useResponsive } from 'lib-components';
import React, { Fragment, PropsWithChildren, useEffect, useState } from 'react';
import { useIntl, defineMessages } from 'react-intl';
import { defineMessages, useIntl } from 'react-intl';

import imageLeft from 'assets/img/telescope.png';
import { ReactComponent as LogoIcon } from 'assets/svg/logo_marsha.svg';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Link, useLocation, useNavigate } from 'react-router-dom';
import { routes } from 'routes/routes';
import { getLocalStorage } from 'utils/browser';

import { useBasicLogin, UseBasicLoginError } from '../api/basicLogin';
import { UseBasicLoginError, useBasicLogin } from '../api/basicLogin';

const messages = defineMessages({
labelSubmit: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { defineMessages, useIntl } from 'react-intl';
import { useNavigate } from 'react-router-dom';

import {
usePasswordResetConfirm,
UsePasswordResetConfirmError,
usePasswordResetConfirm,
} from '../api/usePasswordResetConfirm';

const messages = defineMessages({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { useNavigate } from 'react-router-dom';
import { routes } from 'routes';

import {
usePasswordReset,
UsePasswordResetError,
usePasswordReset,
} from '../api/usePasswordReset';

const messages = defineMessages({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Box, FormField, Image, Text, ThemeContext } from 'grommet';
import { useResponsive, Select, ClosingCard } from 'lib-components';
import { Fragment, useEffect, useState, useMemo } from 'react';
import { useIntl, defineMessages } from 'react-intl';
import { ClosingCard, Select, useResponsive } from 'lib-components';
import { Fragment, useEffect, useMemo, useState } from 'react';
import { defineMessages, useIntl } from 'react-intl';
import { useLocation } from 'react-router-dom';

import {
getRenaterFerIdpList,
RenaterSamlFerIdp,
getRenaterFerIdpList,
} from '../api/getRenaterFerIdpList';

const messages = defineMessages({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Text, Button, Box } from 'grommet';
import { Box, Button, Text } from 'grommet';
import { Filter } from 'grommet-icons';
import { Breakpoints } from 'lib-common';
import { Playlist, useResponsive } from 'lib-components';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Text, Box } from 'grommet';
import { Box, Text } from 'grommet';
import { Alert } from 'grommet-icons';
import { Fragment, PropsWithChildren, ReactElement } from 'react';
import { defineMessages, useIntl } from 'react-intl';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
AppConfig,
AppConfigProvider,
CurrentResourceContextProvider,
ResourceContext,
isDecodedJwtLTI,
isDecodedJwtWeb,
ResourceContext,
useCurrentResourceContext,
useJwt,
useResponsive,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineMessages, FormattedMessage } from 'react-intl';
import { FormattedMessage, defineMessages } from 'react-intl';

import { ReactComponent as ClassroomsIcon } from 'assets/svg/iko_webinairesvg.svg';
import { LoadSVG } from 'components/Assets';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useVideos, VideosOrderType } from 'lib-video';
import { VideosOrderType, useVideos } from 'lib-video';
import { useState } from 'react';
import { defineMessages, useIntl } from 'react-intl';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineMessages, FormattedMessage } from 'react-intl';
import { FormattedMessage, defineMessages } from 'react-intl';

import { ReactComponent as LiveIcon } from 'assets/svg/iko_live.svg';
import { LoadSVG } from 'components/Assets';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useVideos, VideosOrderType } from 'lib-video';
import { VideosOrderType, useVideos } from 'lib-video';
import { useState } from 'react';
import { defineMessages, useIntl } from 'react-intl';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineMessages, FormattedMessage } from 'react-intl';
import { FormattedMessage, defineMessages } from 'react-intl';

import { ReactComponent as VideoIcon } from 'assets/svg/iko_next.svg';
import { LoadSVG } from 'components/Assets';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import { Fragment } from 'react';
import { FeatureSample, useContentFeatures } from '../store/contentsStore';

import {
classRoomContents,
ClassRoomRouter,
ClassRoomShuffle,
classRoomContents,
routesClassRoom,
} from './ClassRoom';
import { liveContents, LiveRouter, routesLive } from './Live';
import { videoContents, VideoRouter, routesVideo } from './Video';
import { LiveRouter, liveContents, routesLive } from './Live';
import { VideoRouter, routesVideo, videoContents } from './Video';

enum RESOURCES_CHOICES {
VIDEO = 'video',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineMessages, FormattedMessage } from 'react-intl';
import { FormattedMessage, defineMessages } from 'react-intl';

import { ReactComponent as VueListIcon } from 'assets/svg/iko_vuelistesvg.svg';
import { LoadSVG } from 'components/Assets';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box, Text } from 'grommet';
import { Twitter, Facebook, Mail, Linkedin, Github } from 'grommet-icons';
import { Facebook, Github, Linkedin, Mail, Twitter } from 'grommet-icons';
import { Breakpoints } from 'lib-common';
import { StyledLink, useResponsive } from 'lib-components';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { screen, act } from '@testing-library/react';
import { act, screen } from '@testing-library/react';
import { render } from 'lib-tests';
import React from 'react';
import ReactTestUtils from 'react-dom/test-utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Image, Box, Text, Heading } from 'grommet';
import { Box, Heading, Image, Text } from 'grommet';
import { StyledLink, useResponsive } from 'lib-components';
import React, { useState } from 'react';
import { defineMessages, useIntl } from 'react-intl';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render, fireEvent, screen } from '@testing-library/react';
import { fireEvent, render, screen } from '@testing-library/react';
import React from 'react';

import Burger from './Burger';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fetchOne, FetchResponseError } from 'lib-components';
import { useQuery, UseQueryOptions } from 'react-query';
import { FetchResponseError, fetchOne } from 'lib-components';
import { UseQueryOptions, useQuery } from 'react-query';

export interface PageResponse {
slug: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
FetchResponseError,
fetchResponseHandler,
} from 'lib-components';
import { useQuery, UseQueryOptions } from 'react-query';
import { UseQueryOptions, useQuery } from 'react-query';

export interface PagesApi {
slug: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createOne, Playlist } from 'lib-components';
import { useMutation, UseMutationOptions, useQueryClient } from 'react-query';
import { Playlist, createOne } from 'lib-components';
import { UseMutationOptions, useMutation, useQueryClient } from 'react-query';

type UseCreatePlaylistData = {
organization: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Maybe } from 'lib-common';
import { deleteOne, FetchResponseError, Playlist } from 'lib-components';
import { useMutation, UseMutationOptions, useQueryClient } from 'react-query';
import { FetchResponseError, Playlist, deleteOne } from 'lib-components';
import { UseMutationOptions, useMutation, useQueryClient } from 'react-query';

type UseDeletePlaylistData = string;
type UseDeletePlaylistError = FetchResponseError<UseDeletePlaylistData>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
APIList,
fetchList,
FetchListQueryKey,
FetchResponseError,
Playlist,
fetchList,
} from 'lib-components';
import { useQuery, UseQueryOptions } from 'react-query';
import { UseQueryOptions, useQuery } from 'react-query';

export enum PlaylistOrderType {
BY_CREATED_ON = 'created_on',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Route, Routes, useNavigate } from 'react-router-dom';

import { ReactComponent as CheckListIcon } from 'assets/svg/iko_checklistsvg.svg';
import { WhiteCard } from 'components/Cards';
import { commonSortMessages, SortableTable } from 'components/SortableTable';
import { SortableTable, commonSortMessages } from 'components/SortableTable';
import { ITEM_PER_PAGE } from 'conf/global';
import { routes } from 'routes';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createOne, FetchResponseError } from 'lib-components';
import { useMutation, UseMutationOptions, useQueryClient } from 'react-query';
import { FetchResponseError, createOne } from 'lib-components';
import { UseMutationOptions, useMutation, useQueryClient } from 'react-query';

import { PlaylistAccess, PlaylistRole } from '../../types/playlistAccess';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { deleteOne } from 'lib-components';
import { useMutation, UseMutationOptions, useQueryClient } from 'react-query';
import { UseMutationOptions, useMutation, useQueryClient } from 'react-query';

type UseDeletePlaylistAccessData = string;
type UseDeletePlaylistAccessError = { code: 'exception' };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fetchOne, Playlist } from 'lib-components';
import { useQuery, UseQueryOptions } from 'react-query';
import { Playlist, fetchOne } from 'lib-components';
import { UseQueryOptions, useQuery } from 'react-query';

export const usePlaylist = (
id: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { APIList, fetchList, FetchListQueryKey } from 'lib-components';
import { useQuery, UseQueryOptions } from 'react-query';
import { APIList, FetchListQueryKey, fetchList } from 'lib-components';
import { UseQueryOptions, useQuery } from 'react-query';

import { PlaylistAccess } from '../../types/playlistAccess';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
APIList,
fetchList,
FetchListQueryKey,
FetchResponseError,
fetchList,
} from 'lib-components';
import { useQuery, UseQueryOptions } from 'react-query';
import { UseQueryOptions, useQuery } from 'react-query';

export interface UserLite {
email: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { updateOne, Playlist } from 'lib-components';
import { useMutation, UseMutationOptions, useQueryClient } from 'react-query';
import { Playlist, updateOne } from 'lib-components';
import { UseMutationOptions, useMutation, useQueryClient } from 'react-query';

type UseUpdatePlaylistData = {
organization: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { updateOne } from 'lib-components';
import { useMutation, UseMutationOptions, useQueryClient } from 'react-query';
import { UseMutationOptions, useMutation, useQueryClient } from 'react-query';

import { PlaylistAccess, PlaylistRole } from '../../types/playlistAccess';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Heading, Paragraph, Select } from 'grommet';
import { Nullable } from 'lib-common';
import { TextInput, ModalButton } from 'lib-components';
import { ModalButton, TextInput } from 'lib-components';
import { debounce } from 'lodash';
import { Fragment, useEffect, useMemo, useRef, useState } from 'react';
import { defineMessages, useIntl } from 'react-intl';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {
AnonymousUser,
BinSVG,
ButtonLoaderStyle,
useCurrentUser,
Modal,
ModalButton,
ModalControlMethods,
useCurrentUser,
} from 'lib-components';
import { Fragment, useRef, useState } from 'react';
import { toast } from 'react-hot-toast';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createIntl, IntlShape } from 'react-intl';
import { IntlShape, createIntl } from 'react-intl';

import { userRoleOptions } from './UserRoleOptions';

Expand Down
Loading

0 comments on commit fcb91e7

Please sign in to comment.