File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
16
16
17
17
### Changed
18
18
- [ Docs] [ ` no-relative-packages ` ] : fix typo ([ #3066 ] , thanks [ @joshuaobrien ] )
19
+ - [ Performance] [ ` no-cycle ` ] : dont scc for each linted file ([ #3068 ] , thanks [ @soryy708 ] )
19
20
20
21
## [ 2.30.0] - 2024-09-02
21
22
@@ -1140,6 +1141,7 @@ for info on changes for earlier releases.
1140
1141
1141
1142
[ `memo-parser` ] : ./memo-parser/README.md
1142
1143
1144
+ [ #3068 ] : https://github.com/import-js/eslint-plugin-import/pull/3068
1143
1145
[ #3066 ] : https://github.com/import-js/eslint-plugin-import/pull/3066
1144
1146
[ #3065 ] : https://github.com/import-js/eslint-plugin-import/pull/3065
1145
1147
[ #3052 ] : https://github.com/import-js/eslint-plugin-import/pull/3052
Original file line number Diff line number Diff line change @@ -18,12 +18,18 @@ export default class StronglyConnectedComponentsBuilder {
18
18
}
19
19
20
20
static for ( context ) {
21
- const cacheKey = context . cacheKey || hashObject ( context ) . digest ( 'hex' ) ;
21
+ const settingsHash = hashObject ( {
22
+ settings : context . settings ,
23
+ parserOptions : context . parserOptions ,
24
+ parserPath : context . parserPath ,
25
+ } ) . digest ( 'hex' ) ;
26
+ const cacheKey = context . path + settingsHash ;
22
27
if ( cache . has ( cacheKey ) ) {
23
28
return cache . get ( cacheKey ) ;
24
29
}
25
30
const scc = StronglyConnectedComponentsBuilder . calculate ( context ) ;
26
- cache . set ( cacheKey , scc ) ;
31
+ const visitedFiles = Object . keys ( scc ) ;
32
+ visitedFiles . forEach ( ( filePath ) => cache . set ( filePath + settingsHash , scc ) ) ;
27
33
return scc ;
28
34
}
29
35
You can’t perform that action at this time.
0 commit comments