File tree 1 file changed +10
-22
lines changed
1 file changed +10
-22
lines changed Original file line number Diff line number Diff line change @@ -36,30 +36,18 @@ describe("define-regexp-handler", () => {
36
36
} )
37
37
38
38
function lint ( text ) {
39
- if ( ESLint ) {
40
- const eslint = new ESLint ( {
41
- cwd : TEST_CWD ,
42
- plugins : { "eslint-plugin-es-x" : plugin } ,
43
- useEslintrc : false ,
44
- overrideConfig : {
45
- parserOptions : {
46
- ecmaVersion : 2019 ,
47
- } ,
48
- plugins : [ "es-x" ] ,
49
- } ,
50
- } )
51
- return eslint
52
- . lintText ( text , { filePath : "test.js" } )
53
- . then ( ( results ) => results [ 0 ] )
54
- }
55
- const engine = new ( require ( "eslint" ) . CLIEngine ) ( {
39
+ const eslint = new ESLint ( {
56
40
cwd : TEST_CWD ,
41
+ plugins : { "eslint-plugin-es-x" : plugin } ,
57
42
useEslintrc : false ,
58
- plugins : [ "es-x" ] ,
59
- parserOptions : {
60
- ecmaVersion : 2019 ,
43
+ overrideConfig : {
44
+ parserOptions : {
45
+ ecmaVersion : 2019 ,
46
+ } ,
47
+ plugins : [ "es-x" ] ,
61
48
} ,
62
49
} )
63
- engine . addPlugin ( "eslint-plugin-es-x" , plugin )
64
- return Promise . resolve ( engine . executeOnText ( text , "test.js" ) . results [ 0 ] )
50
+ return eslint
51
+ . lintText ( text , { filePath : "test.js" } )
52
+ . then ( ( results ) => results [ 0 ] )
65
53
}
You can’t perform that action at this time.
0 commit comments