@NgModule({
exports: [ RouterModule ],
imports: [ RouterModule.forRoot(
routes,
{ enableTracing: true },
],
})
with tslint.json configuration:
{
"extends": "tslint:recommended",
"rules": {
"no-duplicate-variable": true,
"no-unused-variable": [
true
],
"linebreak-style":false,
"max-line-length":false,
"no-console":false,
"no-shadowed-variable":false,
"variable-name": [
true,
"check-format",
"allow-leading-underscore",
"allow-trailing-underscore"
]
},
"rulesDirectory": [
"node_modules/tslint-eslint-rules/dist/rules"
]
}
Because a picture is better than a long speech :

Give good choice ;)
ps: yes, he misses one ) in snippet
You have two errors at different places. Try validating this :
@NgModule({
exports: [ RouterModule ],
imports: [ RouterModule.forRoot(
routes,
{ enableTracing: true, }
)],
})
I switched , and } to add the trailing comma in the object literal and remove the one in the forRoot function call.
And I added the ) back in the end of the forRoot function call.
Yes, I have specified the missing one )
With the final ) I've not error.
But it's disturbing to have this message with just a missing )
This is odd, but when it come to parsing, the missing closing parenthesis may have seen something completely different to what we may think.
It might have back-tracked to something that is not the RouterModule.forRoot function call.
I don't think the linter can do a lot here, or maybe shut the linter errors if there is a compilation error.
The root issue here is, as suggested, that TSLint should have a better strategy for providing failures when there's a syntax problem. Modifying the title to make that more clear; I must have rediscovered this issue a half dozen times by now. ๐
Per #3946: what about --fix?
Hello, I think TSLint can stop on misconfiguration.
But, it needs a clear message that TSLint is stopped because of a bad configuration.
Developers can then narrow their search field to tslint configuration on errors.
Hi, I just read through the discussion here and it's little unclear for me what decision was made.
Is there a way ESLint reports for syntax errors? I imagine that syntax errors will prevent the correct analysis of a file so it makes sense to report those problems.
The way I saw Gosec (Golang static code analysis tool) handles the syntax errors is by giving Golang syntax errors at the beginning of the output.
Text:

JSON:

Is there a similiar feature in TSLint?
TSLint is being deprecated and no longer accepting pull requests for major new changes or features. See #4534. ๐ฑ
If you'd like to see this change implemented, you have two choices:
๐ It was a pleasure open sourcing with you!
_If you believe this message was posted here in error, please comment so we can re-open the issue!_
๐ค Beep boop! ๐ TSLint is deprecated ๐ _(#4534)_ and you should switch to typescript-eslint! ๐ค
๐ This issue is being locked to prevent further unnecessary discussions. Thank you! ๐
Most helpful comment
Hello, I think TSLint can stop on misconfiguration.
But, it needs a clear message that TSLint is stopped because of a bad configuration.
Developers can then narrow their search field to tslint configuration on errors.