refactor: replace/remove deprecated method calls#587
refactor: replace/remove deprecated method calls#587mgechev merged 1 commit intomgechev:masterfrom rafaelss95:refactor-remove-deprecation-calls
Conversation
|
@mgechev There are two leftovers that I was not able to change because definitely broke some tests: 1st.: codelyzer/src/angular/templates/basicTemplateAstVisitor.ts Lines 182 to 187 in d4bf62d Changing this:
to:
... broke 16 tests. 2nd.: codelyzer/src/angular/sourceMappingVisitor.ts Lines 105 to 108 in d4bf62d Remove this deprecate call broke 66 tests. Could you give me a hand on that? |
| methods.forEach(m => { | ||
| let n = (<any>m.name).text; | ||
| if (n && this.isMethodValidHook(m, interfaces)) { | ||
| let hookName = n.substr(2, n.lenght); |
There was a problem hiding this comment.
Fun fact: lengHt was mispelled (2 times in this class) :)
|
@rafaelss95 thanks for the cleanup! Would you check why the build is failing? |
|
@mgechev so... that was what I asked above, if I change in these 2 places I mentioned, the tests break, I really don't know why. |
I guess we should not use deprecated methods. |
|
I think you don't understand what I mean. I'm trying to say that if I change these leftovers deprecated calls it break some tests. See #587 (comment) |
|
@mgechev I've pushed the changes for those leftovers. Now you can see the full log error in travis. |
|
@mgechev After many unsuccessful attempts trying to replace the two problematic places, I think the best choice for now is to disable the rule for 2 calls: That said, this PR is ready for review. |
|
bump @mgechev. |
|
@rafaelss95 will take a look in a few minutes. |
| "format:check": "npm run format:base -- --list-different", | ||
| "format:fix": "npm run format:base -- --write", | ||
| "lint": "tslint -c tslint.json \"src/**/*.ts\" \"test/**/*.ts\"", | ||
| "lint": "tslint -p . -c tslint.json \"src/**/*.ts\" \"test/**/*.ts\"", |
There was a problem hiding this comment.
Do we need -p? Are we using any rules with type checking?
There was a problem hiding this comment.
I see that's required because of the deprecation rule?
There was a problem hiding this comment.
Yes, deprecation rule requires type information.
| createFailure(s: number, l: number, message: string, fix?: Fix): RuleFailure { | ||
| const { start, length } = this.getMappedInterval(s, l); | ||
| // tslint:disable-next-line:deprecation | ||
| return super.createFailure(start, length, message, fix); |
There was a problem hiding this comment.
Yep, it has been deprecated for over an year. PR palantir/tslint#1952
| } | ||
|
|
||
| const operator = this.codeWithMap.code.slice(expr.left.span.end, expr.right.span.start); | ||
| const { |
There was a problem hiding this comment.
Let's use less of these assignments. A bit hard to follow :-)
This:
deprecationrule to thetslint.json;tslintmethods);