SonarSource / SonarTS

Static code analyzer for TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace tslint with typescript-eslint

slikts opened this issue · comments

I want to request a feature.

The TypeScript project has announced that they're shifting focus to eslint from tslint, and other high-profile projects (like CRA, since they've added TS support) are also slated to adopt eslint over tslint. tslint is also a problem for codebases that mix JS and TS, since that means maintaining two linters with separate rulesets. It'd be very beneficial if SonarTS would also integrate with eslint instead of tslint.

hello @slikts , we also follow with interest recent announcements wrt. linting and TypeScript. We don't have concrete plans yet, as this is all quite recent, but we will certainly follow the development and adjust if it makes sense for us.

There is already a plugin for eslint : https://github.com/SonarSource/eslint-plugin-sonarjs
But when I looked at it, there was way less rules than the tslint plugin: a lot of missing rules does not require typescript and could be easily added to the eslint plugin.

For the other, there will be a little more work.

TSLint has also now announced that they will essentially be deprecating the project and focusing on helping migrate all the functionality to TSLint: https://medium.com/palantir/tslint-in-2019-1a144c2317a9

Assuming it'll take at least a few months for the last features missing in ESLint to get in though. Given all of the above I'd assume that many will migrate from TSLint after that. At the same time I do however believe that the speed depends a bit on if and when libraries such as this one also decides to migrate.

Please do use typescript-eslint, TSLint is over.

@saberduck Any news on the migration to eslint? We are certainly seeing the value from using sonarQube in our projects but for our new projects we would like to start using eslint.

Thanks in advance!

@stefanKuijers Yes, we plan to start to work on it soon. Here is a plan https://jira.sonarsource.com/browse/MMF-1775

@saberduck thank you for update. As I see, it already implemented and in testing now. Great work! Looking forward to migrate my monorepo on eslint+sonarts

Any @saberduck Expected release date? Sorry for being impatient.

We migrated all TypeScript rules to ESLint using @typescript-eslint. Now many rules between JS and TS are sharing the same implementation. Analysis for both languages is now in SonarJS plugin. We did the release yesterday and it should appear in the update center of SQ and on SonarCloud in the next few days.

@saberduck thank you very much for update. You did great job, guys. Very appreciated. I will try to incorporate it tomorrow

Thanks for this migration, but SonarTS & SonarJS are always linked. When I want to uninstall SonarTS, SonarJS will be uninstalled too.
Anyone know if a migration doc exists ?

@arnaudforaison you don't need to uninstall SonarTS, just update both of them to the latest version (6.1 for SonarJS and 2.1 for SonarTS). SonarTS plugin is now empty, all analysis is done by SonarJS plugin.

We needed to create empty SonarTS for technical reasons to make update via marketplace easier. This jar will be removed in next LTS version.

Thanks, but what will I do with my Typescript rules in my quality profile ? Because with correct plugins versions (mentionned above), rules applied on my ts files always came from my Typescript quality profile.

@arnaudforaison the same rules are provided by SonarJS plugin now, migration should be transparent and no changes are required.

@saberduck can you please let us know

Expected release date of ESLint-SonarTS?
Expected depreciation date of TSLint-SonarTS ?