-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat: noImplicitAny #2379
feat: noImplicitAny #2379
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
cd84852
to
e608d8d
Compare
e608d8d
to
fb4ba8f
Compare
fb4ba8f
to
7f8ec5e
Compare
e28384f
to
2bd013a
Compare
69feedd
to
33bdfc0
Compare
7d5db63
to
1b7aa31
Compare
@@ -32,14 +37,14 @@ function SearchDropdown({ sort, ...otherProps }) { | |||
linkProps={{ | |||
href: formatSearchPath({ | |||
term: suggestion, | |||
sort: sort as SearchState['sort'], | |||
sort: sort, |
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.
suggestion:
sort: sort, | |
sort, |
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.
suggestion:
💯
}), | ||
onClick: () => | ||
onSearchSelection?.( | ||
suggestion, | ||
formatSearchPath({ | ||
term: suggestion, | ||
sort: sort as SearchState['sort'], | ||
sort: sort, |
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.
suggestion:
sort: sort, | |
sort, |
packages/cli/src/utils/generate.ts
Outdated
/** | ||
* Modify TypeScript compilation settings (tsconfig.json) to disable specific strict | ||
* type checking rules when files are moved to the .faststore folder. | ||
* The idea is to change the strict to false when all strict rules are migrated. |
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.
If I got it right, we will remove this part when all rules are migrated, right?
suggestion: maybe we can add a todo markup here - // TODO:
b02d7b1
to
ff8862a
Compare
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.
LGTM 🚀
Team (small change). I changed from ts-expect-error to ts-ignore because ts-expect-error generates an error when the line has no error. In other words, it always expects the line to have an error. However, when I disable noImplictyAny, the lines stop having errors within the .faststore. |
What's the purpose of this pull request?
Strict mode in TypeScript is a way to opt into a more strict type-checking behavior to catch more potential issues at compile time. When enabled, it activates a set of stricter type-checking options that enforce more constraints on your code. Here's how it works and what it does:
No Implicit Any (noImplicitAny): This prevents variables and parameters from defaulting to the any type when TypeScript is unable to infer a more specific type. This helps catch cases where you might have forgotten to specify a type or TypeScript can't infer one for you.
To enable strict mode, you can set "strict": true in your
tsconfig.json
file. This is equivalent to enabling all of the above options individually.The idea of this initiative is to enable rule by rule incrementally so that it is possible to open smaller PRs with low risk.
Task: https://vtex-dev.atlassian.net/browse/SFS-1124
How it works?
The first PR enables
noImplicitAny
rule. So codes like that will not work:What's the type of address?
How to test it?
The pipeline (build, tests, and lint) should work for @faststore packages and their dependencies (current branch).
Install the version of this PR in the starter.store and test if the build, tests and override feature works.
"@faststore/core": "https://pkg.csb.dev/vtex/faststore/commit/1b7aa312/@faststore/core"
"@faststore/cli": "https://pkg.csb.dev/vtex/faststore/commit/1b7aa312/@faststore/cli",
I welcome other suggestions and help with testing 🥇
Starters Deploy Preview
References