-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to easily run prettier from CLI #3397
Conversation
/retest |
1 similar comment
/retest |
frontend/package.json
Outdated
@@ -24,7 +24,8 @@ | |||
"test-suite": "ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/protractor integration-tests/protractor.conf.ts", | |||
"debug-test-suite": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' node -r ts-node/register --inspect-brk ./node_modules/.bin/protractor integration-tests/protractor.conf.ts", | |||
"analyze": "NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack --mode=production --profile --json | awk '{if(NR>2)print}' > public/dist/stats.json && ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack-bundle-analyzer --mode static -r public/dist/report.html public/dist/stats.json", | |||
"plugin-stats": "node ./plugin-stats.js" | |||
"plugin-stats": "node ./plugin-stats.js", | |||
"prettier": "prettier '**/*.{js,jsx,ts,tsx}'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems handy to me.
Doesn't hurt anyone to have it. But prettier is run already with eslint. Although running just prettier I'm sure is faster. Tested it in our repo. Running this command just output a lot of noise to the console. Not sure what you intended to it to do. It's not very useful like this. Useful options are |
My goal was to be able to easily do prettier formatting from CLI. I've thought that |
frontend/package.json
Outdated
@@ -24,7 +24,8 @@ | |||
"test-suite": "ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/protractor integration-tests/protractor.conf.ts", | |||
"debug-test-suite": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' node -r ts-node/register --inspect-brk ./node_modules/.bin/protractor integration-tests/protractor.conf.ts", | |||
"analyze": "NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack --mode=production --profile --json | awk '{if(NR>2)print}' > public/dist/stats.json && ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack-bundle-analyzer --mode static -r public/dist/report.html public/dist/stats.json", | |||
"plugin-stats": "node ./plugin-stats.js" | |||
"plugin-stats": "node ./plugin-stats.js", | |||
"prettier": "prettier --write '**/*.{js,jsx,ts,tsx}'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to also format json
? Doing so currently affects 23 files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should.
Can we update eslint to run against json files as well so it's enforced by our ci?
Then we fix them all up and can include json files w/ prettier here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added eslint-plugin-json
for json linting and created json.js
in our eslint-plugin-console
package.
/retest |
Looking good @jtomasek |
I think it's complete now. |
@jtomasek I ran it and since it does not follow I suggest you remove this line and run prettier again to commit all changes so that the next user doesn't find any changes when they run it. |
I've removed the
|
/retest |
/retest |
/test e2e-gcp-console |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, dtaylor113, jtomasek The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
8 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
This actually seems to have broken prettier on the CLI for me. I used to be able to do
Now it runs on all files always. Can we rename this to something like |
No description provided.