trivago / prettier-plugin-sort-imports

A prettier plugin to sort imports in typescript and javascript files by the provided RegEx order.
Apache License 2.0
3.37k stars 133 forks source link

Parsing .json files and failing. #309

Open 91ranjan opened 3 months ago

91ranjan commented 3 months ago

Environment

Describe the bug

The plugin is picking up all the files prettier is targeting. Other than code files prettier reads json files as well for parsing. It fails for json file with the error

[error] some.json: SyntaxError: Missing semicolon. (2:14) [error] 1 | { [error] 2 | "a": [ [error] 3 | "b" [error] 4 | ] [error] 5 | } [error] 6 |

To Reproduce

Add this plugin to prettier which formats json files.

Expected behaviour

There should be config to exclude the files by regex fro this pugin.

Configuration File (cat .prettierrc, prettier.config.js, .prettier.js) ` importOrder:=