-
Notifications
You must be signed in to change notification settings - Fork 109
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
refactor: Rewrite in TypeScript. #39
Conversation
Published with #21 to https://npmjs.com/@dc0de/react-apollo-hooks |
Thanks @umidbekkarimov for your great work here. I'll do a full review after Christmas, but right now I have 2 suggestions:
{
"defaultSeverity": "error",
"extends": ["tslint:latest", "tslint-react", "tslint-config-prettier"],
"jsRules": {},
"rules": {
"interface-name": false,
"interface-over-type-literal": false,
"jsx-boolean-value": [true, "never"],
"jsx-no-lambda": false,
"max-classes-per-file": false,
"member-access": false,
"no-implicit-dependencies": true,
"no-submodule-imports": false,
"no-this-assignment": [true, { "allow-destructuring": true }],
"no-unused-expression": [true, "allow-fast-null-checks"],
"only-arrow-functions": false,
"ordered-imports": [
true,
{
"import-sources-order": "lowercase-last",
"named-imports-order": "lowercase-last"
}
],
"prefer-template": true
},
"rulesDirectory": []
} Please let me know if you don't have time for that - I'd do it myself in the next week in that case. |
Done, I tried save git history as much as possible in force pushed commits but git still wants to "remove and add"
Done.
Happy Holidays! |
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'd like to have the git history and changelog (generated by standard-version) easy to follow so I'd like to merge it using the "Squash and merge" option. It would be great if this PR just renames the current files and adds TS types there (so index.js -> index.ts etc.), and splitting hooks to separate files is done in a follow-up PR.
Done, I tried save git history as much as possible in force pushed commits but git still wants to "remove and add"
index.tsx
andobjToKey.ts
files.
Thank you. Anyway, it was easier to compare.
I added some comments. I'm going to split index.ts to separate files after merging this PR (similar how is it done in #42 - I'm going to review that one tomorrow).
src/index.tsx
Outdated
useState, | ||
} from 'react'; | ||
import isEqual from 'react-fast-compare'; | ||
import { Omit, assertApolloClient } from './Utils'; |
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 always try to group builtin node modules (not used here), external dependencies and internal ones together, separated by a blank line. I haven't found a tslint rule or config for that but I think is a good practice. I'd also change that in queryCache.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.
Maybe this is the solution https://github.com/renke/import-sort? I has similar api as prettier: --write
and --list-different
.
@trojanowski Thanks, It's good to have you back! I've resolved your comments. I hate to bring it up, code style changes (e.g. sorting of imports) should be done by tools, not humans. Prettier spoiled me. |
Thank you @umidbekkarimov I added one comment about the new changes.
I agree. Thanks for the tip about import-sort - I'll try to add it. |
@trojanowski I can't find any, maybe you forgot to submit it? |
Yes, sorry. It should be already visible. |
@trojanowski Good catch, done. Also 3 another PRs are on the way 🙂 |
I added one last-minute comment. I think it's the last one :) |
No problem, it's never easy to review 20+ file PRs. Fixed. |
Forgot to push 🤦♂️ |
No description provided.