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
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 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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With