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

[INFRA] Activate noImplicitAny compiler option #460

Merged
merged 10 commits into from
Aug 6, 2020
Merged

Conversation

csouchet
Copy link
Member

@csouchet csouchet commented Aug 4, 2020

Covers #421

Already activated, but I remove some ignoring comments

@csouchet csouchet added the chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) label Aug 4, 2020
@csouchet csouchet force-pushed the 421-noImplicitAny branch 2 times, most recently from bd182f1 to 81267fb Compare August 4, 2020 17:19
@csouchet csouchet added the depends on another PR ⚠️ Pull request depending on another one. The depending must be merged first label Aug 4, 2020
@tbouffard tbouffard changed the title [INFRA] Activate TypeScript strict type checking options: noImplicitAny [INFRA] Activate noImplicitAny compiler option Aug 4, 2020
@csouchet csouchet force-pushed the 421-noImplicitAny branch from 81267fb to 5ab41d1 Compare August 5, 2020 07:42
@csouchet csouchet force-pushed the 421-noImplicitAny branch from 48b755d to c27f8f2 Compare August 5, 2020 08:15
@csouchet csouchet force-pushed the 421-noImplicitAny branch from c27f8f2 to dc06629 Compare August 5, 2020 08:35
@csouchet csouchet removed the depends on another PR ⚠️ Pull request depending on another one. The depending must be merged first label Aug 5, 2020
@csouchet csouchet requested a review from tbouffard August 5, 2020 08:35
@csouchet csouchet marked this pull request as ready for review August 5, 2020 08:36
Comment on lines 117 to 123
} else if (kind === ShapeBpmnElementKind.TEXT_ANNOTATION) {
const name = 'text' in bpmnElement ? bpmnElement.text.toString() : undefined;
shapeBpmnElement = new ShapeBpmnElement(bpmnElement.id, name, kind, processId);
} else {
const name = kind === ShapeBpmnElementKind.TEXT_ANNOTATION ? bpmnElement.text : bpmnElement.name;
shapeBpmnElement = new ShapeBpmnElement(bpmnElement.id, name, kind, processId, bpmnElement.instantiate);
const name = 'name' in bpmnElement ? bpmnElement.name : undefined;
const instantiate = 'instantiate' in bpmnElement ? bpmnElement.instantiate : undefined;
shapeBpmnElement = new ShapeBpmnElement(bpmnElement.id, name, kind, processId, instantiate);
Copy link
Member

Choose a reason for hiding this comment

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

❓ I don't fully understand why this change is needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we don't use any as type, there is an error, because all the types don't have all the properties.

So, we can keep as it was before, or we can have it, or we can separate all flownode convertions in dedicated converters.

Copy link
Member

Choose a reason for hiding this comment

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

ok I understand now, I have also done some test locally to see what kind of errors the TS compiler generates.
I don't think we gain something on the code readability here, the code is now harder to read now IMHO

@csouchet csouchet requested a review from tbouffard August 6, 2020 08:11
Copy link
Member

@tbouffard tbouffard left a comment

Choose a reason for hiding this comment

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

ok with the latest changes. As discussed with @csouchet we agreed to add @ts-ignore to avoid complex code structure (check if a property exists) when we know it exists for sure and tests exist

@csouchet csouchet merged commit 1f54955 into master Aug 6, 2020
@csouchet csouchet deleted the 421-noImplicitAny branch August 6, 2020 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants