I have been using Dan Wahlin's tutorials and online examples to set up Gulp and Typescript, but I am facing an issue with the tslint() function. The problem occurs in my code as follows:
node_modules\tslint\lib\language\walker\ruleWalker.js:18
this.limit = this.sourceFile.getFullWidth();
^
TypeError: Cannot read property 'getFullWidth' of undefined
at EnableDisableRulesWalker.RuleWalker [as constructor] (C:\Users\sscott\Development\OntarioDarts.com\node_modules\tslint\lib\language\walker\ruleWalker.js:18:37)
at EnableDisableRulesWalker.SkippableTokenAwareRuleWalker [as constructor] (C:\Users\sscott\Development\OntarioDarts.com\node_modules\tslint\lib\language\walker\skippableTokenAwareRuleWalker.js:11:16)
at new EnableDisableRulesWalker (C:\Users\sscott\Development\OntarioDarts.com\node_modules\tslint\lib\enableDisableRules.js:13:16)
at Linter.lint (C:\Users\sscott\Development\OntarioDarts.com\node_modules\tslint\lib\tslint.js:16:27)
at C:\Users\sscott\Development\OntarioDarts.com\node_modules\gulp-tslint\index.js:96:34
at respond (C:\Users\sscott\Development\OntarioDarts.com\node_modules\rcloader\index.js:73:7)
at respond (C:\Users\sscott\Development\OntarioDarts.com\node_modules\rcfinder\index.js:140:7)
at next (C:\Users\sscott\Development\OntarioDarts.com\node_modules\rcfinder\index.js:164:16)
at nextTickCallbackWith0Args (node.js:433:9)
at process._tickCallback (node.js:362:13)
I am currently working on Windows 10 and have installed typescript, tslint, gulp-typescript, and gulp-tslint.
Version Information:
├─┬ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="afc8dac3df82dbd6dfcadcccddc6dfdbef9d819e9f819f">[email protected]</a>
│ └── <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7a0e030a1f091908130a0e3a4b544d5449">[email protected]</a>
├─┬ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d7b0a2bba7faa2b0bbbeb1ae97e6f9e2f9e6">[email protected]</a>
│ └─┬ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="394c5e55505f4014534a790b170f1709">[email protected]</a>
│ └─┬ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1861796a7f6b582b3629283628">[email protected]</a>
│ └─┬ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2b4847425e426b19051a051b">[email protected]</a>
│ └── <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d9aeb6abbdaeabb8a999e9f7e9f7eb">[email protected]</a>
├─┬ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="82f6f1eeebecf6c2b1acb0acb3">[email protected]</a>
│ └─┬ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7817080c1115110b0c3848564e5649">[email protected]</a>
│ └── <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="463129342231342736067668766875">[email protected]</a>
└── <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f7838e87928494859e8783b7c6d9c0d9c2">[email protected]</a>
Gulp Task:
module.exports = function (gulp, PlugIns, Settings) {
return function () {
gulp.src([Settings.SourceFiles.TypeScript])
.pipe(PlugIns.plumber())
.pipe(PlugIns.debug())
.pipe(PlugIns.typescript())
.pipe(PlugIns.tslint( {
configuration: {
rules: {
"class-name": true,
"comment-format": [
true,
"check-space",
"check-uppercase"
],
"curly": true,
"eofline": true,
"indent": [
true,
"tabs"
],
"jsdoc-format": true,
"max-line-length": 100,
"no-unreachable": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"quotemark": [
true,
"single",
"avoid-escape"
],
"semicolon": true,
"switch-default": true,
"variable-name": [
true,
"allow-trailing-underscore",
"ban-keywords"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
}
}
}))
.pipe(PlugIns.tslint.report("stylish"))
.pipe(gulp.dest(Settings.Destination.TSCompiled))
;
}
};