Cover photo by Anastasia Taioglou on Unsplash.
Updated to Nx version 11.0.18.
Nx version 11 has built-in support for Angular version 11 and ESLin...
For further actions, you may consider blocking this person and/or reporting abuse
I took this a step further and I think I have successfully bashified it..
You're a legend! Thank you so much for this.
Note: if anyone is struggling to get this work due to zsh errors, you'll want to fix the conditionals by escaping the square brackets since zsh tries to do it's own own thing with those
That's great 😊 I just realized that we might need to treat non-Angular projects differently, somewhat similar to the e2e project, but without the Cypress rules. Maybe we should filter on builders or something like that.
Ah yeah.. you're right. Totally doable though.
Thank you so much for this guide 😊 the json package stopped supporting lookups in v10 (github.com/trentm/json/blob/master...). Any ideas as to how to migrate all those json editing commands?
Hi,
I'm using
json
version 10.0. It complains sometimes. I have it installed globally which usually works. Sometimes you have to install it as a development dependency in the project and usenpx
orpnpx
to run it. If everything fails, installing it as a development dependency and running it through apackage.json
script usually works.Ah!
I was skimming the json changelog and assumed it was the version, as I have successfully done this in the past. But that was on a different machine/environment, so it was probably something else.
Global install and omitting npx solved it for me. Thanks ☺️
THANK YOU! Caps intended .. this was so so useful
After converting my Angular 11 project to eslint according to this tutorial, it takes 20 minutes to do the linting, as opposed to a few seconds before with TSLint. Is there anyone here who has observed the same behavior? Where is the mistake?
Which command do you usually use for linting?
Did you try something like
or
I've already tried both. Likewise ng lint and nx lint. It always takes so long. Isn't that the case with you?
I don't currently have access to a large real world repo, but I just set this one up github.com/LayZeeDK/nx-nrwl-airlin...
There definitely is a mistake because I'm noticing the opposite. I'm getting about 2x speed improvements in my lint builds which at longest took over 20 minutes and now takes about 10 minutes.
It could have to do with operating system. Which operating system are you all using? I'm on Windows 10.
Win 10
Thank you for sharing your experience, David! Is your repository public so I can compare the eslint implementation?
This would be really great, thank you! Can you add the tsconfig, too?
For people wanting to not do the
nx generate @angular-eslint/schematics:convert-tslint-to-eslint
for a lot of projects... install jq and then run the following below:Thanks for this nice suggestion. For some reason, installing
jq
fails on my machine both under Node 10 and Node 12, so I added a PowerShell script and a Bash script using thejson
package to do the same as what you suggest here.Hi. Just ran into a different problem after following this guide.
I'm getting this error: 'cannot read config file ........@typescript-eslint.js'.
The error also says that something on eslint-config-prettier version 8.0.0 and to go here github.com/prettier/eslint-config-... to follow instructions.
I followed their instructions but just can't remove that error, can someone help?
For now I reverted eslint-config-prettier to version 7.2.0 and everything works fine, but would be great if someone could help solving the issue for versions 8+.
Hi, which version of
eslint-config-prettier
gets installed with the latest Nx version?Hi Lars, just made the test, version 6.0.0 gets installed. I think this answers the question, thanks a lot.
So maybe they will address this issue when they start using version 8 of eslint-config-prettier.
There's currently an issue with some
@nrwl/*
packages being released at version11.0.5
while others are still at11.0.4
. I assume this will stabilize soon.Is there a github repo with the final versions for comparing purposes? Thx!
Not right now, but that's a great idea 👍
Here's a more realistic sample project generated using the Nx 11 Angular workspace preset github.com/LayZeeDK/nx-nrwl-airlin...
Happy to let you all know that Nx 11.6 comes with an official TSLint to ESLint (and angular-eslint) migration.
The
@nrwl/angular:convert-tslint-to-eslint
generator was released as part of Nx 11.6.0, but it seems to only migrate one project at a time. If you're looking to bulk convert a workspace, you have to come up with a solution similar to this suggestion.How to generate angular v10 based application?
please help me
Hi, this is already covered in this guide. Look for migrating from existing workspace. These sections start by generating an Nx 10 workspace.