_Please make sure you have read the submission guidelines before posting an issue_
Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.
yarn format or nx format command should not format the files in dist folder.
Please describe the behavior you are expecting
With the latest update yarn format commands formats the dist folder. previously it did not happen.
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
# on the previous version
ng build --prod --vendor-chunk
# to update
yarn update
# to format
yarn format
I just updated the nx workspace and the format command formatted the dist directory.
@nrwl/angular : 8.10.1
@nrwl/cli : 8.10.1
@nrwl/cypress : 8.10.1
@nrwl/eslint-plugin-nx : Not Found
@nrwl/express : Not Found
@nrwl/jest : 8.10.1
@nrwl/linter : 8.10.1
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/react : 8.10.1
@nrwl/schematics : Not Found
@nrwl/tao : 8.10.1
@nrwl/web : 8.10.1
@nrwl/workspace : 8.10.1
typescript : 3.5.3
A minimal reproduction scenario allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem.
Please include any relevant log snippets or files here.
Any other relevant information that will help us help you.
@debuggerpk do you have the prettierignore file and what is in it?
The prettierignore file should contain /dist.
my prettier ignore file has
**/*.html
but it was like this even before the update. also the ngrx selectors and reducers files are now being formatted differently.
I think in recent update, the --affected feature is broken for formatting.
Format command attempts to format every possible file in the workspace. prettierignore does help, but we didn't have anything in the prettierignore file before the update. So I wonder, this is a bug in recent update?
i think @cngarkar has correctly diagnosed the issue.
Same here, I've upgraded to latest nx (v8.12.0) and started seeing dist folder being processed by the formatter, is it that nx used to load the .gitignore config to prettier?
I've observed some inconsistency in the way some of my files were formatted and @cngarkar's comment about the affected feature makes me think it might be related to this issue as well. What I observed is that after upgrading and running the format command some of my files were formatted differently (which I thought was because prettier was updated too), I committed the changes, ran the format command again and some of the same files were re-formatted but it produced a different output, it is mainly around boolean expressions, for example:
First pass:
- (this.popoverRef && !this.popoverRef.overlayElement.contains(clickTarget))
+ this.popoverRef && !this.popoverRef.overlayElement.contains(clickTarget)
Second pass:
- this.popoverRef && !this.popoverRef.overlayElement.contains(clickTarget)
+ this.popoverRef &&
+ !this.popoverRef.overlayElement.contains(clickTarget)
For now I've downgraded to v8.9.0 which doesn't have these issues.
@debuggerpk do you have the prettierignore file and what is in it?
The prettierignore file should contain /dist.
That worked for me!
Most helpful comment
@debuggerpk do you have the prettierignore file and what is in it?
The prettierignore file should contain /dist.