In the roadmap presented by the TypeScript team for the first half of 2019 there was an announcement to migrate their own linting from TSLint to ESLint as well as starting to do major contributions to bring ESLint up to parity with TSLint. Where I'm unsure how much of the work would be required in the main ESLint repository compared to the monorepo for all the tooling which enables ESLint to support TypeScript. Read more here
Given these news, I wonder if the maintainers of this library are interested in migrating the TSLint rules to work with some current or future version of ESLint? Would be interesting to hear the different aspects under consideration:
On a personal note I am intrigued on the idea of migrating to the generally more popular and performant ESLint. But if the price is losing the rules of this project for any Angular projects I'm using I don't really think it'll be worth the hassle.
Usage of ESLint has been brought up before in #16 but figured this announcement coupled with the long time allowed for a new issue.
This is currently not on the roadmap and I don't see clear benefits of such migration.
Closing the issue for now, but I'll keep it in the back of my head for Q3-Q4 this year.
Palantir has just announced TSLint will be deprecated in favor of ESLint.
thks @mgol for your link; We are going to think about this problem.
Really looking forward to this one. We are in a rough spot currently where we are using ESLint for most stuff but still need TSLint running just for these rules.
I have migrated over 50% of the rules now, and will coordinate with Minko on making an alpha available soon.
I have also created the builder necessary to run ESLint via “ng lint” and will add schematics soon.
Stay tuned!
Angular CLI it's waiting for the migration to ESLint to complete in order to switch to it from TSLint. Maybe this should be coordinated as well.
angular/angular-cli#13732
@JamesHenry Is your work public somewhere? I would be interested in following the progress. 🙂
@glen-84 I had a meeting with Minko yesterday about it :) It will be publicly accessibly (although not documented initially) very soon!
@JamesHenry Any update on this?
@dumptruckman you can follow the progress here. If you have a spare moment, feel free to push a port of any of the not implemented rules to the repo.
Moving the CLI to ESLint is not part of the version 9 timeline, but @JamesHenry already has a CLI builder which will let you opt in.
Unfortunately there is not much progress or any update in this repository.
Could you please give it some attention and at least update the README with an ETA, a TODO list and a way for users to test existing functionality :)
I will add some more information this week, on my vacation.
It’s always important to remember that these are not products - they are communities. I do not get paid to work on it any more than you do.
As Minko noted on the 23rd August, it has been open for a while and we’ve been happy to accept contributions from other members of the community we share together.
Using the tslint-to-eslint-config package seems to have created an ESLint config that does not include codelyzer. Is there guidance on how to add codelyzer back to an .eslintrc.js configuration?
@fr0 you can add them as params to an @typescript-eslint/tslint/config rule entry:
rules: {
// regular eslint rules
// ...
// TypeScript rules not yet available in plugin for eslint
'@typescript-eslint/tslint/config': [
'error',
{
rulesDirectory: ['codelyzer'],
rules: {
'component-selector': [true, 'element', 'demo', 'kebab-case'],
// ...
}
}
]
Note, that any of codelyzer's template-* rules are not compatible with eslint (at least not, when using separate template files, not sure about inline templates though), since there's no angular builder available yet. In that case you might want to keep tslint just for those rules.
As @mgechev notes, you can try ESLint out at any time with your Angular projects by using (and I would suggest watching) the https://github.com/angular-eslint/angular-eslint project on github.
You can check out the latest v9 Angular CLI integration test for how to manually set up ESLint with your Angular CLI projects today:
ESLint config: https://github.com/angular-eslint/angular-eslint/blob/master/packages/integration-tests/fixtures/angular-cli-workspace/.eslintrc.js
Eventually we will introduce an ng add schematic for it. PRs for that and further conversions of Codelyzer rules are more than welcome!
Now that we have quite a few utilities set up in angular-eslint they are pretty straightforward to convert to ESLint! All but one of the rules that the Angular CLI ships with today for TSLint have already been done.
Important Notes
@naeramarth7's comment is not accurate with regards to template rules, they are supported and two have already been converted (the two that the Angular CLI ships with and therefore the highest priority). The comment about the builder is also not accurate, that has existed since the late summer last year.
In response to @fr0 and @naeramarth7 I would not particularly recommend setting up the eslint-plugin-tslint (which I created) unless you absolutely have to. It runs a full instance of TSLint within ESLint and was only intended to provide an ultimate fallback in the early days before many rules had been converted (not just in an Angular context, in a more general TypeScript context). Give angular-eslint another look and please consider contributing! :)
Closing this issue since we've been working on a replacement on top of ESLint.
Most helpful comment
I have migrated over 50% of the rules now, and will coordinate with Minko on making an alpha available soon.
I have also created the builder necessary to run ESLint via “ng lint” and will add schematics soon.
Stay tuned!