File tree 3 files changed +25
-7
lines changed
3 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -64,11 +64,20 @@ export function parseForESLint(
64
64
result = parseScript ( code , {
65
65
...options ,
66
66
ecmaVersion : options . ecmaVersion || DEFAULT_ECMA_VERSION ,
67
- parser : getScriptParser ( options . parser , ( ) =>
68
- ( path . extname ( options . filePath || "unknown.js" ) || "" )
67
+ parser : getScriptParser ( options . parser , ( ) => {
68
+ const ext = (
69
+ path
70
+ . extname ( options . filePath || "unknown.js" )
71
+ . toLowerCase ( ) || ""
72
+ )
69
73
// remove dot
70
- . slice ( 1 ) ,
71
- ) ,
74
+ . slice ( 1 )
75
+ if ( / ^ [ j t ] s x $ / u. test ( ext ) ) {
76
+ return [ ext , ext . slice ( 0 , - 1 ) ]
77
+ }
78
+
79
+ return ext
80
+ } ) ,
72
81
} )
73
82
document = null
74
83
locationCalculator = null
Original file line number Diff line number Diff line change
1
+ interface Data {
2
+ greeting : string
3
+ }
4
+
5
+ export default {
6
+ data ( ) : Data {
7
+ return { greeting : "Hello" }
8
+ } ,
9
+ }
Original file line number Diff line number Diff line change @@ -307,10 +307,10 @@ describe("Basic tests", () => {
307
307
} ,
308
308
useEslintrc : false ,
309
309
} )
310
- const report = await cli . lintFiles ( [ "typed.ts" ] )
311
- const messages = report [ 0 ] . messages
310
+ const report = await cli . lintFiles ( [ "typed.ts" , "typed.tsx" ] )
312
311
313
- assert . deepStrictEqual ( messages , [ ] )
312
+ assert . deepStrictEqual ( report [ 0 ] . messages , [ ] )
313
+ assert . deepStrictEqual ( report [ 1 ] . messages , [ ] )
314
314
} )
315
315
}
316
316
} )
You can’t perform that action at this time.
0 commit comments