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

fix(tools): fix type errors in create-element template #2873

Merged
merged 3 commits into from
Nov 10, 2024

Conversation

martinpitt
Copy link
Contributor

Commit c9bd577 enabled isolatedDeclarations, which introduced these errors in npm new generated components:

TS9008: Method must have an explicit return type annotation with --isolatedDeclarations.
render() {

TS9017: Only const arrays can be inferred with --isolatedDeclarations.
static readonly styles = [styles];

Fixes #2872


Testing Instructions

See #2872. Tested with

npm run new  # name it "pf-cool" or anything else
npm start

Commit c9bd577 enabled `isolatedDeclarations`, which introduced these
errors in `npm new` generated components:

> TS9008: Method must have an explicit return type annotation with --isolatedDeclarations.
> render() {
>
> TS9017: Only const arrays can be inferred with --isolatedDeclarations.
> static readonly styles = [styles];

Fixes patternfly#2872
Copy link

changeset-bot bot commented Nov 8, 2024

⚠️ No Changeset found

Latest commit: b27da42

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Nov 8, 2024

✅ Commitlint tests passed!

More Info
{
  "valid": true,
  "errors": [],
  "warnings": [],
  "input": "fix(tools): fix type errors in create-element template"
}

@zeroedin zeroedin requested a review from bennypowers November 8, 2024 14:30
Copy link

netlify bot commented Nov 10, 2024

Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit 7f8abd9
🔍 Latest deploy log https://app.netlify.com/sites/patternfly-elements/deploys/6730555dcb037c0008a67820
😎 Deploy Preview https://deploy-preview-2873--patternfly-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@bennypowers bennypowers enabled auto-merge (squash) November 10, 2024 06:37
Copy link
Member

@bennypowers bennypowers left a comment

Choose a reason for hiding this comment

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

Just needed a changeset and a fix to package.json

Nice work, and thank you for the contribution!

@bennypowers bennypowers disabled auto-merge November 10, 2024 06:43
@bennypowers bennypowers merged commit fe349ea into patternfly:main Nov 10, 2024
10 of 16 checks passed
@martinpitt martinpitt deleted the fix-new branch November 10, 2024 07:29
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.

npm run new generates broken template with TypeScript errors
2 participants