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

chore(examples): enable eslint/strict-boolean-expressions and strictNullChecks #1095

Conversation

danielpeintner
Copy link
Member

This PR addresses one checkmark in #1046.

@@ -80,7 +80,7 @@ WoT.produce({
const listToDelete = [];
for (const id of countdowns.keys()) {
const as = countdowns.get(id);
if (as !== undefined && as.output !== undefined) {
if ((as === null || as === void 0 ? void 0 : as.output) !== undefined) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Interesting to see what the tool-chain makes out of
if (as?.output !== undefined) {

Note: This is not a change in this PR.. we might have forgotten to update the JS in a previous PR..

@@ -396,7 +396,7 @@ Assumes one medium americano if not specified, but time and mode are mandatory f
const paramsp = (await params.value()) as Record<string, unknown>; // : any = await Helpers.parseInteractionOutput(params);

// Check if uriVariables are provided
if (paramsp && typeof paramsp === "object" && "time" in paramsp && "mode" in paramsp) {
if (paramsp != null && typeof paramsp === "object" && "time" in paramsp && "mode" in paramsp) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: What is also "interesting" here is that we cannot simply remove the
paramsp != null
check.

the following code

const paramsp = null;
if (typeof paramsp === "object") {
    console.log("null is object")
}

prints null is object

@danielpeintner
Copy link
Member Author

danielpeintner commented Sep 29, 2023

any reviewer for this PR? It is a very simple one ;-)

Note: Only the .ts files are of interest since the .js files are generated out of it...

Copy link
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

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

Sorry, there we go! lgtm.

@relu91 relu91 merged commit dd7da09 into eclipse-thingweb:master Sep 30, 2023
5 checks passed
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.

2 participants