@@ -1114,65 +1114,17 @@ task("build-rules-end", [], function () {
1114
1114
if ( fold . isTravis ( ) ) console . log ( fold . end ( "build-rules" ) ) ;
1115
1115
} ) ;
1116
1116
1117
- var lintTargets = compilerSources
1118
- . concat ( harnessSources )
1119
- // Other harness sources
1120
- . concat ( [ "instrumenter.ts" ] . map ( function ( f ) { return path . join ( harnessDirectory , f ) ; } ) )
1121
- . concat ( serverSources )
1122
- . concat ( tslintRulesFiles )
1123
- . concat ( servicesSources )
1124
- . concat ( typingsInstallerSources )
1125
- . concat ( cancellationTokenSources )
1126
- . concat ( [ "Gulpfile.ts" ] )
1127
- . concat ( [ nodeServerInFile , perftscPath , "tests/perfsys.ts" , webhostPath ] )
1128
- . map ( function ( p ) { return path . resolve ( p ) ; } ) ;
1129
- // keep only unique items
1130
- lintTargets = Array . from ( new Set ( lintTargets ) ) ;
1131
-
1132
- function sendNextFile ( files , child , callback , failures ) {
1133
- var file = files . pop ( ) ;
1134
- if ( file ) {
1135
- console . log ( "Linting '" + file + "'." ) ;
1136
- child . send ( { kind : "file" , name : file } ) ;
1137
- }
1138
- else {
1139
- child . send ( { kind : "close" } ) ;
1140
- callback ( failures ) ;
1141
- }
1142
- }
1143
-
1144
- function spawnLintWorker ( files , callback ) {
1145
- var child = child_process . fork ( "./scripts/parallel-lint" ) ;
1146
- var failures = 0 ;
1147
- child . on ( "message" , function ( data ) {
1148
- switch ( data . kind ) {
1149
- case "result" :
1150
- if ( data . failures > 0 ) {
1151
- failures += data . failures ;
1152
- console . log ( data . output ) ;
1153
- }
1154
- sendNextFile ( files , child , callback , failures ) ;
1155
- break ;
1156
- case "error" :
1157
- console . error ( data . error ) ;
1158
- failures ++ ;
1159
- sendNextFile ( files , child , callback , failures ) ;
1160
- break ;
1161
- }
1162
- } ) ;
1163
- sendNextFile ( files , child , callback , failures ) ;
1164
- }
1165
-
1166
1117
desc ( "Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex" ) ;
1167
1118
task ( "lint" , [ "build-rules" ] , ( ) => {
1168
1119
if ( fold . isTravis ( ) ) console . log ( fold . start ( "lint" ) ) ;
1169
- function lint ( project , cb ) {
1170
- const cmd = `node node_modules/tslint/bin/tslint --project ${ project } --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish` ;
1120
+ function lint ( project , cb ) {
1121
+ const fix = process . env . fix || process . env . f ;
1122
+ const cmd = `node node_modules/tslint/bin/tslint --project ${ project } --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish${ fix ? " --fix" : "" } ` ;
1171
1123
console . log ( "Linting: " + cmd ) ;
1172
1124
jake . exec ( [ cmd ] , cb , /** @type {jake.ExecOptions } */ ( { interactive : true , windowsVerbatimArguments : true } ) ) ;
1173
- }
1174
- lint ( "scripts/tslint/tsconfig.json" , ( ) => lint ( "src/tsconfig-base.json" , ( ) => {
1125
+ }
1126
+ lint ( "scripts/tslint/tsconfig.json" , ( ) => lint ( "src/tsconfig-base.json" , ( ) => {
1175
1127
if ( fold . isTravis ( ) ) console . log ( fold . end ( "lint" ) ) ;
1176
1128
complete ( ) ;
1177
- } ) ) ;
1129
+ } ) ) ;
1178
1130
} ) ;
0 commit comments