@@ -2,14 +2,15 @@ import Module from 'module';
2
2
3
3
import { pass , fail , skip } from '@tunnckocore/create-jest-runner' ;
4
4
5
+ import { getExtensionsAndWorkspaces } from '@tunnckocore/utils' ;
5
6
import cosmiconfig from 'cosmiconfig' ;
6
7
import { CLIEngine } from 'eslint' ;
7
8
8
9
const explorer = cosmiconfig ( 'jest-runner' ) ;
9
10
10
11
export default async function jestRunnerESLint ( { testPath, config } ) {
11
12
const start = Date . now ( ) ;
12
- const options = normalizeOptions ( explorer . searchSync ( ) ) ;
13
+ const options = normalizeOptions ( explorer . searchSync ( ) , config . rootDir ) ;
13
14
14
15
if ( config . setupTestFrameworkScriptFile ) {
15
16
// eslint-disable-next-line import/no-dynamic-require,global-require
@@ -88,16 +89,16 @@ export default async function jestRunnerESLint({ testPath, config }) {
88
89
return result ;
89
90
}
90
91
91
- function normalizeOptions ( val ) {
92
+ function normalizeOptions ( val , rootDir ) {
93
+ const { extensions } = getExtensionsAndWorkspaces ( rootDir ) ;
92
94
const cfg = val && val . config ? val . config : { } ;
93
95
const eslintOptions = {
94
96
// ignore: DEFAULT_IGNORE,
95
97
exit : true ,
96
98
warnings : false ,
97
99
maxWarnings : 10 ,
98
100
reporter : 'codeframe' ,
99
- // eslint-disable-next-line no-underscore-dangle
100
- extensions : Object . keys ( Module . _extensions ) ,
101
+ extensions,
101
102
fix : true ,
102
103
reportUnusedDisableDirectives : true ,
103
104
...cfg . eslint ,
0 commit comments