-
Notifications
You must be signed in to change notification settings - Fork 345
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
client: Port to TypeScript #1457
Draft
jtojnar
wants to merge
18
commits into
master
Choose a base branch
from
ts
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for selfoss canceled.
|
jtojnar
force-pushed
the
ts
branch
2 times, most recently
from
July 30, 2023 13:47
590f2f0
to
9c2be5c
Compare
✅ Deploy Preview for selfoss canceled.
|
jtojnar
force-pushed
the
ts
branch
2 times, most recently
from
June 6, 2024 08:27
78d2233
to
9a83804
Compare
I do not like the formatting very much but at least it is consistent and supports TypeScript. https://typescript-eslint.io/troubleshooting/formatting/ Also replaces `lint:js` npm script in the `client/` directory with `check:js:lint` and adds `check:js` which runs that in addition to newly introduced `check:js:prettify`. This matches how the stylesheet scripts are structured. We are using `eslint-config-prettier` instead of `eslint-plugin-prettier`, the latter would run prettier as part of eslint but we are already running it separately. TODO: Remove stylistic rules from config.
We are exporting other symbols as well and mixing default export with regular ones is considered bad practice apparently.
React 19 removes propTypes, which were deprecated since 2017: https://19.react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-deprecated-react-apis The recommended replacement is using TypeScript. Given that the code base is a mess but dynamic nature of JavaScript gives us little hope of cleaning it without introducing a ton of regressions I have decided to bite the bullet. In this commit, I mostly used https://www.npmjs.com/package/js-to-ts-converter Additionally, I had to perform the following manually changes: - Update references in package.json, index.html and selfoss-base. - Switch to typescript-eslint. - Declare `selfoss` inside `window`.
They have been deprecated since 2017.
Also fix a bug in ajax code not spreading the rest field.
Using static for now to minimize required changes
so that tsc can find it.
Another long standing bug discovered by TypeScript.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.