prettier icon indicating copy to clipboard operation
prettier copied to clipboard

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

Open Kenneth-Sills opened this issue 1 year ago • 0 comments

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.

Kenneth-Sills avatar Jul 24 '24 23:07 Kenneth-Sills