Issues (576)

src/app/Routes.tsx (13 issues)

Severity
1
import { Outlet, MakeGenerics, ReactLocation, Router } from 'react-location'
2
import { Main } from 'pages'
3
import { Header } from 'shared/ui'
4
import { ErrorBoundary } from 'entities/ErrorBoundary'
5
6
import { fetchMovieDetails } from 'pages/movie/model'
7
8
import { IMovieDetails } from 'types/common'
9
10
export type LocationGenerics = MakeGenerics<{
11
  LoaderData: { movie: IMovieDetails }
12
}>
13
14
const location = new ReactLocation<LocationGenerics>()
15
16
const Routes = () => (
0 ignored issues
show
Function component is not a function declaration
Loading history...
17
  <>
0 ignored issues
show
Fragments should contain more than one child - otherwise, there‘s no need for a Fragment at all.
Loading history...
Expected indentation of 4 space characters but found 2.
Loading history...
JSX not allowed in files with extension '.tsx'
Loading history...
18
    <Router
0 ignored issues
show
Expected indentation of 6 space characters but found 4.
Loading history...
19
      location={location}
0 ignored issues
show
Expected indentation of 8 space characters but found 6.
Loading history...
20
      routes={[
0 ignored issues
show
Expected indentation of 8 space characters but found 6.
Loading history...
JSX attribute values should not contain Arrays created in the same scope
Loading history...
21
        { path: '/', element: <Main /> },
22
        {
23
          path: 'movie',
24
          children: [
25
            {
26
              path: ':movieId',
27
              element: () => import('pages/movie').then(mod => <mod.default />),
0 ignored issues
show
Declare this component outside parent component "Routes" or memoize it. If you want to allow component creation in props, set allowAsProps option to true.
Loading history...
28
              loader: async ({ params: { movieId } }) => {
29
                return {
30
                  movie: await fetchMovieDetails(Number(movieId)),
31
                }
32
              },
33
            },
34
          ],
35
        },
36
      ]}
37
    >
38
      <Header />
0 ignored issues
show
Expected indentation of 8 space characters but found 6.
Loading history...
39
      <ErrorBoundary>
0 ignored issues
show
Expected indentation of 8 space characters but found 6.
Loading history...
JSX element should start in a new line
Loading history...
40
        <Outlet />
0 ignored issues
show
Expected indentation of 10 space characters but found 8.
Loading history...
41
      </ErrorBoundary>
42
    </Router>
43
  </>
44
)
45
46
export { Routes }
47