Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between `nx affected:lint --fix` and `nx format:write`

Tags:

nrwl

nrwl-nx

What is the difference between nx affected:lint --fix and nx format:write?

Different articles does seem to mention that code should be formatted with nx format:write command, but it doesn't seem that it fully relies on ESLint rules.

After formatting I keep having ESLint errors.

Am I missing something?

Thanks

like image 648
InsFi Avatar asked May 20 '20 17:05

InsFi


People also ask

What does NX format write do?

Nx saves developers hours of indenting and nitpicks in code review by using Prettier to format code consistently throughout the workspace. What's even more powerful is that Prettier has released a new (highly-requested) feature to format HTML files.

How do you use NX affected?

How does it work? When you run nx affected --target=test , Nx looks at the files you changed in your PR, it will look at the nature of change (what exactly did you update in those files), and it uses this to figure the list of projects in the workspace that can be affected by this change.


1 Answers

so nx format:write does the code formatting using the prettier config which is in the root of the project.

nx affected:lint --fix instead fixes linting problems.

like image 131
Juri Avatar answered Oct 13 '22 03:10

Juri