File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ export class ESLintAdapter {
132
132
}
133
133
134
134
private getESLintResult ( fileName : string , sourceFile : ts . SourceFile ) {
135
- if ( this . ignoredFilepathMap . get ( fileName ) === true ) return [ ] ;
135
+ if ( this . ignoredFilepathMap . get ( fileName . replace ( / \\ / g , '/' ) ) === true ) return [ ] ;
136
136
const configArray = this . configProvider . getConfigArrayForFile ( fileName ) ;
137
137
const configFileContent = configArray . extractConfig ( fileName ) . toCompatibleObjectAsConfigFileContent ( ) ;
138
138
if ( ! isParserModuleNameValid ( configFileContent . parser , path . join ( "@typescript-eslint" , "parser" ) ) ) {
@@ -146,12 +146,12 @@ export class ESLintAdapter {
146
146
}
147
147
148
148
public checkFileToBeIgnored ( fileName : string ) {
149
- if ( fileName . indexOf ( "node_modules" + path . sep ) !== - 1 ) return ;
150
- if ( ! fileName . endsWith ( ".ts" ) && ! fileName . endsWith ( ".tsx" ) ) return ;
149
+ if ( / n o d e _ m o d u l e s [ \\ / ] / i . test ( fileName ) || ! / \. t s x ? $ / i . test ( fileName ) ) return ;
150
+ const normalized = fileName . replace ( / \\ / g , '/' ) ;
151
151
Promise . resolve ( )
152
152
. then ( ( ) => new ESLint ( ) )
153
- . then ( eslint => eslint . isPathIgnored ( fileName ) )
154
- . then ( result => this . ignoredFilepathMap . set ( fileName , result ) ) ;
153
+ . then ( eslint => eslint . isPathIgnored ( normalized ) )
154
+ . then ( result => this . ignoredFilepathMap . set ( normalized , result ) ) ;
155
155
}
156
156
157
157
public getSemanticDiagnostics (
You can’t perform that action at this time.
0 commit comments