nestjs / typescript-starter

Nest framework TypeScript starter :coffee:
https://nestjs.com
1.89k stars 1.07k forks source link

Switch to ESLint? #69

Closed mchelen closed 4 years ago

mchelen commented 5 years ago

It sounds like ESLint is making a major push towards Typescript https://eslint.org/blog/2019/01/future-typescript-eslint

which is supported by the Typescript roadmap https://github.com/Microsoft/TypeScript/issues/29288

Is it ready enough to start switching?

kamilmysliwiec commented 5 years ago

There is no migration plan yet.

mchelen commented 5 years ago

Do you mean no migration plan for TSLint in general or for the typescript-starter repo? Would you be interested in seeing PRs to migrate?

kamilmysliwiec commented 5 years ago

We'll probably follow Angular plans in this case. Once they decide to switch to ESLint, we will do the same :)

jleclanche commented 5 years ago

create-react-app already switched to eslint in its typescript config. Would be nice to see this. @kamilmysliwiec Any reason not to reopen this?

AntoineDoubovetzky commented 5 years ago

@kamilmysliwiec It seems Angular now plans to switch to ESLint: https://github.com/angular/angular-cli/issues/13732#issuecomment-503722431

mchelen commented 5 years ago

Can we reopen this now that TSLint has been deprecated? https://github.com/palantir/tslint/issues/4534

opensas commented 5 years ago

any guide or sample config files for those wanting to use eslint instead of tsling with their nest projects?

I saw a this one on another issue: https://github.com/nestjs/nest/issues/1541

Rogn commented 5 years ago

@opensas you could look at the pull request created by IGassmann to get some inspiration. https://github.com/nestjs/typescript-starter/pull/150

karenkgs commented 5 years ago

I can do it if no one started yet :D

BrunnerLivio commented 5 years ago

To keep you aligned - we already had some discussion on @IGassmann PR #105 regarding the ESLint migration.

We came to the conclusion that we will wait until Angular CLI migrates to ESLint angular/angular-cli/issues#13732. Therefore we want to follow the future Angular ESLint configuration as close as possible. Since there has not been an official statement yet what configuration Angular is planning to use, this issue is unfortunately blocked

Personally I'd suggest we give it some more time. If Angular does not push forward in the upcoming months, we just start the migration sooner.

IGassmann commented 5 years ago

My belief is that @JamesHenry and @alexeagle are creating an ESLint configuration based on https://angular.io/guide/styleguide that is compatible with https://github.com/typescript-eslint/typescript-eslint.

j3bb9z commented 4 years ago

Beware that there are still some bugs in eslint-typescript that need to be addressed, ex. https://github.com/typescript-eslint/typescript-eslint/issues/455

leosuncin commented 4 years ago

Tslint is now marked as deprecated https://github.com/palantir/tslint/releases/tag/6.0.0

kamilmysliwiec commented 4 years ago

Migrated

nechar commented 4 years ago

Thanks, @kamilmysliwiec for the update.

Just felt that it was worth mentioning to the community for devs who have an existing application containing TSLint.

Problem: It was extremely difficult to get the configuration right when trying to upgrade manually (by uninstalling TSLint and then installing ESLint)

Solution: Using the latest NestJS CLI v 6.14.2 (as of 28 Feb 2020), I was able to get the correct ESLint configuration and the compatible plugins that worked perfectly the nest application. (By creating a new NestJS application nest new app-name) After that, all you need to do is

KingDarBoja commented 4 years ago

That migration should have been done via schematics. Maybe it isn't too late?