Skip to content

Conversation

@auvred
Copy link
Contributor

@auvred auvred commented Jul 18, 2023

Description

Closes: #15034

TS Playground

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

/** After */
// Now works fine too
path.map(() => "", "readonlyArray");
```
Copy link
Member

Choose a reason for hiding this comment

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

We use Prettier stable and Prettier main instead of before/after. https://github.com/prettier/prettier/blob/main/changelog_unreleased/TEMPLATE.md

@fisker
Copy link
Member

fisker commented Jul 18, 2023

Is it possible to test here? https://github.com/prettier/prettier/tree/main/tests/dts

@auvred
Copy link
Contributor Author

auvred commented Jul 18, 2023

I guess I can add it here

interface PluginAST {
kind: "line";
value: string;
}

@fisker
Copy link
Member

fisker commented Jul 18, 2023

As I tested, if I remove added readonly. The test hangs.

$ yarn jest tests/dts
DeprecationWarning: 'originalKeywordKind' has been deprecated since v5.0.0 and will no longer be usable after v5.2.0. Use 'identifierToKeywordKind(identifier)' instead.
 FAIL  tests/dts/unit/run.js
  ● Test suite failed to run

    Error [ERR_WORKER_OUT_OF_MEMORY]: Worker terminated due to reaching memory limit: JS heap out of memory



Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        94.418 s
Ran all test suites matching /tests\/dts/i.

@auvred
Copy link
Contributor Author

auvred commented Jul 18, 2023

This seems related: #15034 (comment)

Very weird...

@sosukesuzuki sosukesuzuki merged commit ceed405 into prettier:main Jul 21, 2023
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.

TypesScript types issue with node with readonly array and .map, .each on AstPath

3 participants