File tree 8 files changed +16
-5
lines changed
examples/routing-with-resources
resource-store/utils/get-resources-for-next-location
8 files changed +16
-5
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " react-resource-router " : patch
3
+ ---
4
+
5
+ Remove cyclic imports and add eslint rule to stop future issues
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ module.exports = {
45
45
'react-hooks/exhaustive-deps' : 'warn' ,
46
46
'react-hooks/rules-of-hooks' : 'error' ,
47
47
semi : 'off' ,
48
+ 'import/no-cycle' : 'error' ,
48
49
} ,
49
50
overrides : [
50
51
{
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
3
+ // eslint-disable-next-line import/no-cycle
3
4
import { homeRoute } from './routes' ;
4
5
5
6
import { Link , useQueryParam } from 'react-resource-router' ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
3
+ // eslint-disable-next-line import/no-cycle
3
4
import { aboutRoute } from './routes' ;
4
5
5
6
import { Link } from 'react-resource-router' ;
Original file line number Diff line number Diff line change
1
+ /* eslint-disable import/no-cycle */
1
2
import { About , aboutResource } from './about' ;
2
3
import { Home , homeResource } from './home' ;
3
4
Original file line number Diff line number Diff line change 1
- import { RouterContext } from '../../../../../index' ;
1
+ import { type RouterContext } from '../../../../../index' ;
2
2
import {
3
3
ResourceStoreContext ,
4
4
RouteResource ,
Original file line number Diff line number Diff line change 1
1
import { useCallback , useMemo } from 'react' ;
2
2
import { createHook } from 'react-sweet-state' ;
3
3
4
+ import { type RouterContext } from '../../../common/types' ;
4
5
import {
5
- RouterContext ,
6
6
RouterStore ,
7
7
useRouterStoreActions ,
8
+ } from '../../../controllers/router-store' ;
9
+ import {
8
10
type EntireRouterState ,
9
11
type AllRouterActions ,
10
- } from '../../../index ' ;
12
+ } from '../../../controllers/router-store/types ' ;
11
13
import {
12
14
RouteResource ,
13
15
RouteResourceResponse ,
14
16
RouteResourceUpdater ,
15
17
UseResourceHookResponse ,
16
- } from '../../index ' ;
18
+ } from '../../common/types ' ;
17
19
import { useResourceStore , useResourceStoreActions } from '../resource-store' ;
18
20
19
21
type UseResourceOptions = {
Original file line number Diff line number Diff line change 1
- import { Plugin , RouterContext } from '../../index' ;
1
+ import type { Plugin , RouterContext } from '../../index' ;
2
2
import type {
3
3
ResourceStoreContext ,
4
4
RouteResourceResponse ,
You can’t perform that action at this time.
0 commit comments