Skip to content

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

Merged
bennypowers merged 3 commits into
patternfly:mainfrom
martinpitt:fix-new
Nov 10, 2024
Merged

fix(tools): fix type errors in create-element template#2873
bennypowers merged 3 commits into
patternfly:mainfrom
martinpitt:fix-new

Conversation

@martinpitt

Copy link
Copy Markdown
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
@changeset-bot

changeset-bot Bot commented Nov 8, 2024

Copy link
Copy Markdown

⚠️ 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

@github-actions

github-actions Bot commented Nov 8, 2024

Copy link
Copy Markdown
Contributor

✅ 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
@netlify

netlify Bot commented Nov 10, 2024

Copy link
Copy Markdown

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

@bennypowers bennypowers left a comment

Copy link
Copy Markdown
Member

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
@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