Skip to content

Repo: prettier V3 does not support automatic inline snapshots #9704

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

Closed
scarf005 opened this issue Aug 2, 2024 · 2 comments
Closed

Repo: prettier V3 does not support automatic inline snapshots #9704

scarf005 opened this issue Aug 2, 2024 · 2 comments
Labels
locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. repo maintenance things to do with maintenance of the repo, and not with code/docs triage Waiting for team members to take a look

Comments

@scarf005
Copy link
Contributor

scarf005 commented Aug 2, 2024

Suggestion

   ✖  nx run rule-tester:test
       PASS  tests/flat-config-schema.test.ts
       FAIL  tests/RuleTester.test.ts
        ● Test suite failed to run
      
          Jest: Inline Snapshots are not supported when using Prettier 3.0.0 or above.
          See https://jestjs.io/docs/configuration/#prettierpath-string for alternatives.
      
            at saveInlineSnapshots (../../node_modules/jest-snapshot/build/InlineSnapshots.js:101:15)
      
      Test Suites: 1 failed, 1 passed, 2 total
      Tests:       24 passed, 24 total
      Snapshots:   0 total
      Time:        3.515 s
      Ran all test suites.
      
      
   ✔  nx run eslint-plugin:test (1m)

"prettier": "3.3.2",

would need to either

  • downgrade prettier to V2 or
  • use regular snapshots for tests/RuleTester.test.ts
@scarf005 scarf005 added repo maintenance things to do with maintenance of the repo, and not with code/docs triage Waiting for team members to take a look labels Aug 2, 2024
@JoshuaKGoldberg
Copy link
Member

would need to either

...or manually keep them up-to-date by hand. Which is what I've been (unhappily) doing.

#7112 tracks investigating moving over to Vitest, if anybody's interested.

@JoshuaKGoldberg JoshuaKGoldberg changed the title Repo: prettier V3 does not support inline snapshot Repo: prettier V3 does not support automatic inline snapshots Aug 22, 2024
@JoshuaKGoldberg
Copy link
Member

Closing this out: we're stuck 🤷 Jest + Prettier v3 don't support automatic inline snapshots, and that's the stack we're on. We're not going to downgrade to an older major version of Prettier. I'd rather see us move to the shinier, less-annoying-to-configure Vitest (#7112). Thanks for filing!

@JoshuaKGoldberg JoshuaKGoldberg closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2024
@github-actions github-actions bot added the locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. label Aug 30, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. repo maintenance things to do with maintenance of the repo, and not with code/docs triage Waiting for team members to take a look
Projects
None yet
Development

No branches or pull requests

2 participants