un-ts / prettier

:package: Opinionated but Incredible Prettier plugins.
https://prettier.vercel.app
MIT License
277 stars 26 forks source link

[prettier-plugin-sh] `requirePragma` Option Not Respected #377

Open Kenneth-Sills opened 3 months ago

Kenneth-Sills commented 3 months ago

None of the languages parsed by the sh plugin support prettier pragma directives, preventing the use of requirePragma.

Adding support would involve adding a hasPragma method with the signature (string) => boolean to the sh parser definition that is used by all added languages. It's probably "good enough" to parse the file, get the first statement, and check the first comment for the pragma content.