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

Comment prettier-ignore not work as expected #454

Open
5 tasks done
yunsii opened this issue Dec 5, 2023 · 0 comments
Open
5 tasks done

Comment prettier-ignore not work as expected #454

yunsii opened this issue Dec 5, 2023 · 0 comments

Comments

@yunsii
Copy link

yunsii commented Dec 5, 2023

Describe the bug

/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {
  const useState: typeof import('react')['useState']
  // ...
}

Comment prettier-ignore only works on the next node in the abstract syntax tree from formatting. So export {} is excluded, but declare global is not, it still be format by prettier.

Reproduction

https://github.com/unplugin/unplugin-auto-import

System Info

System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (16) x64 AMD Ryzen 7 5700G with Radeon Graphics
    Memory: 27.15 GB / 31.35 GB
    Container: Yes
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 18.4.0 - ~/.nvm/versions/node/v18.4.0/bin/node
    npm: 8.12.1 - ~/.nvm/versions/node/v18.4.0/bin/npm
    pnpm: 8.0.0 - ~/.nvm/versions/node/v18.4.0/bin/pnpm
  Browsers:
    Chrome: 115.0.5790.98

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
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

No branches or pull requests

1 participant