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

upkeep: add TS support for PostMeta component #310

Merged
merged 6 commits into from
May 3, 2024

Conversation

Sidsector9
Copy link
Member

@Sidsector9 Sidsector9 commented Mar 11, 2024

Description of the Change

Closes #

How to test the Change

Changelog Entry

Changed - add TS support for PostMeta component

Credits

Props @fabiankaegy @Sidsector9

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Copy link

github-actions bot commented Mar 11, 2024

Size Change: -16 B (0%)

Total Size: 65.7 kB

Filename Size Change
dist/index.js 65.7 kB -16 B (0%)

compressed-size-action

Copy link

cypress bot commented Mar 11, 2024

1 failed test on run #811 ↗︎

1 5 0 0 Flakiness 0

Details:

Merge branch 'develop' into upkeep/component-post-meta
Project: 10up Block Components Commit: e7d963a672
Status: Failed Duration: 01:31 💡
Started: Apr 17, 2024 8:33 AM Ended: Apr 17, 2024 8:35 AM
Failed  cypress/e2e/Repeater.spec.js • 1 failed test

View Output

Test Artifacts
Repeater > Adding Repeater field and saving it. Test Replay Screenshots

Review all test suite changes for PR #310 ↗︎

@Sidsector9
Copy link
Member Author

Sidsector9 commented Mar 11, 2024

@fabiankaegy this line

children?: ((metaValue: any, setMetaValue: (value: any) => void) => React.ReactNode);

causes error while linting. I'm not sure why :/

Even if I add the simplest definition like the following, it still gives the same error:

children?: () => void;
Oops! Something went wrong! :(

ESLint: 8.43.0

TypeError: node.params is not iterable
Occurred while linting /Users/siddharth/Documents/block-components/components/post-meta/index.tsx:1
Rule: "@typescript-eslint/no-unused-vars"
    at UnusedVarsVisitor.visitFunctionTypeSignature (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js:144:34)
    at UnusedVarsVisitor.visit (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:72:21)
    at UnusedVarsVisitor.visitChildren (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:59:22)
    at UnusedVarsVisitor.visit (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:77:14)
    at UnusedVarsVisitor.visitChildren (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:59:22)
    at UnusedVarsVisitor.visit (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:77:14)
    at UnusedVarsVisitor.visitChildren (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:59:22)
    at UnusedVarsVisitor.visit (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:77:14)
    at UnusedVarsVisitor.visitChildren (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:54:30)
    at UnusedVarsVisitor.visit (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:77:14)
    at UnusedVarsVisitor.visitChildren (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:59:22)
    at UnusedVarsVisitor.visit (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:77:14)
    at UnusedVarsVisitor.visitChildren (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:54:30)
    at UnusedVarsVisitor.visit (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:77:14)
    at Function.collectUnusedVariables (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js:51:17)
    at Object.collectUnusedVariables (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js:562:30)
    at collectUnusedVariables (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js:160:50)
    at Program:exit (/Users/siddharth/Documents/block-components/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js:327:36)
    at ruleErrorHandler (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/linter.js:1050:28)
    at /Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.leaveNode (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/node-event-generator.js:349:14)
    at CodePathAnalyzer.leaveNode (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:816:23)
    at /Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/linter.js:1087:32
    at Array.forEach (<anonymous>)
    at runRules (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/linter.js:1080:15)
    at Linter._verifyWithoutProcessors (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/linter.js:1330:31)
    at Linter._verifyWithConfigArray (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/linter.js:1706:21)
    at Linter.verify (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/linter.js:1412:65)
    at Linter.verifyAndFix (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/linter/linter.js:1967:29)
    at verifyText (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/cli-engine/cli-engine.js:245:48)
    at CLIEngine.executeOnFiles (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/cli-engine/cli-engine.js:825:28)
    at ESLint.lintFiles (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/eslint/eslint.js:551:23)
    at Object.execute (/Users/siddharth/Documents/block-components/node_modules/eslint/lib/cli.js:391:36)
    at async main (/Users/siddharth/Documents/block-components/node_modules/eslint/bin/eslint.js:135:24)

Copy link

🎉 A new testing version of this package has been published to NPM. You can install it with npm install @10up/block-components@testing-310

@fabiankaegy fabiankaegy merged commit 235ddb2 into develop May 3, 2024
4 of 6 checks passed
@fabiankaegy fabiankaegy deleted the upkeep/component-post-meta branch May 3, 2024 08:48
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