Skip to content
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

Additional typechecking with prettier update #3774

Merged
merged 15 commits into from
Jan 5, 2024

Conversation

bcolloran
Copy link
Contributor

@bcolloran bcolloran commented Jan 3, 2024

updates Prettier, eslint, and typescript to latest versions.

Note that you may need to tweak your vscode settings to get format-on-save working --

I needed to do this to get it working for svelte files:
"""ok, i think for me it was a bad vscode setting. I went to a svelte file, borked the formatting, then did ctrl+shift+p to "format doc" through the command bar. It told me that the prettier plugin didn't know how to format svelte files, and let me choose the svlete plugin. seems to be working now""" (see this slack conversation, which also includes discussion of what Brian needed to do: https://rilldata.slack.com/archives/C04AGHL77PS/p1704405722497439?thread_ts=1704400984.394149&cid=C04AGHL77PS)

Eric needed to do this:
"""To get format-on-save working for me in VSCode, I also had to add to my VSCode config "prettier.documentSelectors": ["**/*.svelte"] described here."""

"react": "^17.0.2",
"react-dom": "^17.0.2",
Copy link
Contributor Author

@bcolloran bcolloran Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

automatic re-sorting of deps, no actual change in /docs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to replicate this re-sorting behavior, but I see *.json is included in the .prettierignore file. How did these re-sort automatically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they actually re-sorted when I was npm installing stuff, not from prettier.

.eslintignore Show resolved Hide resolved
@@ -3,7 +3,8 @@ module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
'plugin:svelte/recommended',
"plugin:@typescript-eslint/recommended-type-checked",
Copy link
Contributor Author

@bcolloran bcolloran Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added current recommended eslint typechecking rules, and then disabled failing rules below so that we can clean them up incrementally

"eslint-plugin-svelte": "^2.35.1",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"typescript": "^5.3.3"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved code quality dev deps to root package.json

"svelte": "^4.0.0",
"svelte-check": "^3.4.3",
"svelte-popperjs": "^1.3.2",
"svelte-preprocess": "^5.0.3",
"tailwindcss": "^3.2.7",
"typescript": "^5.0.0",
"web-common": "*"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved code quality dev deps to root package.json

Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup 💪. Left a couple questions inline.

To get format-on-save working for me in VSCode, I also had to add to my VSCode config "prettier.documentSelectors": ["**/*.svelte"] described here. Maybe call that out for others in the PR description?

.eslintignore Show resolved Hide resolved
"react": "^17.0.2",
"react-dom": "^17.0.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to replicate this re-sorting behavior, but I see *.json is included in the .prettierignore file. How did these re-sort automatically?

tsconfig.json Outdated Show resolved Hide resolved
@@ -43,5 +43,7 @@
"**/*.d.ts",
"**/*.ts",
"**/*.svelte",
"prettier.config.js",
"**/rollup.config.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we instead use rollup.config.ts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm not sure. The rollup config we have is currently js not ts, and I don't know whether rollup includes a tsc preprocessing+compilation step for ts files. I think we can investigate in follow up work.

Comment on lines +123 to +126
? err.policy
: typeof err?.error_description === "string"
? err.error_description
: err?.message;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

@bcolloran bcolloran force-pushed the additional-typechecking-with-prettier-update branch from 6089d2b to 1658872 Compare January 5, 2024 20:19
@bcolloran bcolloran merged commit 1a16943 into main Jan 5, 2024
5 checks passed
@bcolloran bcolloran deleted the additional-typechecking-with-prettier-update branch January 5, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants