-
Notifications
You must be signed in to change notification settings - Fork 138
SNOW-2112371 Add prettier and format the repo #1073
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
base: master
Are you sure you want to change the base?
Conversation
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
@@ -2,7 +2,6 @@ | |||
Please explain the changes you made here. | |||
|
|||
### Checklist | |||
- [ ] Format code according to the existing code style (run `npm run lint:check -- CHANGED_FILES` and fix problems in changed code) |
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.
Removed this one as our GH actions will fail anyway if the code is not linted
singleQuote: true, | ||
tabWidth: 2, | ||
endOfLine: 'lf', | ||
printWidth: 100, |
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.
The default prettier is 80, but since we have lots of log messages, I think it's reasonable to increase it to 100
}, | ||
'rules': { | ||
rules: { |
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 removed all rules that are defaults in prettier
"scripts": { | ||
"lint:check": "eslint && check-dts index.d.ts", | ||
"lint:check:all": "eslint lib samples system_test test && check-dts index.d.ts", |
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 reduced the number of lint scripts to only those that run on the CI/Precommit hook, because developers shouldn't need to run them manually.
In rare cases where a developer needs to run something specific, node supports that using npx eslint ..arguments..
and npx prettier ..arguments..
.
Description
Adds
prettier
and formats all files in the repo.Why? (Pros)
Cons of using prettier?
New libraries added
npm installs
Combination of those 3 allows to autoformat the changed file in a
pre-commit
git hookSecurity Review
https://github.com/snowflakedb/security_reviews/pull/6849
Checklist
npm run test:unit
andnpm run test:integration
)