-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Issue 17826] Fix ES Lint errors in common\tools\dev\tool #18819
[Issue 17826] Fix ES Lint errors in common\tools\dev\tool #18819
Conversation
…ForProxyEndpoint.ts
…ForProxyEndpoint.ts
…oxy/waitForProxyEndpoint.ts" This reverts commit fc8d7e1.
Thank you for your contribution WeiJun428! We will review the pull request and get back to you soon. |
Thank you for your contribution, WeiJun428! |
|
+@timovv who also worked on some of this. |
Hey @WeiJun428, thanks for the contribution. Regarding the non-null assertion warnings, as you suggest, checking that the object in question is not undefined and then removing the now redundant non-null assertion should be sufficient to stop the lint warning from showing up in both of those cases. I did a bit of work in this area (before I noticed your PR) you can use -- for the case in |
Hi @timovv. Thank you for your help to fix the warning! |
My PR is not passing the test; specifically, it fails the |
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.
Thanks for integrating those changes, @WeiJun428! What you have looks good; I just have a couple of small things that would be nice to sort out. The test failure is related to the use of the dynamic import
vs standard require
-- see my inline comment for details.
Thanks! @timovv. I learn a lot from your suggestions. I have decided to import the |
Thanks for doing that. I can't see any issue with using In terms of suppressing the lint error, an {
// eslint-disable-next-line @typescript-eslint/no-var-requires
...(require(/* ... */) as prettier.Options),
// ...
} |
@timovv that's right, we want to import the file at runtime in this case @WeiJun428 please follow @timovv's suggestion to suppress the warning for require instead of using import. |
@@ -326,7 +326,7 @@ async function makeSampleGenerationInfo( | |||
return undefined as never; | |||
} | |||
|
|||
const moduleInfos = await processSources(projectInfo, sampleSources, fail); | |||
const moduleInfos = await processSources(projectInfo, sampleSources as string[], fail); |
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.
why is this type cast needed?
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.
Yeah. I have fixed it. It is redundant after I added AsyncGenerator<string>
to common/tools/dev-tool/src/util/findMatchingFiles.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.
Looks good! Thanks for your valuable contribution!
I left one minor comment.
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
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.
Looks great!
Thanks @WeiJun428 for the contribution! |
This fixes #17826 for
common\tools\dev-tool
.I basically fixed errors such as
missing return type
,unused escape character
, etc. forts
files incommon\tools\dev-tool
.However, I didn't manage to fix Forbidden non-null assertion warnings in
src\commands\samples\publish.ts
andsrc\util\testProxyUtils.ts
. I try to mute the warning by doing type checkingobject !== undefined
according to TSLint but to not avail. May I get help on this?I will remove the required snippet
-f html -o <package name>-lintReport.html || exit 0
frompackage.json
once the above-mentioned warning is resolved.