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

Table: Fix linting warning resulting from using any type #2338

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

austinoneil
Copy link
Contributor

@austinoneil austinoneil commented Mar 23, 2024

Description

Updated type emitted from an event to be more strongly typed, avoiding the lint error from using the any type.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Copy link

netlify bot commented Mar 23, 2024

Deploy Preview for moduswebcomponents ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6fbd43b
🔍 Latest deploy log https://app.netlify.com/sites/moduswebcomponents/deploys/660c7e056389150008b8173d
😎 Deploy Preview https://deploy-preview-2338--moduswebcomponents.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 26 (🔴 down 1 from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@austinoneil
Copy link
Contributor Author

An alternate approach would be to use the unknown type for the type parameter on overflowRowAction.

@coliff coliff requested a review from cjwinsor March 25, 2024 09:15
@coliff coliff added the bug Something is wrong and needs to be addressed label Mar 25, 2024
coliff
coliff previously approved these changes Mar 25, 2024
Copy link
Member

@coliff coliff left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM - confirmed lint error is gone with this PR.

@cjwinsor
Copy link
Contributor

cjwinsor commented Mar 25, 2024

@austinoneil I'll check on the use of unknown as a replacement for any tomorrow. We switched it to any a week or 2 ago as a quick fix to get our angular builds working without having the time to take a deeper look. I'll need to see if I can dig back up the open issue with stenciljs output targets where this was being discussed later. Seemingly specific to the EventEmitter codegen, but I'll have to double check.

@coliff coliff requested review from coliff and removed request for coliff April 2, 2024 12:50
@cjwinsor
Copy link
Contributor

cjwinsor commented Apr 2, 2024

@austinoneil For this one, when running npm run build from any of the angular projects, such as angular-workspace\ng16, I get this error, which is what we were getting before we switched this to any.

> angular-workspace@0.0.0-1 build
> ng run @trimble-oss/modus-angular-components:build:production

Building Angular Package

------------------------------------------------------------------------------
Building entry point '@trimble-oss/modus-angular-components'
------------------------------------------------------------------------------
✖ Compiling with Angular sources in Ivy partial compilation mode.
projects/trimble-oss/modus-angular-components/src/lib/stencil-generated/components.ts:1371:15 - error TS2305: Module '"@trimble-oss/modus-web-components"' has no exported member 'OverflowAction'.

1371 import type { OverflowAction as IModusTableRowActionsOverflowAction } from '@trimble-oss/modus-web-components';

I am good with the update just being to set it to unknown for now. This is the same error we were getting when it was previously using the TableRowActionsMenuEvent interface (which is what should be used if a solution is found to support setting it properly while also getting the angular output targets to build.

Copy link
Contributor

@cjwinsor cjwinsor left a comment

Choose a reason for hiding this comment

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

Change to use unknown instead of any. Using an interface on this EventEmitter breaks our Angular builds for some reason.

@austinoneil
Copy link
Contributor Author

@cjwinsor done

@cjwinsor cjwinsor changed the title Fix linting warning resulting from using any type Table: Fix linting warning resulting from using any type Apr 2, 2024
@cjwinsor cjwinsor added the modus-table Modus Table component development label Apr 2, 2024
@cjwinsor cjwinsor merged commit fcf0563 into trimble-oss:main Apr 2, 2024
8 checks passed
austinoneil added a commit to austinoneil/modus-web-components that referenced this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong and needs to be addressed modus-table Modus Table component development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants