This Gulp Plugin logs you (detailed explanation below):
- all the imports, which are not used in your typescript files
- all the imports, which have not the same name
- all the semicolons, which are missing
First: Install your plugin as a development dependency:
npm install --save-dev gulp-tsc-optimize-imports
Second: Use it in your gulpfile.js:
var optimizeImports = require('gulp-tsc-optimize-imports');
var typescriptFiles = 'web/**/*.ts';
gulp.task('optimizeImportsTask ', function () {
return gulp.src(typescriptFiles).pipe(optimizeImports());
});
Type: boolean
Default: true
flag, if you want to log all the unused imports. For Example:
import MyClass = my.namespace.to.the.class.MyClass;
Explanation:
The import of MyClass
is never used in this File.
Type: boolean
Default: true
flag, if you want to log your import name differencies. For Example:
import MyClass = my.namespace.to.the.class.YourClass;
Explanation:
MyClass
and YourClass
are different names.
Type: boolean
Default: true
flag, if you want to log your missing semicolons in the import statements For Example:
import MyClass = my.namespace.to.the.class.MyClass
Explanation: There is no semicolon at the end of the line.